How do I initialize vertex locations in a custom JUNG layout?
问题 How do I initialize a new layout with vertex positions known beforehand? I have created a custom JUNG layout class: 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