diff --git a/src/org/ntlab/deltaExtractor/Alias.java b/src/org/ntlab/deltaExtractor/Alias.java index e3cd69f..617955f 100644 --- a/src/org/ntlab/deltaExtractor/Alias.java +++ b/src/org/ntlab/deltaExtractor/Alias.java @@ -61,7 +61,7 @@ } public String getMethodSignature() { - return occurrencePoint.getMethodExecution().getCallerSideSignature(); + return occurrencePoint.getMethodExecution().getSignature(); } public int getLineNo() { diff --git a/src/org/ntlab/deltaViewer/DeltaViewer.java b/src/org/ntlab/deltaViewer/DeltaViewer.java index 6781893..f7afadb 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewer.java +++ b/src/org/ntlab/deltaViewer/DeltaViewer.java @@ -84,7 +84,7 @@ private int curFrame = 0; private static Dimension VERTEX_OBJECT_SIZE = new Dimension(70, 70); private static Dimension VERTEX_METHOD_EXECUTION_SIZE = new Dimension(55, 20); - private mxPoint coordinatorPoint = new mxPoint(DEFAULT_SIZE.getWidth() / 2 - 50, 100); + private mxPoint coordinatorPoint = new mxPoint(DEFAULT_SIZE.getWidth() / 2 + 75, 100); private DeltaAnimation deltaAnimation; @@ -112,7 +112,11 @@ public void init() { // Build a frame, create a graph, and add the graph to the frame so you can actually see the graph. if(eStructure != null) { - WINDOW_TITLE = "extract delta of:" + eStructure.getDelta().getSrcSide().get(0).getDstClassName() + "(" + eStructure.getDelta().getSrcSide().get(0).getDstObjectId() + ")" + " -> " + eStructure.getDelta().getDstSide().get(0).getDstClassName() + "(" + eStructure.getDelta().getDstSide().get(0).getDstObjectId() + ")"; + List srcSide = eStructure.getDelta().getSrcSide(); + List dstSide = eStructure.getDelta().getDstSide(); + if (srcSide.size() >= 1 && dstSide.size() >= 1) { + WINDOW_TITLE = "extract delta of:" + eStructure.getDelta().getSrcSide().get(0).getDstClassName() + "(" + eStructure.getDelta().getSrcSide().get(0).getDstObjectId() + ")" + " -> " + eStructure.getDelta().getDstSide().get(0).getDstClassName() + "(" + eStructure.getDelta().getDstSide().get(0).getDstObjectId() + ")"; + } } frame = new JFrame(WINDOW_TITLE); @@ -293,6 +297,24 @@ // return getRootParentCell(cell.getParent()); // } + /** + * Whether sourceCell parents contain targetCell + * @param sourceCell + * @param targetCell + * @return + */ + private boolean isParent(mxICell sourceCell, mxICell targetCell) { + mxICell sourceParentCell = sourceCell.getParent(); + if (sourceParentCell == null || sourceParentCell.getValue() == null) { + return false; + } + if (sourceParentCell == targetCell) { + return true; + } + System.out.println(sourceCell.getId() + ", " + sourceParentCell.getId()); + return isParent(sourceParentCell, targetCell); + } + private Point getAbsolutePointforCell(mxICell cell) { Point p1 = cell.getGeometry().getPoint(); if(cell.getParent().getValue() == null || cell == cell.getParent()) { @@ -397,6 +419,7 @@ * @param numFrame AliasList size. */ private void doLastAnimation(int numFrame) { + outputLog(); curFrame = numFrame; Alias alias = deltaAliasCollector.getAliasList().get(numFrame - 1); // Make ObjectEdge and reset position of vertexObject, remove vertexMethodExecution. @@ -409,7 +432,7 @@ String sourceObjectId = fieldUpdateStatement.getContainerObjId(); createObjectRefrence(fieldUpdateStatement, fieldName); - + // Change! String targetObjectId = fieldUpdateStatement.getValueObjId(); ObjectVertex targetObjectVertex = objectToVertexMap.get(targetObjectId); @@ -427,6 +450,9 @@ removeCalledMethodExecutionVertex(objectToVertexMap.get(sourceObjectId), alias.getMethodExecution().getCallerMethodExecution(), alias.getMethodExecution()); updateObjectVertices(); + ObjectVertex targetParentObjVertex = objectToVertexMap.get(calledMethodExec.getThisObjId()); + deltaAnimation.setVertexAnimation((mxCell)targetParentObjVertex.getCell(), new mxPoint(targetParentObjVertex.getInitialX(), targetParentObjVertex.getInitialY())); + deltaAnimation.startVertexAnimation(); } if(statement instanceof MethodInvocation) { @@ -439,7 +465,7 @@ String sourceObjectId = methodExec.getThisObjId(); createObjectRefrence(methodExec); - + // Change! String targetObjectId = methodExec.getArguments().get(0).getId(); ObjectVertex targetObjectVertex = objectToVertexMap.get(targetObjectId); @@ -521,7 +547,7 @@ } } else { outputLog(); - + // Change! List arguments = new ArrayList<>(methodExecToVertexMap.get(methodExec).getArguments()); List locals = new ArrayList<>(methodExecToVertexMap.get(methodExec).getLocals()); @@ -679,6 +705,7 @@ private void createObjectRefrence(FieldUpdate fieldUpdateStatement, String fieldName) { String sourceObjectId = fieldUpdateStatement.getContainerObjId(); String targetObjectId = fieldUpdateStatement.getValueObjId(); + mxICell sourceCell = (mxICell)objectToVertexMap.get(sourceObjectId).getCell(); mxICell targetCell = (mxICell)objectToVertexMap.get(targetObjectId).getCell(); Point absolutePointTargetCell = getAbsolutePointforCell(targetCell); @@ -694,7 +721,6 @@ deltaAnimation.startVertexAnimation(); targetCell.getGeometry().setX(objectToVertexMap.get(targetObjectId).getInitialX()); targetCell.getGeometry().setY(objectToVertexMap.get(targetObjectId).getInitialY()); - } private void createObjectRefrence(MethodExecution methodExec) { @@ -846,7 +872,7 @@ * Source VertexObject move target VertexMethodExecution to Argument position from MethodExecution. * * @param methodExec MethodExecution. - * @param sourceVertexObject + * @param sourceVertexObject move * @param targetVertexMethodExec */ private void moveArgumentObjectVertex(MethodExecution methodExec, ObjectVertex sourceVertexObject, MethodExecutionVertex targetVertexMethodExec) { @@ -882,26 +908,77 @@ sourceCell.getParent().remove(sourceCell); } - sourceCell.setParent(targetCell.getParent()); - targetCell.getParent().insert(sourceCell); - Point absolutePointSourceParentCell = getAbsolutePointforCell(sourceCell.getParent()); - sourceCell.getGeometry().setX(sourceX - absolutePointSourceParentCell.getX()); - sourceCell.getGeometry().setY(sourceY - absolutePointSourceParentCell.getY()); + if (!isParent(targetCell, sourceCell)) { + sourceCell.setParent(targetCell.getParent()); + targetCell.getParent().insert(sourceCell); + Point absolutePointSourceParentCell = getAbsolutePointforCell(sourceCell.getParent()); + sourceCell.getGeometry().setX(sourceX - absolutePointSourceParentCell.getX()); + sourceCell.getGeometry().setY(sourceY - absolutePointSourceParentCell.getY()); - double sourceWidth = sourceCell.getGeometry().getWidth(); - double sourceHeight = sourceCell.getGeometry().getHeight(); - double overlapWidth = sourceWidth - (sourceWidth * Math.sqrt(2) * 0.1); - double overlapHeight = sourceHeight - (sourceHeight * Math.sqrt(2) * 0.1); + double sourceWidth = sourceCell.getGeometry().getWidth(); + double sourceHeight = sourceCell.getGeometry().getHeight(); + double overlapWidth = sourceWidth - (sourceWidth * Math.sqrt(2) * 0.1); + double overlapHeight = sourceHeight - (sourceHeight * Math.sqrt(2) * 0.1); - deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); - deltaAnimation.startVertexAnimation(); + deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); + deltaAnimation.startVertexAnimation(); - // sourceCell.setParent(targetCell.getParent()); - // targetCell.getParent().insert(sourceCell); - sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth); - sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); - targetVertexMethodExec.getArguments().add(sourceVertexObject); - System.out.println("moveArgumentObejctVertex" + targetVertexMethodExec.getLabel() + " :Argument: " + sourceVertexObject.getLabel()); + // sourceCell.setParent(targetCell.getParent()); + // targetCell.getParent().insert(sourceCell); + sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth); + sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); + targetVertexMethodExec.getArguments().add(sourceVertexObject); + System.out.println("moveArgumentObejctVertex" + targetVertexMethodExec.getLabel() + " :Argument: " + sourceVertexObject.getLabel()); + } else { // �d�l��̃o�O, ���[�v������ + outputLog(); +// try { + // ObjectVertex(sourceCell)�̃N���[������ +// mxICell cloneSourceCell = (mxICell) mxgraph.addCell(sourceCell.clone()); +// +// cloneSourceCell.setStyle("fillColor=#ffffff;opacity=50;shape=ellipse"); +// cloneSourceCell.setId("clone" + cloneSourceCell.getId()); +// cloneSourceCell.setValue(null); +// cloneSourceCell.setParent(sourceCell); +// sourceCell.insert(cloneSourceCell); +// cloneSourceCell.getGeometry().setX(0); +// cloneSourceCell.getGeometry().setX(0); +// cloneSourceCell.getGeometry().setY(0); + + // ����ObjectVertex + Point absPtSourceCell = getAbsolutePointforCell(sourceCell); + Point absPtTargetParentCell = getAbsolutePointforCell(targetCell.getParent()); + + sourceCell.remove(targetCell.getParent()); + targetCell.getParent().setParent(mxDefaultParent); + sourceCell.setParent(targetCell.getParent()); + targetCell.getParent().insert(sourceCell); + + targetCell.getParent().getGeometry().setX(absPtTargetParentCell.getX()); + targetCell.getParent().getGeometry().setY(absPtTargetParentCell.getY()); + sourceCell.getGeometry().setX(absPtSourceCell.getX() - absPtTargetParentCell.getX()); + sourceCell.getGeometry().setY(absPtSourceCell.getY() - absPtTargetParentCell.getY()); + sourceCell.setStyle("opacity=50;shape=ellipse"); + + double sourceWidth = sourceCell.getGeometry().getWidth(); + double sourceHeight = sourceCell.getGeometry().getHeight(); +// double overlapWidth = targetCell.getGeometry().getWidth() / 2; + double overlapWidth = sourceWidth - (sourceWidth * Math.sqrt(2) * 0.1); + double overlapHeight = sourceHeight - (sourceHeight * Math.sqrt(2) * 0.1); + +// deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() + overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); + deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth + (sourceWidth * time), targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); + deltaAnimation.startVertexAnimation(); + outputLog(); +// sourceCell.getGeometry().setX(targetCell.getGeometry().getX() + overlapWidth); + sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth + (sourceWidth * time)); + sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); + + targetVertexMethodExec.getArguments().add(sourceVertexObject); + +// } catch (CloneNotSupportedException e) { +// e.printStackTrace(); +// } + } } finally { mxgraph.getModel().endUpdate(); } @@ -1025,8 +1102,13 @@ for (ObjectVertex objectVertex: objectToVertexMap.values()) { mxCell objectVertexCell = ((mxCell) objectVertex.getCell()); if (objectVertexCell != null) { - int time = objectVertexCell.getChildCount(); - if (time == 0) { + int time = 0; + for (int i = 0; i < objectVertexCell.getChildCount(); i++) { + if (!(objectVertexCell.getChildAt(i).getId()).contains("clone")) { + time++; + } + } + if (time == 0) { time = 1; } if(objectVertexCell.getGeometry().getWidth() != VERTEX_OBJECT_SIZE.getWidth() * time) { @@ -1238,12 +1320,12 @@ * @param calledMethodExec */ private void removeCalledMethodExecutionVertex(ObjectVertex sourceVertexObject, MethodExecution methodExec, MethodExecution calledMethodExec) { + outputLog(); // Remove sourceVertex from Locals and Arguments Vertex of CalledMethodExecution's Vertex. if (methodExecToVertexMap.containsKey(calledMethodExec)) { mxICell sourceVertexCell = (mxICell)methodExecToVertexMap.get(methodExec).getCell(); mxCell targetVertexCell = (mxCell)methodExecToVertexMap.get(calledMethodExec).getCell(); - Point absolutPointSourceVertexCell = getAbsolutePointforCell(sourceVertexCell); if(!calledMethodExec.isStatic()) { // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. @@ -1257,12 +1339,20 @@ if (vo != sourceVertexObject) { mxICell cell = (mxICell)vo.getCell(); Point absolutePointCell = getAbsolutePointforCell(cell); - cell.getParent().remove(cell); - cell.setParent(mxDefaultParent); - cell.getGeometry().setX(absolutePointCell.getX()); - cell.getGeometry().setY(absolutePointCell.getY()); - deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); - deltaAnimation.startVertexAnimation(); + System.out.println(cell); + System.out.println(vo.getInitialX() + ", " + vo.getInitialY()); + System.out.println(cell.getGeometry().getX() + ", " + cell.getGeometry().getY()); + System.out.println(absolutePointCell); + if (cell.getParent() != mxDefaultParent) { + cell.getParent().remove(cell); + cell.setParent(mxDefaultParent); + } + if (!absolutePointCell.equals(vo.getInitialPoint())) { + cell.getGeometry().setX(absolutePointCell.getX()); + cell.getGeometry().setY(absolutePointCell.getY()); + deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); + deltaAnimation.startVertexAnimation(); + } methodExecToVertexMap.get(calledMethodExec).getArguments().remove(vo); } } @@ -1272,12 +1362,20 @@ if (vo != sourceVertexObject) { mxICell cell = (mxICell)vo.getCell(); Point absolutePointCell = getAbsolutePointforCell(cell); - cell.getParent().remove(cell); - cell.setParent(mxDefaultParent); - cell.getGeometry().setX(absolutePointCell.getX()); - cell.getGeometry().setY(absolutePointCell.getY()); - deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); - deltaAnimation.startVertexAnimation(); + System.out.println(cell); + System.out.println(vo.getInitialX() + ", " + vo.getInitialY()); + System.out.println(cell.getGeometry().getX() + ", " + cell.getGeometry().getY()); + System.out.println(absolutePointCell); + if (cell.getParent() != mxDefaultParent) { + cell.getParent().remove(cell); + cell.setParent(mxDefaultParent); + } + if (!absolutePointCell.equals(vo.getInitialPoint())) { + cell.getGeometry().setX(absolutePointCell.getX()); + cell.getGeometry().setY(absolutePointCell.getY()); + deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); + deltaAnimation.startVertexAnimation(); + } methodExecToVertexMap.get(calledMethodExec).getLocals().remove(vo); } } @@ -1286,6 +1384,7 @@ mxgraph.removeCells(mxgraph.getEdgesBetween(sourceVertexCell, targetVertexCell)); try { mxICell cloneTargetVertexCell = (mxICell) mxgraph.addCell(targetVertexCell.clone()); + Point absolutPointSourceVertexCell = getAbsolutePointforCell(sourceVertexCell); Point absolutPointTargetVertexCell = getAbsolutePointforCell(targetVertexCell); cloneTargetVertexCell.getGeometry().setX(absolutPointTargetVertexCell.getX()); cloneTargetVertexCell.getGeometry().setY(absolutPointTargetVertexCell.getY()); @@ -1322,6 +1421,7 @@ methodExecToVertexMap.remove(calledMethodExec); } } + outputLog(); } @@ -1555,10 +1655,10 @@ System.out.println(" " + ((mxICell)e.getCell()).getParent().getId()); } } - + private class CurvedCanvas extends mxInteractiveCanvas { mxIShape shape = new CurvedConnector(); - + public CurvedCanvas(mxGraphComponent mxGraphComponent) { super(mxGraphComponent); } @@ -1582,7 +1682,7 @@ return shape; } } - + private class CurvedConnector extends mxConnectorShape { public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { if (state.getAbsolutePointCount() > 1 @@ -1626,12 +1726,24 @@ double ey = state.getAbsolutePoint(3).getY(); Path2D.Double p = new Path2D.Double(); p.moveTo((int) sx, (int) sy); - p.curveTo((int) tx1, (int) sy, (int) tx2, (int) ty2, (int) ex, (int) ey); + p.quadTo((int) tx2, (int) ty2, (int) ex, (int) ey); +// p.curveTo((int) tx1, (int) ty1, (int) tx2, (int) ty2, (int) ex, (int) ey); + canvas.getGraphics().draw(p); + } else if (state.getAbsolutePointCount() == 3) { + double sx = state.getAbsolutePoint(0).getX(); + double sy = state.getAbsolutePoint(0).getY(); + double tx = state.getAbsolutePoint(1).getX(); + double ty = state.getAbsolutePoint(1).getY(); + double ex = state.getAbsolutePoint(2).getX(); + double ey = state.getAbsolutePoint(2).getY(); + Path2D.Double p = new Path2D.Double(); + p.moveTo((int) sx, (int) sy); + p.quadTo((int) tx, (int) ty, (int) ex, (int) ey); canvas.getGraphics().draw(p); } } } - + private void translatePoint(List points, int index, mxPoint offset) { if (offset != null) { mxPoint pt = (mxPoint) points.get(index).clone(); diff --git a/src/org/ntlab/deltaViewer/DeltaViewerSample.java b/src/org/ntlab/deltaViewer/DeltaViewerSample.java index 3d682eb..d4a203d 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewerSample.java +++ b/src/org/ntlab/deltaViewer/DeltaViewerSample.java @@ -28,6 +28,11 @@ * @author Nitta Lab. */ public class DeltaViewerSample { + // Delta Extract Type + protected static final String CONTAINER_COMPONENT = "Container-Component"; + protected static final String CONTAINER_COMPONENT_COLLECTION = "Container-Component(Collection)"; + protected static final String THIS_ANOTHER = "This-Another"; + /** * @param args @@ -115,22 +120,25 @@ Map argsMap = new HashMap<>(); setArgmentsForDeltaExtract(argsMap); //���o�������f���^�̈������i�[����Map��key - String argsKey = "ArgoUMLSelect"; -// String argsKey = "ArgoUMLDelete1"; +// String argsKey = "ArgoUMLSelect"; +// String argsKey = "ArgoUMLDelete2"; // String argsKey = "JHotDrawTransform"; -// String argsKey = "JHotDrawSelect1"; +// String argsKey = "JHotDrawSelect3"; // String argsKey = "sampleArray"; // String argsKey = "sampleCollection"; // String argsKey = "sampleCreate"; // String argsKey = "sampleStatic"; // String argsKey = "delta_eg1"; -// String argsKey = "pre_Exp3"; + String argsKey = "pre_Exp3"; // String argsKey = "worstCase"; // String argsKey = "sample1"; long time = System.nanoTime(); TraceJSON trace = new TraceJSON(argsMap.get(argsKey)[4]); DeltaExtractorJSON s = new DeltaExtractorJSON(trace); - if (argsMap.get(argsKey)[5] == null) { + System.out.println(CONTAINER_COMPONENT); + System.out.println(argsMap.get(argsKey)[5]); + System.out.println(CONTAINER_COMPONENT == argsMap.get(argsKey)[5]); + if (argsMap.get(argsKey)[5] == CONTAINER_COMPONENT || argsMap.get(argsKey)[5] == CONTAINER_COMPONENT_COLLECTION) { HashMap threads = trace.getAllThreads(); List eList = new ArrayList<>(); @@ -147,7 +155,9 @@ for (ThreadInstance thread: threads.values()) { TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); Reference reference = new Reference(argsMap.get(argsKey)[0], argsMap.get(argsKey)[1], argsMap.get(argsKey)[2], argsMap.get(argsKey)[3]); - reference.setCollection(true); + if (argsMap.get(argsKey)[5] == CONTAINER_COMPONENT_COLLECTION) { + reference.setCollection(true); + } // reference.setArray(true); // reference.setFinalLocal(true); // reference.setCreation(true); @@ -208,44 +218,44 @@ String[] testTrace3 = {null, null, "","", "traces/testTrace3.txt"}; map.put("testTrace3", testTrace3); // �\�������̂Ƃ��ɗp����Toy program - String[] pre_Exp1 = {null, null, "E","C", "traces/pre_Exp1.txt", null}; map.put("pre_Exp1", pre_Exp1); - String[] pre_Exp2 = {null, null, "E","C", "traces/pre_Exp2.txt", null}; map.put("pre_Exp2", pre_Exp2); - String[] pre_Exp3 = {null, null, "E","C", "traces/pre_Exp3.txt", null}; map.put("pre_Exp3", pre_Exp3); - String[] pre_Exp4 = {null, null, "E","C", "traces/pre_Exp4.txt", null}; map.put("pre_Exp4", pre_Exp4); - String[] pre_Exp5 = {null, null, "E","C", "traces/pre_Exp5.txt", null}; map.put("pre_Exp5", pre_Exp5); - String[] pre_Exp6 = {null, null, "E","C", "traces/pre_Exp6.txt", null}; map.put("pre_Exp6", pre_Exp6); - String[] pre_Exp7 = {null, null, "E","C", "traces/pre_Exp7.txt", null}; map.put("pre_Exp7", pre_Exp7); + String[] pre_Exp1 = {null, null, "E","C", "traces/pre_Exp1.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp1", pre_Exp1); + String[] pre_Exp2 = {null, null, "E","C", "traces/pre_Exp2.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp2", pre_Exp2); + String[] pre_Exp3 = {null, null, "E","C", "traces/pre_Exp3.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp3", pre_Exp3); + String[] pre_Exp4 = {null, null, "E","C", "traces/pre_Exp4.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp4", pre_Exp4); + String[] pre_Exp5 = {null, null, "E","C", "traces/pre_Exp5.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp5", pre_Exp5); + String[] pre_Exp6 = {null, null, "E","C", "traces/pre_Exp6.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp6", pre_Exp6); + String[] pre_Exp7 = {null, null, "E","C", "traces/pre_Exp7.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp7", pre_Exp7); - String[] test = {null, null, "org.argouml.uml.diagram.static_structure.ui.FigClass","org.tigris.gef.base.LayerPerspectiveMutable", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("test", test); - String[] testVectorAddElement = {null, null, "java.util.Vector", "org.tigris.gef.base.LayerPerspective", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("testVectorAddElement", testVectorAddElement);//trace.java��"addElement("�ɑΉ�����悤�ɒlj� - String[] ArgoUMLBenchmark = {"", "", "", "", "traces/ArgoUMLBenchmark.trace", null}; map.put("ArgoUMLBenchmark", ArgoUMLBenchmark); - String[] ArgoUMLBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLBenchmarkWithMoreStandardClasses", ArgoUMLBenchmarkWithMoreStandardClasses); -// String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass","traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); - String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", null, null,"traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); - /*Vector.addElemnt()�ɑΉ��ς�*/String[] ArgoUMLDelete0_2 = {"1784213708", "1337038091", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLDelete0_2", ArgoUMLDelete0_2); - /*�X�ɉߋ�mouse.Pressed(), mouseReleased()*/String[] ArgoUMLPlace1_1 = {null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLPlace1_1", ArgoUMLPlace1_1); -// String[] ArgoUMLSelect1_2 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); -// String[] ArgoUMLSelect1_2 = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); - String[] jEditBenchmark = {"", "", "", "", "traces/jEditBenchmark.trace", null}; map.put("jEditBenchmark", jEditBenchmark); - String[] jEditSelect2_1 = {"932187140", "1572482885", "java.util.ArrayList", "org.gjt.sp.jedit.textarea.Selection$Range", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", null}; map.put("jEditSelect2_1", jEditSelect2_1); - String[] jHotDrawBenchmark = {"", "", "", "", "traces/jHotDrawBenchmark.trace", null}; map.put("jHotDrawBenchmark", jHotDrawBenchmark); - String[] jHotDrawBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawBenchmarkWithMoreStandardClasses", jHotDrawBenchmarkWithMoreStandardClasses); - /*List.toArray()�ɑΉ�������K�v������H*/String[] jEditDelete2_2 = {null, null, "org.gjt.sp.jedit.buffer.ContentManager", "java.util.ArrayList", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", null}; map.put("jEditDelete2_2", jEditDelete2_2); - String[] jHotDrawSelect3_1 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawSelect3_1", jHotDrawSelect3_1); - String[] jHotDrawMove3_2 = {"778703711", "212532447", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawMove3_2", jHotDrawMove3_2); - /*�s��*/String[] jHotDrawMove3_2_1 = {null, null, "java.util.ArrayList", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawMove3_2_1", jHotDrawMove3_2_1); - String[] jHotDrawPlace4_1 = {"1284329882", "212532447", "java.util.HashMap", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawPlace4_1", jHotDrawPlace4_1); -// String[] jHotDrawSelect4_2 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); - String[] jHotDrawSelect4_2 = {null, null, "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); + String[] test = {null, null, "org.argouml.uml.diagram.static_structure.ui.FigClass","org.tigris.gef.base.LayerPerspectiveMutable", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("test", test); + String[] testVectorAddElement = {null, null, "java.util.Vector", "org.tigris.gef.base.LayerPerspective", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("testVectorAddElement", testVectorAddElement);//trace.java��"addElement("�ɑΉ�����悤�ɒlj� + String[] ArgoUMLBenchmark = {"", "", "", "", "traces/ArgoUMLBenchmark.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLBenchmark", ArgoUMLBenchmark); + String[] ArgoUMLBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLBenchmarkWithMoreStandardClasses", ArgoUMLBenchmarkWithMoreStandardClasses); +// String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass","traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); + String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", null, null,"traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); + /*Vector.addElemnt()�ɑΉ��ς�*/String[] ArgoUMLDelete0_2 = {"1784213708", "1337038091", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLDelete0_2", ArgoUMLDelete0_2); + /*�X�ɉߋ�mouse.Pressed(), mouseReleased()*/String[] ArgoUMLPlace1_1 = {null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLPlace1_1", ArgoUMLPlace1_1); +// String[] ArgoUMLSelect1_2 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); +// String[] ArgoUMLSelect1_2 = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); + String[] jEditBenchmark = {"", "", "", "", "traces/jEditBenchmark.trace", CONTAINER_COMPONENT}; map.put("jEditBenchmark", jEditBenchmark); + String[] jEditSelect2_1 = {"932187140", "1572482885", "java.util.ArrayList", "org.gjt.sp.jedit.textarea.Selection$Range", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jEditSelect2_1", jEditSelect2_1); + String[] jHotDrawBenchmark = {"", "", "", "", "traces/jHotDrawBenchmark.trace", CONTAINER_COMPONENT}; map.put("jHotDrawBenchmark", jHotDrawBenchmark); + String[] jHotDrawBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawBenchmarkWithMoreStandardClasses", jHotDrawBenchmarkWithMoreStandardClasses); + /*List.toArray()�ɑΉ�������K�v������H*/String[] jEditDelete2_2 = {null, null, "org.gjt.sp.jedit.buffer.ContentManager", "java.util.ArrayList", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jEditDelete2_2", jEditDelete2_2); + String[] jHotDrawSelect3_1 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawSelect3_1", jHotDrawSelect3_1); + String[] jHotDrawMove3_2 = {"778703711", "212532447", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawMove3_2", jHotDrawMove3_2); + /*�s��*/String[] jHotDrawMove3_2_1 = {null, null, "java.util.ArrayList", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawMove3_2_1", jHotDrawMove3_2_1); + String[] jHotDrawPlace4_1 = {"1284329882", "212532447", "java.util.HashMap", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawPlace4_1", jHotDrawPlace4_1); +// String[] jHotDrawSelect4_2 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); + String[] jHotDrawSelect4_2 = {null, null, "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); // MagnetRON Experiment - String[] ArgoUMLSelect = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLSelect", ArgoUMLSelect); // ArgoUML �I���@�\ (collection) - String[] ArgoUMLDelete1 = {null, null, "public void org.argouml.uml.diagram.ui.ActionRemoveFromDiagram.actionPerformed(", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", "this to another"}; map.put("ArgoUMLDelete1", ArgoUMLDelete1);// ArgoUML �폜�@�\1 (this to another) - String[] ArgoUMLDelete2 = {"450474599", "1675174935", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", null}; map.put("ArgoUMLDelete2", ArgoUMLDelete2); // ArgoUML �폜�@�\2 (collection) - String[] JHotDrawTransform = {"176893671", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("JHotDrawTransform", JHotDrawTransform); // JHotDraw �ړ��@�\ (collection) - String[] JHotDrawSelect1 = {"758826749", "1952912699", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("JHotDrawSelect1", JHotDrawSelect1); // JHotDraw �I���@�\1 - String[] JHotDrawSelect2 = {"1378082106", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("JHotDrawSelect2", JHotDrawSelect2); // JHotDraw �I���@�\2 (collection) - String[] JHotDrawSelect3 = {"1787265837", "1952912699", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", null}; map.put("JHotDrawSelect3", JHotDrawSelect3); // JHotDraw �I���@�\3 (collection) + String[] ArgoUMLSelect = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("ArgoUMLSelect", ArgoUMLSelect); // ArgoUML �I���@�\ (collection) + String[] ArgoUMLDelete1 = {null, null, "public void org.argouml.uml.diagram.ui.ActionRemoveFromDiagram.actionPerformed(", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", THIS_ANOTHER}; map.put("ArgoUMLDelete1", ArgoUMLDelete1);// ArgoUML �폜�@�\1 (this to another) + String[] ArgoUMLDelete2 = {"450474599", "1675174935", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("ArgoUMLDelete2", ArgoUMLDelete2); // ArgoUML �폜�@�\2 (collection) + String[] JHotDrawTransform = {"176893671", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawTransform", JHotDrawTransform); // JHotDraw �ړ��@�\ (collection) + String[] JHotDrawSelect1 = {"758826749", "1952912699", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("JHotDrawSelect1", JHotDrawSelect1); // JHotDraw �I���@�\1 + String[] JHotDrawSelect2 = {"1378082106", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawSelect2", JHotDrawSelect2); // JHotDraw �I���@�\2 (collection) + String[] JHotDrawSelect3 = {"1787265837", "1952912699", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawSelect3", JHotDrawSelect3); // JHotDraw �I���@�\3 (collection) } private static void traverseMethodExecution(MethodExecution m) { diff --git a/src/org/ntlab/deltaViewer/Vertex.java b/src/org/ntlab/deltaViewer/Vertex.java index 268d95f..8a86db1 100644 --- a/src/org/ntlab/deltaViewer/Vertex.java +++ b/src/org/ntlab/deltaViewer/Vertex.java @@ -1,5 +1,7 @@ package org.ntlab.deltaViewer; +import java.awt.Point; + import com.mxgraph.model.mxICell; /** @@ -94,6 +96,11 @@ ((mxICell)cell).getGeometry().setHeight(height); } + + public Point getInitialPoint() { + return new Point((int)initialX, (int)initialY); + } + public double getInitialX() { return initialX; }