Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2016-02-04 16:22:32 +0000
committerBob Brodt2016-02-04 16:22:32 +0000
commite13bdb60aeac145fca6fca84062a5c2091c2e27d (patch)
treede5e48cee50d1484ebd53bbe5435ab32f32b0e90
parentdb1f1b92a6b1ec7c23d6c96171f8f3cde004b294 (diff)
downloadorg.eclipse.bpmn2-modeler-e13bdb60aeac145fca6fca84062a5c2091c2e27d.tar.gz
org.eclipse.bpmn2-modeler-e13bdb60aeac145fca6fca84062a5c2091c2e27d.tar.xz
org.eclipse.bpmn2-modeler-e13bdb60aeac145fca6fca84062a5c2091c2e27d.zip
Bug 484071 - Drag and drop of call activity is corrupting the sequence
flow
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2AddFeature.java2
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractAddActivityFeature.java9
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AddEventFeature.java10
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AddGatewayFeature.java9
4 files changed, 21 insertions, 9 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2AddFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2AddFeature.java
index fc1fb255..8fa7fc0d 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2AddFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmn2AddFeature.java
@@ -230,7 +230,7 @@ public abstract class AbstractBpmn2AddFeature<T extends BaseElement>
rc.setTargetPictogramElement(containerShape);
}
else {
- anchor = AnchorUtil.createAnchor(oldTargetContainer, GraphicsUtil.getShapeCenter(containerShape));
+ anchor = AnchorUtil.createAnchor(containerShape, GraphicsUtil.getShapeCenter(containerShape));
rc = new ReconnectionContext(connection, connection.getEnd(), anchor, targetLocation);
rc.setReconnectType(ReconnectionContext.RECONNECT_TARGET);
rc.setTargetPictogramElement(containerShape);
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractAddActivityFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractAddActivityFeature.java
index 418204c7..0fea236a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractAddActivityFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/activity/AbstractAddActivityFeature.java
@@ -77,8 +77,9 @@ public abstract class AbstractAddActivityFeature<T extends Activity>
height = Math.min(targetAlgorithm.getHeight(), height);
}
+ int oldX = context.getX();
+ int oldY = context.getY();
adjustLocation(context,width,height);
-
int x = context.getX();
int y = context.getY();
@@ -91,8 +92,8 @@ public abstract class AbstractAddActivityFeature<T extends Activity>
boolean isImport = context.getProperty(GraphitiConstants.IMPORT_PROPERTY) != null;
createDIShape(containerShape, businessObject, !isImport);
- FeatureSupport.setPropertyValue(containerShape, GraphitiConstants.IS_COMPENSATE_PROPERTY, Boolean.toString(false));
- FeatureSupport.setPropertyValue(containerShape, GraphitiConstants.IS_LOOP_OR_MULTI_INSTANCE, LoopCharacteristicType.NULL.getName());
+ peService.setPropertyValue(containerShape, GraphitiConstants.IS_COMPENSATE_PROPERTY, Boolean.toString(false));
+ peService.setPropertyValue(containerShape, GraphitiConstants.IS_LOOP_OR_MULTI_INSTANCE, LoopCharacteristicType.NULL.getName());
// hook for subclasses to inject extra code
((AddContext)context).setWidth(width);
@@ -101,6 +102,8 @@ public abstract class AbstractAddActivityFeature<T extends Activity>
peService.createChopboxAnchor(containerShape);
+ ((AddContext)context).setX(oldX);
+ ((AddContext)context).setY(oldY);
splitConnection(context, containerShape);
return containerShape;
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AddEventFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AddEventFeature.java
index 83264f50..936697f2 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AddEventFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/event/AddEventFeature.java
@@ -23,6 +23,7 @@ import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
import org.eclipse.graphiti.features.IAddFeature;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.impl.AddContext;
import org.eclipse.graphiti.mm.algorithms.Ellipse;
import org.eclipse.graphiti.mm.algorithms.Rectangle;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
@@ -57,8 +58,9 @@ public abstract class AddEventFeature<T extends Event>
width = height = Math.min(width, height);
}
+ int oldX = context.getX();
+ int oldY = context.getY();
adjustLocation(context,width,height);
-
int x = context.getX();
int y = context.getY();
@@ -67,8 +69,8 @@ public abstract class AddEventFeature<T extends Event>
gaService.setLocationAndSize(invisibleRect, x, y, width, height);
Shape ellipseShape = peService.createShape(containerShape, false);
- FeatureSupport.setPropertyValue(ellipseShape, GraphitiConstants.EVENT_ELEMENT, GraphitiConstants.EVENT_CIRCLE);
- FeatureSupport.setPropertyValue(containerShape, GraphitiConstants.EVENT_MARKER_CONTAINER, Boolean.toString(true));
+ peService.setPropertyValue(ellipseShape, GraphitiConstants.EVENT_ELEMENT, GraphitiConstants.EVENT_CIRCLE);
+ peService.setPropertyValue(containerShape, GraphitiConstants.EVENT_MARKER_CONTAINER, Boolean.toString(true));
Ellipse ellipse = createEventShape(ellipseShape, width, height);
StyleUtil.applyStyle(ellipse, businessObject);
boolean isImport = context.getProperty(GraphitiConstants.IMPORT_PROPERTY) != null;
@@ -78,6 +80,8 @@ public abstract class AddEventFeature<T extends Event>
peService.createChopboxAnchor(containerShape);
+ ((AddContext)context).setX(oldX);
+ ((AddContext)context).setY(oldY);
splitConnection(context, containerShape);
return containerShape;
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AddGatewayFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AddGatewayFeature.java
index b163d402..13e6e50f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AddGatewayFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/gateway/AddGatewayFeature.java
@@ -24,6 +24,7 @@ import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
import org.eclipse.graphiti.features.IAddFeature;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.features.context.impl.AddContext;
import org.eclipse.graphiti.mm.algorithms.Polygon;
import org.eclipse.graphiti.mm.algorithms.Rectangle;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
@@ -57,8 +58,10 @@ public abstract class AddGatewayFeature<T extends Gateway>
if (width!=height) {
width = height = Math.min(width, height);
}
+
+ int oldX = context.getX();
+ int oldY = context.getY();
adjustLocation(context, width, height);
-
int x = context.getX();
int y = context.getY();
@@ -82,7 +85,7 @@ public abstract class AddGatewayFeature<T extends Gateway>
newBpmnShape.setIsMarkerVisible(false);
}
else {
- BPMNShape oldBpmnShape = (BPMNShape)context.getProperty(GraphitiConstants.COPIED_BPMN_DI_ELEMENT);
+ BPMNShape oldBpmnShape = (BPMNShape)context.getProperty(GraphitiConstants.COPIED_BPMN_SHAPE);
if (oldBpmnShape!=null) {
newBpmnShape.setIsMarkerVisible( oldBpmnShape.isIsMarkerVisible() );
}
@@ -92,6 +95,8 @@ public abstract class AddGatewayFeature<T extends Gateway>
decorateShape(context, containerShape, businessObject);
peService.createChopboxAnchor(containerShape);
+ ((AddContext)context).setX(oldX);
+ ((AddContext)context).setY(oldY);
splitConnection(context, containerShape);
return containerShape;

Back to the top