diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index 8e238d4..f1ac2ad 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -382,7 +382,7 @@ MethodExecution coordinator = objectCallGraph.getStartPoints().get(0); String coordinatorObjId = coordinator.getThisObjId(); String coordinatorClassName = coordinator.getThisClassName(); - mxICell coordinatorObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), coordinatorObjId, coordinatorClassName, 0, 0, DEFAULT_OBJECT_VERTEX_SIZE.getWidth(), DEFAULT_OBJECT_VERTEX_SIZE.getHeight(), "fillColor=white"); //creates a white vertex. + mxICell coordinatorObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), coordinatorObjId, formatClassName(coordinatorClassName), 0, 0, DEFAULT_OBJECT_VERTEX_SIZE.getWidth(), DEFAULT_OBJECT_VERTEX_SIZE.getHeight(), "fillColor=white"); //creates a white vertex. objectToVertexMap.put(coordinatorObjId, new ObjectVertex(coordinatorClassName, coordinatorObjVxCell, 0, 0)); } @@ -397,7 +397,7 @@ if (srcClassName.contains("[L")) { srcClassName = formatArrayName(srcClassName); } - mxICell srcObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + mxICell srcObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, formatClassName(srcClassName), 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. objectToVertexMap.put(srcObjId, new ObjectVertex(ref.getSrcClassName(), srcObjVxCell, 0, 0)); } // dstSide @@ -408,7 +408,7 @@ if (dstClassName.contains("[L")) { dstClassName = formatArrayName(dstClassName); } - mxICell dstObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), dstObjId, dstClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + mxICell dstObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), dstObjId, formatClassName(dstClassName), 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. objectToVertexMap.put(dstObjId, new ObjectVertex(ref.getDstClassName(), dstObjVxCell, 0, 0)); } } else { @@ -418,7 +418,7 @@ if (srcClassName.contains("[L")) { srcClassName = formatArrayName(srcClassName); } - mxICell srcObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + mxICell srcObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, formatClassName(srcClassName), 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. objectToVertexMap.put(srcObjId, new ObjectVertex(ref.getSrcClassName(), srcObjVxCell, 0, 0)); } String dstObjId = ref.getDstObjectId(); @@ -437,7 +437,7 @@ // When both of the calling and called methods are static. String thisObjId = alias.getObjectId(); String thisClassName = alias.getMethodExecution().getThisClassName(); - mxICell thisObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, thisClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + mxICell thisObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, formatClassName(thisClassName), 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. objectToVertexMap.put(thisObjId, new ObjectVertex(thisClassName, thisObjVxCell, 0, 0)); } } else if (alias.getAliasType() == Alias.AliasType.FORMAL_PARAMETER) { @@ -448,7 +448,7 @@ } if (!objectToVertexMap.containsKey(thisObjId)) { // When the called method is static. - mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, thisClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, formatClassName(thisClassName), 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. objectToVertexMap.put(thisObjId, new ObjectVertex(thisClassName, vertex, 0, 0)); } } diff --git a/src/org/ntlab/deltaViewer/MagnetRONFrame.java b/src/org/ntlab/deltaViewer/MagnetRONFrame.java index b90ccdb..4168f04 100644 --- a/src/org/ntlab/deltaViewer/MagnetRONFrame.java +++ b/src/org/ntlab/deltaViewer/MagnetRONFrame.java @@ -632,9 +632,9 @@ slider.setMinimum(0); slider.setMaximum(aliasList.size()); slider.setPaintTicks(true); - slider.setMajorTickSpacing(1); - slider.setPaintLabels(true); - + slider.setMajorTickSpacing(5); + slider.setMinorTickSpacing(1); + slider.setPaintLabels(true); fFeatureChanged = false; } diff --git a/src/org/ntlab/deltaViewer/MagnetRONViewer.java b/src/org/ntlab/deltaViewer/MagnetRONViewer.java index 49e6479..12a57ac 100644 --- a/src/org/ntlab/deltaViewer/MagnetRONViewer.java +++ b/src/org/ntlab/deltaViewer/MagnetRONViewer.java @@ -259,7 +259,7 @@ try { // Creates a white mxICell of ObjectVertex. objVxCell = - (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), alias.getObjectId(), objVx.getLabel(), + (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), alias.getObjectId(), formatClassName(objVx.getLabel()), srcObjVxCellAbsPt.getX() + overlapWid, srcObjVxCellAbsPt.getY() + overlapHt, DEFAULT_OBJECT_VERTEX_SIZE.getWidth(), DEFAULT_OBJECT_VERTEX_SIZE.getHeight(), "fillColor=white"); @@ -326,7 +326,7 @@ try { // Creates a white mxIcell of ObjectVertex. objVxCell = - (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), objVx.getLabel(), objVx.getLabel(), + (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), objVx.getLabel(), formatClassName(objVx.getLabel()), srcObjVxCellAbsPt.getX() + overlapWidth, srcObjVxCellAbsPt.getY() + overlapHeight, DEFAULT_OBJECT_VERTEX_SIZE.getWidth(), DEFAULT_OBJECT_VERTEX_SIZE.getHeight(), "fillColor=white"); @@ -1726,6 +1726,12 @@ return names; } + protected String formatClassName(String className) { + // Step1 : split "." + String[] classNames = className.split("\\."); + return classNames[classNames.length - 1]; + } + protected String formatMethodSignature(String methodSignature, String thisClassName) { // TODO: Modify algorithm formatMethodSignature(). // Step1 : split "(" @@ -1741,7 +1747,7 @@ int count = methodSignature.split("\\(").length - 1; if (count > 0) i -= count; if (i >= 0 && !thisClassNames[thisClassNames.length - 1].equals(methodSigs[i])) { - if (thisClassNames[thisClassNames.length - 1].equals(methodSigs[i + 1])) i += 1; + if (thisClassNames[thisClassNames.length - 1].equals(methodSigs[i + 1]) || methodSigs[i].matches("[0-9]")) i += 1; sb.append(methodSigs[i]); if (methodSigs.length - i > 1) sb.append("."); }