diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index 9b9ef31..671fce7 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -48,7 +48,7 @@ public void init(IObjectCallGraph objectCallGraph, IAliasCollector aliasCollector, IObjectLayout layout) { this.objectCallGraph = objectCallGraph; this.aliasCollector = aliasCollector; - createObjectVertices(this.objectCallGraph); + createObjectVertices(this.objectCallGraph, aliasCollector); layout.execute(objectCallGraph, aliasCollector, objectToVertexMap); createEdgeToObject(this.objectCallGraph, this.aliasCollector); } @@ -345,8 +345,9 @@ * Create vertices(mxGraph) and OvjectVerticies in {@code objectToVertexMap}. Vertices(mxGraph) coordinate are appropriate. * * @param objectCallGraph + * @param aliasCollector */ - private void createObjectVertices(IObjectCallGraph objectCallGraph) { + private void createObjectVertices(IObjectCallGraph objectCallGraph, IAliasCollector aliasCollector) { //Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { @@ -408,6 +409,17 @@ } } } + for (Alias alias: aliasCollector.getAliasList()) { + if (alias.getAliasType() == Alias.AliasType.THIS) { + if (!objectToVertexMap.containsKey(alias.getObjectId())) { + // When both of the calling and called method are static. + String thisObjId = alias.getObjectId(); + String thisClassName = alias.getMethodExecution().getThisClassName(); + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, thisClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(thisObjId, new ObjectVertex(thisClassName, vertex, 0, 0)); + } + } + } } finally { mxgraph.getModel().endUpdate(); }