diff --git a/src/org/ntlab/deltaViewer/DeltaViewer.java b/src/org/ntlab/deltaViewer/DeltaViewer.java index f7afadb..82a1c21 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewer.java +++ b/src/org/ntlab/deltaViewer/DeltaViewer.java @@ -64,7 +64,7 @@ //BUG: methodExecution drawing order. -> parent //BUG: ObjectVertex position when Resize ObjectVertex. O public class DeltaViewer { - private static Dimension DEFAULT_SIZE = new Dimension(700, 700); + private static Dimension DEFAULT_SIZE = new Dimension(1300, 700); private static String WINDOW_TITLE = "Delta Viewer"; private ExtractedStructure eStructure; @@ -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 + 75, 100); + private mxPoint coordinatorPoint = new mxPoint(0, 100); private DeltaAnimation deltaAnimation; @@ -378,7 +378,7 @@ break; case CONSTRACTOR_INVOCATION: createObjectVertexOnConstractor(alias); - createMethodExecutionVertex(alias, ((MethodInvocation)alias.getOccurrencePoint().getStatement()).getCallerSideMethodName(), ((MethodInvocation)alias.getOccurrencePoint().getStatement()).getCalledMethodExecution()); + createMethodExecutionVertex(alias.getObjectId(), ((MethodInvocation)alias.getOccurrencePoint().getStatement()).getCallerSideMethodName(), ((MethodInvocation)alias.getOccurrencePoint().getStatement()).getCalledMethodExecution()); update(); removeMethodExecutionVertex(alias); update(); @@ -401,7 +401,13 @@ // Make VertexMethodExecution of called method execution. MethodExecution calledMethodExec = ((MethodInvocation) alias.getOccurrencePoint().getStatement()).getCalledMethodExecution(); if (!methodExecToVertexMap.containsKey(calledMethodExec)) { - createMethodExecutionVertex(alias, calledMethodExec.getSignature(), calledMethodExec); + if (curFrame == 0) { + MethodExecution methodExec = alias.getMethodExecution(); + if (methodExec.getSignature() != calledMethodExec.getSignature() && objectToVertexMap.containsKey(methodExec.getThisObjId())) { + createMethodExecutionVertex(methodExec.getThisObjId(), methodExec.getSignature(), methodExec); + } + } + createMethodExecutionVertex(alias.getObjectId(), calledMethodExec.getSignature(), calledMethodExec); update(); } break; @@ -423,7 +429,9 @@ curFrame = numFrame; Alias alias = deltaAliasCollector.getAliasList().get(numFrame - 1); // Make ObjectEdge and reset position of vertexObject, remove vertexMethodExecution. - for(Statement statement: alias.getMethodExecution().getStatements()) { + for(Statement statement: alias.getMethodExecution().getStatements()) + { +// Statement statement = alias.getOccurrencePoint().getStatement(); if(statement instanceof FieldUpdate) { // Format fieldName. FieldUpdate fieldUpdateStatement = (FieldUpdate) statement; @@ -450,9 +458,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(); +// ObjectVertex targetParentObjVertex = objectToVertexMap.get(calledMethodExec.getThisObjId()); +// deltaAnimation.setVertexAnimation((mxCell)targetParentObjVertex.getCell(), new mxPoint(targetParentObjVertex.getInitialX(), targetParentObjVertex.getInitialY())); +// deltaAnimation.startVertexAnimation(); } if(statement instanceof MethodInvocation) { @@ -586,26 +594,36 @@ } /** Create ObjectVertices. */ - private void createObjectVertices(ExtractedStructure eStructure) { - while(coordinatorPoint.getX() - (150 * (eStructure.getDelta().getDstSide().size())) < 0) { - coordinatorPoint.setX(coordinatorPoint.getX() + 150); - } + private void createObjectVertices(ExtractedStructure eStructure) { + Delta delta = eStructure.getDelta(); + double time = 150; + double padding = 200; + coordinatorPoint.setX(coordinatorPoint.getX() + (time * delta.getDstSide().size()) + padding); // ����(0, 0) double xCor = coordinatorPoint.getX(); double yCor = coordinatorPoint.getY(); - double time = 150; //Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { // Draw vertex object. // srcSide - Delta delta = eStructure.getDelta(); int srcSideSize = delta.getSrcSide().size(); + MethodExecution coordinator = eStructure.getCoordinator(); + String coordinatorObjId = coordinator.getThisObjId(); + String coordinatorClassName = coordinator.getThisClassName(); for (int i = srcSideSize - 1; i >= 0; i--) { Reference ref = delta.getSrcSide().get(i); - System.out.println("srcSide: " + ref.getSrcClassName() + ", " + ref.isCreation()); + if (i == srcSideSize - 1 && !coordinatorObjId.equals(ref.getSrcObjectId()) && !coordinatorClassName.equals(ref.getSrcClassName())) { + System.out.println("coordinator: " + coordinatorClassName + ", " + coordinatorObjId); + coordinatorPoint.setX(coordinatorPoint.getX() + time * 2); + xCor += time * 2; + Object vertex = mxgraph.insertDeltaVertex(mxDefaultParent, coordinatorObjId, coordinatorClassName, xCor + (time * ((srcSideSize - 1) - i)), yCor + (time * ((srcSideSize - 1) - i)), VERTEX_OBJECT_SIZE.getWidth(), VERTEX_OBJECT_SIZE.getHeight(), "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(coordinatorObjId, new ObjectVertex(coordinatorClassName, vertex, xCor + (time * ((srcSideSize - 1) - i)), yCor + (time * ((srcSideSize - 1) - i)))); + srcSideSize++; + } + System.out.println("srcSide: " + ref.getSrcClassName() + ", " + ref.isCreation() + ", " + ref.getSrcObjectId()); if (!ref.isCreation() && !ref.getSrcObjectId().equals(ref.getDstObjectId())) { if (!objectToVertexMap.containsKey(ref.getSrcObjectId())) { String srcClassName = ref.getSrcClassName(); @@ -634,6 +652,15 @@ int cnt = 0; for (int i = dstSideSize - 1; i >= 0; i--) { Reference ref = delta.getDstSide().get(i); + if (i == dstSideSize - 1 && srcSideSize == 0 && !coordinatorObjId.equals(ref.getSrcObjectId()) && !coordinatorClassName.equals(ref.getSrcClassName())) { + System.out.println("coordinator: " + coordinatorClassName + ", " + coordinatorObjId); + coordinatorPoint.setX(coordinatorPoint.getX() + time * 2); + xCor += time * 2; + System.out.println(coordinatorPoint.getX() + ", " + xCor); + Object vertex = mxgraph.insertDeltaVertex(mxDefaultParent, coordinatorObjId, coordinatorClassName, xCor - (time * (dstSideSize - i + cnt)), yCor + (time * (dstSideSize - i + cnt)), VERTEX_OBJECT_SIZE.getWidth(), VERTEX_OBJECT_SIZE.getHeight(), "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(coordinatorObjId, new ObjectVertex(coordinatorClassName, vertex, xCor - (time * (dstSideSize - i + cnt)), yCor + (time * (dstSideSize - i + cnt)))); + dstSideSize++; + } System.out.println("dstSide: " + ref.getSrcClassName() + ", " + ref.getDstClassName() + ", " + ref.isCreation()); if (!ref.isCreation() && !ref.getSrcObjectId().equals(ref.getDstObjectId())) { if (!objectToVertexMap.containsKey(ref.getSrcObjectId())) { @@ -724,10 +751,16 @@ } private void createObjectRefrence(MethodExecution methodExec) { - String sourceObjectId = methodExec.getThisObjId(); + String srcObjId = methodExec.getThisObjId(); String srcClassName = methodExec.getThisClassName(); - String targetObjectId = methodExec.getArguments().get(0).getId(); - mxICell targetCell = (mxICell)objectToVertexMap.get(targetObjectId).getCell(); + String targetObjId = methodExec.getArguments().get(0).getId(); + mxICell targetCell; +// if (objectToVertexMap.containsKey(targetObjId)) { + targetCell = (mxICell)objectToVertexMap.get(targetObjId).getCell(); +// } else { +// targetObjId = methodExec.getCallerMethodExecution().getArguments().get(0).getId(); +// targetCell = (mxICell)objectToVertexMap.get(targetObjId).getCell(); +// } Point absolutePointTargetCell = getAbsolutePointforCell(targetCell); // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. @@ -737,19 +770,19 @@ targetCell.setParent(mxDefaultParent); targetCell.getGeometry().setX(absolutePointTargetCell.getX()); targetCell.getGeometry().setY(absolutePointTargetCell.getY()); - Object edge = mxgraph.insertDeltaEdge(mxDefaultParent, targetObjectId, null, objectToVertexMap.get(sourceObjectId).getCell(), objectToVertexMap.get(targetObjectId).getCell()); + Object edge = mxgraph.insertDeltaEdge(mxDefaultParent, targetObjId, null, objectToVertexMap.get(srcObjId).getCell(), objectToVertexMap.get(targetObjId).getCell()); ((mxCell)edge).setStyle("exitX=0;exitY=0.5;exitPerimeter=1;entryX=1;entryY=0.5;entryPerimeter=1;"); - edgeMap.put(targetObjectId, new Edge(null, TypeName.Reference, edge)); + edgeMap.put(targetObjId, new Edge(null, TypeName.Reference, edge)); // System.out.println("last" + objectToVertexMap.get(targetObjectId).getInitialX() + ", " + objectToVertexMap.get(targetObjectId).getInitialY()); - deltaAnimation.setVertexAnimation(targetCell, new mxPoint(objectToVertexMap.get(targetObjectId).getInitialX(), objectToVertexMap.get(targetObjectId).getInitialY())); + deltaAnimation.setVertexAnimation(targetCell, new mxPoint(objectToVertexMap.get(targetObjId).getInitialX(), objectToVertexMap.get(targetObjId).getInitialY())); deltaAnimation.startVertexAnimation(); - targetCell.getGeometry().setX(objectToVertexMap.get(targetObjectId).getInitialX()); - targetCell.getGeometry().setY(objectToVertexMap.get(targetObjectId).getInitialY()); + targetCell.getGeometry().setX(objectToVertexMap.get(targetObjId).getInitialX()); + targetCell.getGeometry().setY(objectToVertexMap.get(targetObjId).getInitialY()); } finally { mxgraph.getModel().endUpdate(); } - System.out.println("rTHIS " + srcClassName + ", " + targetObjectId); + System.out.println("rTHIS " + srcClassName + ", " + targetObjId); } /** @@ -761,7 +794,7 @@ // sourceVertex ObjectVertex sourceObjectVertex = objectToVertexMap.get(alias.getObjectId()); if (alias.getMethodExecution().isStatic() && !methodExecToVertexMap.containsKey(alias.getMethodExecution())) { - createMethodExecutionVertex(alias, alias.getMethodExecution().getSignature(), alias.getMethodExecution()); + createMethodExecutionVertex(alias.getObjectId(), alias.getMethodExecution().getSignature(), alias.getMethodExecution()); } // targetVertex MethodExecutionVertex targetMethodExecVertex = methodExecToVertexMap.get(alias.getMethodExecution()); @@ -932,7 +965,7 @@ } else { // �d�l��̃o�O, ���[�v������ outputLog(); // try { - // ObjectVertex(sourceCell)�̃N���[������ + // ObjectVertex(sourceCell)�̃N���[������ // mxICell cloneSourceCell = (mxICell) mxgraph.addCell(sourceCell.clone()); // // cloneSourceCell.setStyle("fillColor=#ffffff;opacity=50;shape=ellipse"); @@ -944,36 +977,36 @@ // cloneSourceCell.getGeometry().setX(0); // cloneSourceCell.getGeometry().setY(0); - // ����ObjectVertex - Point absPtSourceCell = getAbsolutePointforCell(sourceCell); - Point absPtTargetParentCell = getAbsolutePointforCell(targetCell.getParent()); + // ����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); + 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"); + 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 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); + 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(); + 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)); + sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth + (sourceWidth * time)); + sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); - targetVertexMethodExec.getArguments().add(sourceVertexObject); + targetVertexMethodExec.getArguments().add(sourceVertexObject); // } catch (CloneNotSupportedException e) { // e.printStackTrace(); @@ -1171,21 +1204,29 @@ * @param alias */ private void createMethodExecutionVertex(Alias alias) { + String objId = alias.getObjectId(); + MethodExecution methodExec = alias.getMethodExecution(); + String methodExecSignature = methodExec.getSignature(); + if (curFrame == 0) { - createMethodExecutionVertex(alias, alias.getMethodExecution().getSignature(), alias.getMethodExecution()); + MethodExecution callerMethodExec = methodExec.getCallerMethodExecution(); + if (methodExecSignature != callerMethodExec.getSignature() && objectToVertexMap.containsKey(callerMethodExec.getThisObjId())) { + createMethodExecutionVertex(callerMethodExec.getThisObjId(), callerMethodExec.getSignature(), callerMethodExec); + } + createMethodExecutionVertex(objId, methodExecSignature, methodExec); } else if (alias.getObjectId().matches("0")) { - createMethodExecutionVertex(alias, alias.getMethodExecution().getSignature(), alias.getMethodExecution()); + createMethodExecutionVertex(objId, methodExecSignature, methodExec); } } /** * Parent : Create MethodExecutionVertex. * - * @param alias + * @param objId * @param methodSignature Called or this MethodSignature. * @param methodExec Called or this MethodExecution. */ - private void createMethodExecutionVertex(Alias alias, String methodSignature, MethodExecution methodExec) { + private void createMethodExecutionVertex(String objId, String methodSignature, MethodExecution methodExec) { if (methodSignature.contains(" ")) { System.out.println(methodSignature); @@ -1195,37 +1236,40 @@ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { - String objectId = alias.getObjectId(); - if (methodExec.isStatic() && !objectId.equals("0")) { - objectId = alias.getMethodExecution().getCallerMethodExecution().getThisObjId(); - } - Object object = objectToVertexMap.get(objectId).getCell(); - double xCor = VERTEX_OBJECT_SIZE.getWidth() * 0.1; - double yCor = VERTEX_OBJECT_SIZE.getHeight() * 0.5; - double standardX = xCor; - double standardY = 0; - int time = objectToVertexMap.get(objectId).getVertexMethodExecutions().size(); - System.out.println(time); - if (time >= 1) { - mxICell standardCell = (mxICell) objectToVertexMap.get(objectId).getVertexMethodExecutions().get(0).getCell(); - standardX = standardCell.getGeometry().getX(); - standardY = standardCell.getGeometry().getY(); - time-=1; + if (methodExec.isStatic() && !objId.equals("0")) { + objId = methodExec.getCallerMethodExecution().getThisObjId(); } - Object vertex = mxgraph.insertDeltaVertex(object, methodSignature, methodSignature, "fillColor=white"); //creates a white vertex. - System.out.println("makeVertexMethodExecution: " + ((mxICell)vertex).getId() + " in " + objectId + " (" + standardX + ", " + yCor * (time + 1) + standardY + ")"); + Object object = objectToVertexMap.get(objId).getCell(); - MethodExecutionVertex vertexMethodExecution = new MethodExecutionVertex(methodSignature, vertex, standardX , yCor * (time + 1) + standardY, VERTEX_METHOD_EXECUTION_SIZE.getWidth(), VERTEX_METHOD_EXECUTION_SIZE.getHeight()); - // Object vertex = mxgraph.insertVertex(object, methodSignature, methodSignature, 0, 0, 0, 0, "fillColor=white", true); //creates a white vertex. - // Object vertex = mxgraph.insertDeltaVertex(mxDefaultParent, methodSignature, methodSignature, "fillColor=white"); //creates a white vertex. - // VertexMethodExecution vertexMethodExecution = new VertexMethodExecution(methodSignature, vertex, getXForCell(objectId) + (xCor * (time + 1)), getYForCell(objectId) + (yCor * (time + 1)), VERTEX_METHOD_EXECUTION_SIZE.getWidth(), VERTEX_METHOD_EXECUTION_SIZE.getHeight()); - methodExecToVertexMap.put(methodExec, vertexMethodExecution); - if(methodExecToVertexMap.size() > 1) { - ((mxICell)vertex).setVisible(false); - createEdgeToMethodExecution(); - } - objectToVertexMap.get(objectId).addMethodExecution(vertexMethodExecution); +// if (object != null) { + double xCor = VERTEX_OBJECT_SIZE.getWidth() * 0.1; + double yCor = VERTEX_OBJECT_SIZE.getHeight() * 0.5; + double standardX = xCor; + double standardY = 0; + int time = objectToVertexMap.get(objId).getVertexMethodExecutions().size(); + System.out.println(time); + if (time >= 1) { + mxICell standardCell = (mxICell) objectToVertexMap.get(objId).getVertexMethodExecutions().get(0).getCell(); + standardX = standardCell.getGeometry().getX(); + standardY = standardCell.getGeometry().getY(); + time-=1; + } + + Object vertex = mxgraph.insertDeltaVertex(object, methodSignature, methodSignature, "fillColor=white"); //creates a white vertex. + System.out.println("makeVertexMethodExecution: " + ((mxICell)vertex).getId() + " in " + objId + " (" + standardX + ", " + yCor * (time + 1) + standardY + ")"); + + MethodExecutionVertex vertexMethodExecution = new MethodExecutionVertex(methodSignature, vertex, standardX , yCor * (time + 1) + standardY, VERTEX_METHOD_EXECUTION_SIZE.getWidth(), VERTEX_METHOD_EXECUTION_SIZE.getHeight()); + // Object vertex = mxgraph.insertVertex(object, methodSignature, methodSignature, 0, 0, 0, 0, "fillColor=white", true); //creates a white vertex. + // Object vertex = mxgraph.insertDeltaVertex(mxDefaultParent, methodSignature, methodSignature, "fillColor=white"); //creates a white vertex. + // VertexMethodExecution vertexMethodExecution = new VertexMethodExecution(methodSignature, vertex, getXForCell(objectId) + (xCor * (time + 1)), getYForCell(objectId) + (yCor * (time + 1)), VERTEX_METHOD_EXECUTION_SIZE.getWidth(), VERTEX_METHOD_EXECUTION_SIZE.getHeight()); + methodExecToVertexMap.put(methodExec, vertexMethodExecution); + if(methodExecToVertexMap.size() > 1) { + ((mxICell)vertex).setVisible(false); + createEdgeToMethodExecution(); + } + objectToVertexMap.get(objId).addMethodExecution(vertexMethodExecution); +// } } finally { mxgraph.getModel().endUpdate(); } @@ -1502,15 +1546,20 @@ String dstObjId = aliasPair.getAliasPair().getValue().getObjectId(); boolean isSrcSideChanged = aliasPair.getIsSrcSideChanged(); // String dstClassName = curAlias.getMethodExecution().getThisClassName(); - System.out.println("makeEdgeObject: " + fieldName + ", " + srcClassName + " (" + objectToVertexMap.get(srcObjId).getCell().hashCode() + "), " + " (" + objectToVertexMap.get(dstObjId).getCell().hashCode() + ")"/* + ", " + dstClassName*/); - // BUG:NullPointerException - Object edge = mxgraph.insertDeltaEdge(mxDefaultParent, fieldName, fieldName, objectToVertexMap.get(srcObjId).getCell(), objectToVertexMap.get(dstObjId).getCell()); - if(isSrcSideChanged) { - ((mxCell)edge).setStyle("exitX=1;exitY=1;exitPerimeter=1;entryX=0;entryY=0;entryPerimeter=1;"); - } else { - ((mxCell)edge).setStyle("exitX=0;exitY=1;exitPerimeter=1;entryX=1;entryY=0;entryPerimeter=1;"); + System.out.println(aliasPair.getAliasPair().getKey().getMethodExecution().isConstructor()); + Object srcCell = objectToVertexMap.get(srcObjId).getCell(); + Object dstCell = objectToVertexMap.get(dstObjId).getCell(); + if (srcCell != null && dstCell != null) { // isCreation() + System.out.println("makeEdgeObject: " + fieldName + ", " + srcClassName + " (" + srcCell.hashCode() + "), " + " (" + dstCell.hashCode() + ")"/* + ", " + dstClassName*/); + // BUG:NullPointerException + Object edge = mxgraph.insertDeltaEdge(mxDefaultParent, fieldName, fieldName, srcCell, dstCell); + if(isSrcSideChanged) { + ((mxCell)edge).setStyle("exitX=1;exitY=1;exitPerimeter=1;entryX=0;entryY=0;entryPerimeter=1;"); + } else { + ((mxCell)edge).setStyle("exitX=0;exitY=1;exitPerimeter=1;entryX=1;entryY=0;entryPerimeter=1;"); + } + edgeMap.put(srcClassName + "." + fieldName, new Edge(fieldName, TypeName.Reference, edge)); } - edgeMap.put(srcClassName + "." + fieldName, new Edge(fieldName, TypeName.Reference, edge)); } finally { mxgraph.getModel().endUpdate(); }