21import java.awt.geom.Point2D;
22import java.util.ArrayList;
23import java.util.HashMap;
25import java.util.concurrent.ExecutionException;
27import denoptim.gui.GraphViewerPanel.JEdge;
28import denoptim.gui.GraphViewerPanel.JVertex;
29import denoptim.gui.GraphViewerPanel.LabelType;
30import edu.uci.ics.jung.algorithms.layout.ISOMLayout;
31import edu.uci.ics.jung.graph.Graph;
44 new HashMap<LabelType,ArrayList<String>>();
50 new HashMap<LabelType,ArrayList<String>>();
62 for (
JEdge je : graph.getEdges())
70 for (
JEdge je : graph.getEdges())
78 for (
JVertex jv : graph.getVertices())
87 vertexPosition.put(jv.idStr,
new Point2D.Double(p.getX(),p.getY()));
88 }
catch (ExecutionException e)
98 ISOMLayout<JVertex, JEdge> layout)
100 for (
JVertex jv : graph.getVertices())
102 Point2D p = layout.apply(jv);
103 vertexPosition.put(jv.idStr,
new Point2D.Double(p.getX(),p.getY()));
115 ArrayList<String> lst =
new ArrayList<String>();
129 ArrayList<String> lst =
new ArrayList<String>();
142 return new ArrayList<String>();
152 return new ArrayList<String>();
This layout extends the SpringLayout to change its behaviour.
Point2D getVertexPosition(V vertex)
Returns the current value of the position of the given vertex.
An edge in the JUNG Graph.
String id
String identifying this edge within a graph.
a vertex in the JUNG Graph.
String idStr
The string used as identifier of this JVertex in different instances representing the same graph.
This class collects information on how a graph was displayed in a JUNG visialisation server (i....
Map< LabelType, ArrayList< String > > edgesWithLabels
The collection of edges with labels (by label type)
JUNGGraphSnapshot(Graph< JVertex, JEdge > graph, ISOMLayout< JVertex, JEdge > layout)
Map< String, Point2D > vertexPosition
Positions of nodes.
ArrayList< String > getEdgeIDsWithLabel(LabelType labelName)
void processVertex(JVertex v, LabelType lt)
ArrayList< String > getVertexeIDsWithLabel(LabelType labelName)
Map< LabelType, ArrayList< String > > vertexesWithLabels
The collection of vertexes with labels (by label type)
void processEdge(JEdge e, LabelType lt)
JUNGGraphSnapshot(Graph< JVertex, JEdge > graph, DNPSpringLayout< JVertex, JEdge > layout)