diff --git a/src/org/ntlab/deltaViewer/DeltaViewer.java b/src/org/ntlab/deltaViewer/DeltaViewer.java index c0174cb..3b101f5 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewer.java +++ b/src/org/ntlab/deltaViewer/DeltaViewer.java @@ -1321,7 +1321,7 @@ if (methodSignature.contains(" ")) { System.out.println(methodSignature); - methodSignature = formatMethodSignature(methodSignature); + methodSignature = formatMethodSignature(methodSignature, methodExec.getThisClassName()); } // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. @@ -1700,6 +1700,7 @@ // deltaAnimation.setExpandEdgeAnimation(new mxPoint(absolutPointSourceVertexCell.getX() + (sourceVertexCell.getGeometry().getWidth() / 2), absolutPointSourceVertexCell.getY() + sourceVertexCell.getGeometry().getHeight()), new mxPoint(absolutPointTargetVertexCell.getX() + (targetVertexCell.getGeometry().getWidth() / 2), absolutPointTargetVertexCell.getY())); // deltaAnimation.startExpandEdgeAnimation(); Object edge = mxgraph.insertDeltaEdge(mxDefaultParent, methodSignature, null, sourceVertexCell, targetVertexCell); + ((mxCell)edge).getParent().remove(((mxCell)edge)); ((mxCell)edge).setParent(mxDefaultParent); mxgraph.orderCells(false, new Object[] {edge}); ((mxCell)edge).setStyle("exitX=0.5;exitY=1;exitPerimeter=1;entryX=0.5;entryY=0;entryPerimeter=1;"); @@ -1745,14 +1746,24 @@ return names; } - private String formatMethodSignature(String methodSignature) { + private String formatMethodSignature(String methodSignature, String thisClassName) { // Step1 : split "(" String[] methodSignatures = methodSignature.split("\\("); methodSignature = methodSignatures[0]; // Step2 : split " " methodSignatures = methodSignature.split(" "); + String tmpMethodSignature = methodSignatures[methodSignatures.length-1]; + // Step2 : split "." + String[] thisClassNames = thisClassName.split("\\."); + methodSignatures = tmpMethodSignature.split("\\."); StringBuffer sb = new StringBuffer(); - sb.append(methodSignatures[methodSignatures.length-1]); + for (int i = 0; i < methodSignatures.length; i++) { + if ((thisClassNames.length > i && !methodSignatures[i].equals(thisClassNames[i])) || thisClassNames.length <= i) { + sb.append(methodSignatures[i]); + if (methodSignatures.length - i > 1) sb.append("."); + } + } +// sb.append(tmpMethodSignature); sb.append("()"); return sb.toString(); }