Author: koen.aers(a)jboss.com
Date: 2010-11-30 11:29:29 -0500 (Tue, 30 Nov 2010)
New Revision: 27029
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnBendpointsImpl.java
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnDiagramImpl.java
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnEdgeImpl.java
Log:
modify edge initialization sequence
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnBendpointsImpl.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnBendpointsImpl.java 2010-11-30
16:14:44 UTC (rev 27028)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnBendpointsImpl.java 2010-11-30
16:29:29 UTC (rev 27029)
@@ -2,12 +2,10 @@
import java.util.List;
-import org.eclipse.bpmn2.di.BPMNEdge;
import org.eclipse.bpmn2.di.BPMNShape;
import org.eclipse.dd.dc.Bounds;
import org.eclipse.dd.dc.DcFactory;
import org.eclipse.dd.dc.Point;
-import org.eclipse.dd.di.DiagramElement;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
import org.eclipse.gmf.runtime.notation.View;
@@ -23,6 +21,10 @@
this.edge = edge;
}
+ public Edge getEdge() {
+ return edge;
+ }
+
@SuppressWarnings("rawtypes")
@Override
public void setPoints(List newPoints) {
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnDiagramImpl.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnDiagramImpl.java 2010-11-30
16:14:44 UTC (rev 27028)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnDiagramImpl.java 2010-11-30
16:29:29 UTC (rev 27029)
@@ -6,10 +6,8 @@
import org.eclipse.bpmn2.Artifact;
import org.eclipse.bpmn2.FlowElement;
-import org.eclipse.bpmn2.FlowNode;
-import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.FlowElementsContainer;
-import org.eclipse.bpmn2.SequenceFlow;
+import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.SubProcess;
import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.di.BPMNEdge;
@@ -87,18 +85,18 @@
BpmnEdgeImpl edge = (BpmnEdgeImpl)view;
View parentView = viewMap.get(parent);
if (parentView != null && parentView instanceof Diagram) {
- edge.initialize((Diagram)parentView);
+ edge.initialize((Diagram)parentView, viewMap);
}
- EObject bpmnElement = edge.getElement();
- if (bpmnElement instanceof SequenceFlow) {
- SequenceFlow sequenceFlow = (SequenceFlow)bpmnElement;
- FlowNode source = sequenceFlow.getSourceRef();
- FlowNode target = sequenceFlow.getTargetRef();
- View sourceView = viewMap.get(source);
- View targetView = viewMap.get(target);
- edge.setSource(sourceView);
- edge.setTarget(targetView);
- }
+// EObject bpmnElement = edge.getElement();
+// if (bpmnElement instanceof SequenceFlow) {
+// SequenceFlow sequenceFlow = (SequenceFlow)bpmnElement;
+// FlowNode source = sequenceFlow.getSourceRef();
+// FlowNode target = sequenceFlow.getTargetRef();
+// View sourceView = viewMap.get(source);
+// View targetView = viewMap.get(target);
+// edge.setSource(sourceView);
+// edge.setTarget(targetView);
+// }
}
}
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnEdgeImpl.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnEdgeImpl.java 2010-11-30
16:14:44 UTC (rev 27028)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/gmf/notation/BpmnEdgeImpl.java 2010-11-30
16:29:29 UTC (rev 27029)
@@ -2,21 +2,18 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.FlowNode;
+import org.eclipse.bpmn2.SequenceFlow;
import org.eclipse.bpmn2.di.BPMNEdge;
import org.eclipse.dd.dc.Bounds;
import org.eclipse.dd.dc.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.gmf.runtime.notation.Bendpoints;
import org.eclipse.gmf.runtime.notation.Connector;
import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
@@ -47,15 +44,17 @@
public void setBendpoints(Bendpoints bendpoints) {
if (bendpoints != null && bendpoints instanceof BpmnBendpointsImpl) {
BpmnBendpointsImpl bpmnBendpoints = (BpmnBendpointsImpl)bendpoints;
- bpmnBendpoints.setEdge(this);
- // force refresh of the points list
- bpmnBendpoints.setPoints(bpmnBendpoints.getPoints());
+ if (bpmnBendpoints.getEdge() != this) {
+ bpmnBendpoints.setEdge(this);
+ // force refresh of the points list
+ bpmnBendpoints.setPoints(bpmnBendpoints.getPoints());
+ }
}
super.setBendpoints(bendpoints);
}
- public void initialize(Diagram parentView) {
- initializeElement();
+ public void initialize(Diagram parentView, Map<EObject, View> viewMap) {
+ initializeElement(viewMap);
initializeBendpoints();
setType(Bpmn2VisualIDRegistry.getType(
Bpmn2VisualIDRegistry.getLinkWithClassVisualID(getElement())));
@@ -87,11 +86,20 @@
}
- private void initializeElement() {
+ private void initializeElement(Map<EObject, View> viewMap) {
EObject element = bpmnEdge.getBpmnElement();
if (element != null) {
super.setElement(element);
}
+ if (element instanceof SequenceFlow) {
+ SequenceFlow sequenceFlow = (SequenceFlow)element;
+ FlowNode source = sequenceFlow.getSourceRef();
+ FlowNode target = sequenceFlow.getTargetRef();
+ View sourceView = viewMap.get(source);
+ View targetView = viewMap.get(target);
+ setSource(sourceView);
+ setTarget(targetView);
+ }
}
}
Show replies by date