如何初始化事先知道的顶点位置新的布局?
我创建了一个自定义的JUNG布局类:
public class CustomLayout extends AbstractLayout {
AbstractLayout subLayout = null;
final int WIDTH = 500;
final int HEIGHT = 500;
public CustomLayout(Graph<Vertex, Edge> graph, Transformer<Vertex, Point2D> init) {
super(graph, init);
for (Vertex v : this.getGraph().getVertices()) {
// Assign each vertex a random initial position.
setLocation(v, new Point2D.Double(random * WIDTH, random * HEIGHT);
}
subLayout = new FRLayout(this.getGraph(), ...?, null);
// How do I pass each vertices prior positions?
}
}