diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index 16e1d4f..6a56873 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -14,6 +14,7 @@ import org.jgrapht.graph.DirectedWeightedPseudograph; import org.ntlab.deltaExtractor.Alias; import org.ntlab.deltaExtractor.ExtractedStructure; +import org.ntlab.deltaExtractor.IAliasCollector; import com.mxgraph.canvas.mxGraphics2DCanvas; import com.mxgraph.model.mxCell; @@ -29,7 +30,7 @@ public class CollaborationViewer extends MagnetRONViewer { private IObjectCallGraph objectCallGraph; - private DeltaAliasCollector deltaAliasCollector; + private IAliasCollector aliasCollector; private static Dimension VERTEX_OBJECT_SIZE = new Dimension(70, 70); private static Dimension VERTEX_METHOD_EXECUTION_SIZE = new Dimension(55, 20); @@ -40,16 +41,16 @@ super(); } - public void init(IObjectCallGraph objectCallGraph, DeltaAliasCollector deltaAliasCollector) { + public void init(IObjectCallGraph objectCallGraph, IAliasCollector deltaAliasCollector) { this.objectCallGraph = objectCallGraph; - this.deltaAliasCollector = deltaAliasCollector; + this.aliasCollector = deltaAliasCollector; + // Build a frame, create a graph, and add the graph to the frame so you can actually see the graph. + createObjectVertices(objectCallGraph); + createEdgeToObject(aliasCollector.getAliasList()); } /** Initialize JFrame, make vertex object and edge object. */ public void initAnimation() { - // Build a frame, create a graph, and add the graph to the frame so you can actually see the graph. - createObjectVertices(objectCallGraph); - createEdgeToObject(deltaAliasCollector.getAliasList()); // Fit graph size in visible JFrame. mxGraphView view = mxgraphComponent.getGraph().getView(); @@ -88,7 +89,7 @@ */ public void stepToAnimation(Alias alias) { try { - stepToAnimation(deltaAliasCollector.getAliasList().indexOf(alias)); + stepToAnimation(aliasCollector.getAliasList().indexOf(alias)); } catch (IndexOutOfBoundsException e) { stepToAnimation(-1); }