如何使用事先已知的顶点位置初始化新布局?
我创建了一个自定义的 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?
}
}