diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index d23bfc6..5080d9f 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -1,5 +1,6 @@ package org.ntlab.deltaViewer; +import java.awt.Dimension; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collections; @@ -22,6 +23,7 @@ import org.ntlab.trace.TracePoint; import com.mxgraph.model.mxICell; +import com.mxgraph.util.mxRectangle; import com.mxgraph.view.mxGraphView; public class CollaborationViewer extends MagnetRONViewer { @@ -33,7 +35,8 @@ private IObjectCallGraph objectCallGraph; - private double scale = 1.0; + private Dimension graphMaxSize; + private double viwerScale = 1.0; public CollaborationViewer() { super(); @@ -60,13 +63,26 @@ // reflectCoordinates(mxgraph); // objectVertex��mxGraph�̍��W�𔽉f������(���[�U���w�肵�����W�ʒu�𔽉f) // Fit graph size in visible JFrame. - mxGraphView view = mxgraphComponent.getGraph().getView(); - int componentWidth = mxgraphComponent.getWidth() - 25; - double viewWidth = (double) view.getGraphBounds().getWidth(); -// scale = (double)componentWidth/viewWidth; - view.setScale(scale); + mxGraphView mxGraphView = getGraphComponent().getGraph().getView(); +// int componentWidth = getGraphComponent().getWidth() - 25; +// double viewWidth = (double) mxGraphView.getGraphBounds().getWidth(); +// scale = (double) componentWidth/viewWidth; + mxGraphView.setScale(viwerScale); update(); + + graphMaxSize = new Dimension(); + for (ObjectVertex objVx: objectToVertexMap.values()) { + double objVxInitMaxX = objVx.getInitialX() + DEFAULT_OBJECT_VERTEX_SIZE.getWidth(); + double objVxInitMaxY = objVx.getInitialY() + DEFAULT_OBJECT_VERTEX_SIZE.getHeight(); + if (objVxInitMaxX > graphMaxSize.getWidth()) { + graphMaxSize.setSize(objVxInitMaxX, graphMaxSize.getHeight()); + } + if (objVxInitMaxY > graphMaxSize.getHeight()) { + graphMaxSize.setSize(graphMaxSize.getWidth(), objVxInitMaxY); + } + } + mxgraph.setMinimumGraphSize(new mxRectangle(0, 0, graphMaxSize.getWidth(), graphMaxSize.getHeight())); } /** @@ -124,7 +140,7 @@ private void doLastAnimation(int numFrame, TracePoint relatedPoint) { // TODO: Implement doLastAnimation() to support multiple delta. - curFrame = numFrame; + setCurrentFrame(numFrame); List aliasList = aliasCollector.getAliasList(); Alias prevAlias = aliasList.get(numFrame - 1); Alias nextAlias = (numFrame < aliasList.size()) ? aliasList.get(numFrame) : null; @@ -140,17 +156,21 @@ String srcClassName = calledMethodExec.getThisClassName(); String srcObjId = calledMethodExec.getThisObjId(); String tgtObjId = prevAlias.getObjectId(); - ObjectVertex tgtObjectVertex = objectToVertexMap.get(tgtObjId); - + ObjectVertex tgtObjVx = objectToVertexMap.get(tgtObjId); + createObjectRefrence(srcClassName, srcObjId, tgtObjId); + if (methodExecToVertexMap.containsKey(prevMethodExec)) { - if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(tgtObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getLocals().remove(tgtObjectVertex); - } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(tgtObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getArguments().remove(tgtObjectVertex); + MethodExecutionVertex prevMethodExecVx = methodExecToVertexMap.get(prevMethodExec); + if (prevMethodExecVx.getLocals().contains(tgtObjVx)) { + prevMethodExecVx.getLocals().remove(tgtObjVx); + } else if (prevMethodExecVx.getArguments().contains(tgtObjVx)) { + prevMethodExecVx.getArguments().remove(tgtObjVx); } } - if (nextAlias == null || (nextAlias != null && !calledMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { + + if (nextAlias == null + || (nextAlias != null && !calledMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { removeCalledMethodExecutionVertex(objectToVertexMap.get(srcObjId), prevMethodExec, calledMethodExec); updateObjectVertices(); } @@ -168,22 +188,24 @@ } else { fieldName = ""; } - String sourceObjectId = fieldUpdateStatement.getContainerObjId(); - + String srcObjId = fieldUpdateStatement.getContainerObjId(); + createObjectRefrence(fieldUpdateStatement, fieldName); - String targetObjectId = fieldUpdateStatement.getValueObjId(); - ObjectVertex targetObjectVertex = objectToVertexMap.get(targetObjectId); + String tgtObjId = fieldUpdateStatement.getValueObjId(); + ObjectVertex tgtObjVx = objectToVertexMap.get(tgtObjId); if (methodExecToVertexMap.containsKey(prevMethodExec)) { - if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(targetObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getLocals().remove(targetObjectVertex); - } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(targetObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getArguments().remove(targetObjectVertex); + MethodExecutionVertex prevMethodExecVx = methodExecToVertexMap.get(prevMethodExec); + if (prevMethodExecVx.getLocals().contains(tgtObjVx)) { + prevMethodExecVx.getLocals().remove(tgtObjVx); + } else if (prevMethodExecVx.getArguments().contains(tgtObjVx)) { + prevMethodExecVx.getArguments().remove(tgtObjVx); } } + if (nextAlias == null || (nextAlias != null && !prevMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { - removeCalledMethodExecutionVertex(objectToVertexMap.get(sourceObjectId), prevMethodExec.getCallerMethodExecution(), prevMethodExec); + removeCalledMethodExecutionVertex(objectToVertexMap.get(srcObjId), prevMethodExec.getCallerMethodExecution(), prevMethodExec); updateObjectVertices(); } } @@ -209,25 +231,28 @@ srcClassName = calledMethodExec.getThisClassName(); srcObjId = calledMethodExec.getThisObjId(); tgtObjId = calledMethodExec.getArguments().get(0).getId(); - ObjectVertex tgtObjectVertex = objectToVertexMap.get(tgtObjId); + ObjectVertex tgtObjVx = objectToVertexMap.get(tgtObjId); if (!methodExecToVertexMap.containsKey(calledMethodExec)) { createMethodExecutionVertex(calledMethodExec.getThisObjId(), methodInvStatement.getCallerSideMethodName(), calledMethodExec); update(); - moveArgumentObjectVertex(calledMethodExec, tgtObjectVertex, methodExecToVertexMap.get(calledMethodExec)); + moveArgumentObjectVertex(calledMethodExec, tgtObjVx, methodExecToVertexMap.get(calledMethodExec)); update(); createObjectRefrence(srcClassName, srcObjId, tgtObjId); removeCalledMethodExecutionVertex(null, prevMethodExec, calledMethodExec); } else { createObjectRefrence(srcClassName, srcObjId, tgtObjId); } + if (methodExecToVertexMap.containsKey(prevMethodExec)) { - if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(tgtObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getLocals().remove(tgtObjectVertex); - } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(tgtObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getArguments().remove(tgtObjectVertex); + MethodExecutionVertex prevMethodExecVx = methodExecToVertexMap.get(prevMethodExec); + if (prevMethodExecVx.getLocals().contains(tgtObjVx)) { + prevMethodExecVx.getLocals().remove(tgtObjVx); + } else if (prevMethodExecVx.getArguments().contains(tgtObjVx)) { + prevMethodExecVx.getArguments().remove(tgtObjVx); } } + List methodExecList = new ArrayList<>(methodExecToVertexMap.keySet()); if (nextAlias == null || (nextAlias != null && !prevMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { if (methodExecList.size() > 1) { @@ -242,16 +267,19 @@ srcClassName = methodInvStatement.getThisClassName(); srcObjId = methodInvStatement.getThisObjId(); tgtObjId = calledMethodExec.getReturnValue().getId(); - ObjectVertex tgtObjectVertex = objectToVertexMap.get(tgtObjId); - + ObjectVertex tgtObjVx = objectToVertexMap.get(tgtObjId); + createObjectRefrence(srcClassName, srcObjId, tgtObjId); + if (methodExecToVertexMap.containsKey(prevMethodExec)) { - if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(tgtObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getLocals().remove(tgtObjectVertex); - } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(tgtObjectVertex)) { - methodExecToVertexMap.get(prevMethodExec).getArguments().remove(tgtObjectVertex); + MethodExecutionVertex prevMethodExecVx = methodExecToVertexMap.get(prevMethodExec); + if (prevMethodExecVx.getLocals().contains(tgtObjVx)) { + prevMethodExecVx.getLocals().remove(tgtObjVx); + } else if (prevMethodExecVx.getArguments().contains(tgtObjVx)) { + prevMethodExecVx.getArguments().remove(tgtObjVx); } } + if (nextAlias == null || (nextAlias != null && !calledMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { removeCalledMethodExecutionVertex(objectToVertexMap.get(srcObjId), prevMethodExec, calledMethodExec); updateObjectVertices(); @@ -265,77 +293,81 @@ List methodExecList = new ArrayList<>(methodExecToVertexMap.keySet()); Collections.reverse(methodExecList); for(int i = 0; i < methodExecList.size(); i++) { - String objectId = methodExecList.get(i).getThisObjId(); - ObjectVertex srcObjectVertex = objectToVertexMap.get(objectId); // sourceVertex + String objId = methodExecList.get(i).getThisObjId(); + ObjectVertex srcObjVx = objectToVertexMap.get(objId); // sourceVertex MethodExecution methodExec = methodExecList.get(i); + if (nextAlias != null && methodExec.getSignature().equals(nextAlias.getMethodSignature())) break; - if (i != methodExecList.size()-1) { + + if (i != methodExecList.size() - 1) { for(Statement st: methodExec.getStatements()) { if(st instanceof MethodInvocation) { MethodExecution calledMethodExec = ((MethodInvocation) st).getCalledMethodExecution(); String calledObjId = calledMethodExec.getThisObjId(); if(objectToVertexMap.containsKey(calledObjId)) { - removeCalledMethodExecutionVertex(srcObjectVertex, methodExec.getCallerMethodExecution(), methodExec); + removeCalledMethodExecutionVertex(srcObjVx, methodExec.getCallerMethodExecution(), methodExec); updateObjectVertices(); break; } } } } else { + scrollCellToVisible((mxICell) srcObjVx.getCell(), true); + List arguments = new ArrayList<>(methodExecToVertexMap.get(methodExec).getArguments()); List locals = new ArrayList<>(methodExecToVertexMap.get(methodExec).getLocals()); if (arguments.size() != 0) { - for (ObjectVertex vo: arguments) { - mxICell cell = (mxICell)vo.getCell(); - Point2D absolutePointCell = getAbsolutePointforCell(cell); + for (ObjectVertex objVx: arguments) { + mxICell objVxCell = (mxICell) objVx.getCell(); + Point2D objVxCellAbsPt = getAbsolutePointforCell(objVxCell); // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); synchronized (mxgraph.getModel()) { try { - if (!cell.getParent().equals(getMxDefaultParent())) { + if (!objVxCell.getParent().equals(getMxDefaultParent())) { // If parent of ObjectVertex cell isn't mxDefaltParent, reset parent. - cell.getParent().remove(cell); - cell.setParent(getMxDefaultParent()); + objVxCell.getParent().remove(objVxCell); + objVxCell.setParent(getMxDefaultParent()); } - cell.getGeometry().setX(absolutePointCell.getX()); - cell.getGeometry().setY(absolutePointCell.getY()); + objVxCell.getGeometry().setX(objVxCellAbsPt.getX()); + objVxCell.getGeometry().setY(objVxCellAbsPt.getY()); } finally { mxgraph.getModel().endUpdate(); } } - MagnetRONAnimation vertexAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - vertexAnim.setTotalCycleCount(10); - vertexAnim.setDelay(100); - vertexAnim.init(cell, vo.getInitialX(), vo.getInitialY(), threadPoolExecutor); - vertexAnim.syncPlay(); - methodExecToVertexMap.get(methodExec).getArguments().remove(vo); + MagnetRONAnimation pbjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); + pbjVxCellAnim.setTotalCycleCount(10); + pbjVxCellAnim.setDelay(100); + pbjVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); + pbjVxCellAnim.syncPlay(); + methodExecToVertexMap.get(methodExec).getArguments().remove(objVx); } - }else if (locals.size() != 0) { - for (ObjectVertex vo: locals) { - mxICell cell = (mxICell)vo.getCell(); - Point2D absolutePointCell = getAbsolutePointforCell(cell); + } else if (locals.size() != 0) { + for (ObjectVertex objVx: locals) { + mxICell objVxCell = (mxICell) objVx.getCell(); + Point2D objVxCellAbsPt = getAbsolutePointforCell(objVxCell); // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); synchronized (mxgraph.getModel()) { try { - if (!cell.getParent().equals(getMxDefaultParent())) { + if (!objVxCell.getParent().equals(getMxDefaultParent())) { // If parent of ObjectVertex cell isn't mxDefaltParent, reset parent. - cell.getParent().remove(cell); - cell.setParent(getMxDefaultParent()); + objVxCell.getParent().remove(objVxCell); + objVxCell.setParent(getMxDefaultParent()); } - cell.getGeometry().setX(absolutePointCell.getX()); - cell.getGeometry().setY(absolutePointCell.getY()); + objVxCell.getGeometry().setX(objVxCellAbsPt.getX()); + objVxCell.getGeometry().setY(objVxCellAbsPt.getY()); } finally { mxgraph.getModel().endUpdate(); } } - MagnetRONAnimation vertexAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - vertexAnim.setTotalCycleCount(10); - vertexAnim.setDelay(100); - vertexAnim.init(cell, vo.getInitialX(), vo.getInitialY(), threadPoolExecutor); - vertexAnim.syncPlay(); - methodExecToVertexMap.get(methodExec).getLocals().remove(vo); + MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); + objVxCellAnim.setTotalCycleCount(10); + objVxCellAnim.setDelay(100); + objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); + objVxCellAnim.syncPlay(); + methodExecToVertexMap.get(methodExec).getLocals().remove(objVx); } } updateObjectVertices(); @@ -356,15 +388,15 @@ try { // Create vertices(mxGraph) and OvjectVerticies. List refList = objectCallGraph.getReferences(); - double objecVertexWidth = DEFAULT_OBJECT_VERTEX_SIZE.getWidth(); - double ObjectVertexHeight = DEFAULT_OBJECT_VERTEX_SIZE.getHeight(); + double objVxWid = DEFAULT_OBJECT_VERTEX_SIZE.getWidth(); + double ObjVxHt = DEFAULT_OBJECT_VERTEX_SIZE.getHeight(); { MethodExecution coordinator = objectCallGraph.getStartPoints().get(0); String coordinatorObjId = coordinator.getThisObjId(); String coordinatorClassName = coordinator.getThisClassName(); - mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), coordinatorObjId, 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, vertex, 0, 0)); + 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. + objectToVertexMap.put(coordinatorObjId, new ObjectVertex(coordinatorClassName, coordinatorObjVxCell, 0, 0)); } for (int i = 0; i < refList.size(); i++) { @@ -378,8 +410,8 @@ if (srcClassName.contains("[L")) { srcClassName = formatArrayName(srcClassName); } - mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(srcObjId, new ObjectVertex(ref.getSrcClassName(), vertex, 0, 0)); + mxICell srcObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(srcObjId, new ObjectVertex(ref.getSrcClassName(), srcObjVxCell, 0, 0)); } // dstSide if (!objectToVertexMap.containsKey(ref.getDstObjectId())) { @@ -389,8 +421,8 @@ if (dstClassName.contains("[L")) { dstClassName = formatArrayName(dstClassName); } - mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), dstObjId, dstClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(dstObjId, new ObjectVertex(ref.getDstClassName(), vertex, 0, 0)); + mxICell dstObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), dstObjId, dstClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(dstObjId, new ObjectVertex(ref.getDstClassName(), dstObjVxCell, 0, 0)); } } else { if (!objectToVertexMap.containsKey(ref.getSrcObjectId())) { @@ -399,8 +431,8 @@ if (srcClassName.contains("[L")) { srcClassName = formatArrayName(srcClassName); } - mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(srcObjId, new ObjectVertex(ref.getSrcClassName(), vertex, 0, 0)); + mxICell srcObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, 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(); if (!objectToVertexMap.containsKey(dstObjId)) { @@ -418,8 +450,8 @@ // When both of the calling and called methods 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)); + mxICell thisObjVxCell = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, 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) { String thisClassName = alias.getMethodExecution().getThisClassName(); @@ -429,7 +461,7 @@ } if (!objectToVertexMap.containsKey(thisObjId)) { // When the called method is static. - mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, thisClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), thisObjId, thisClassName, 0, 0, objVxWid, ObjVxHt, "fillColor=white"); //creates a white vertex. objectToVertexMap.put(thisObjId, new ObjectVertex(thisClassName, vertex, 0, 0)); } } @@ -453,7 +485,10 @@ if (curFrame == 0) { MethodExecution callerMethodExec = methodExec.getCallerMethodExecution(); - if (callerMethodExec != null && methodExecSignature != callerMethodExec.getSignature() && objectToVertexMap.containsKey(callerMethodExec.getThisObjId()) && objectCallGraph.getStartPoints().get(0) == callerMethodExec) { + if (callerMethodExec != null + && methodExecSignature != callerMethodExec.getSignature() + && objectToVertexMap.containsKey(callerMethodExec.getThisObjId()) + && objectCallGraph.getStartPoints().get(0) == callerMethodExec) { createMethodExecutionVertex(callerMethodExec.getThisObjId(), callerMethodExec.getSignature(), callerMethodExec); } createMethodExecutionVertex(objId, methodExecSignature, methodExec); @@ -555,21 +590,18 @@ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { - Object srcCell = objectToVertexMap.get(curAliasObjId).getCell(); - Object dstCell = objectToVertexMap.get(nextAliasObjId).getCell(); - if (srcCell != null && dstCell != null) { // isCreation() + Object srcObjVxCell = objectToVertexMap.get(curAliasObjId).getCell(); + Object dstObjVxCell = objectToVertexMap.get(nextAliasObjId).getCell(); + if (srcObjVxCell != null && dstObjVxCell != null) { // isCreation() System.out.println(TAG + ": Create Edge. srcClassName=" + srcClassName + "(curObjectId=" + curAliasObjId + ") -- fieldName=" + fieldName + " --> " + "(nextObjectId" + nextAliasObjId + ")"); // TODO: Fix bug of NullPointerException. - mxICell edge = null; + mxICell edgeCell = null; if (fieldName.equals(nextAliasObjId)) { // If fieldName is objectId. - edge = (mxICell) mxgraph.insertDeltaEdge(getMxDefaultParent(), "", "", srcCell, dstCell); + edgeCell = (mxICell) mxgraph.insertDeltaEdge(getMxDefaultParent(), "", "", srcObjVxCell, dstObjVxCell); } else { - edge = (mxICell) mxgraph.insertDeltaEdge(getMxDefaultParent(), fieldName, fieldName, srcCell, dstCell); + edgeCell = (mxICell) mxgraph.insertDeltaEdge(getMxDefaultParent(), fieldName, fieldName, srcObjVxCell, dstObjVxCell); } - Point2D absPtSrcCell = getAbsolutePointforCell((mxICell)srcCell); - Point2D absPtDstCell = getAbsolutePointforCell((mxICell)dstCell); - setEdgePoint((mxICell)edge, absPtSrcCell, absPtDstCell); - edgeMap.put(curAliasObjId + "." + fieldName, new Edge(fieldName, TypeName.Reference, edge)); + edgeMap.put(curAliasObjId + "." + fieldName, new Edge(fieldName, TypeName.Reference, edgeCell)); } else { edgeMap.put(curAliasObjId + "." + fieldName, new Edge(fieldName, TypeName.PreReference, curAliasObjId, nextAliasObjId)); }