summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-21 03:32:02 (EDT)
committer Stephan Born2012-08-21 03:32:02 (EDT)
commitcb2a94e08bceeee5b05e9372305ba8dabcfac9bc (patch)
tree1e0d7aadfcc42efb4b5e05a453c59de3f3b8df78
parent70c7dac72cf32fa4a90c692349af69bf47dc1d67 (diff)
downloadorg.eclipse.stardust.ui.web-cb2a94e08bceeee5b05e9372305ba8dabcfac9bc.zip
org.eclipse.stardust.ui.web-cb2a94e08bceeee5b05e9372305ba8dabcfac9bc.tar.gz
org.eclipse.stardust.ui.web-cb2a94e08bceeee5b05e9372305ba8dabcfac9bc.tar.bz2
CRNT-25723
1)Added code to get swimlane offsetX,offsetY in toDataSymbolJson x,y position. 2)Added x,y adjustment in DataCommandHandler x,y co-ordinates. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58563 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java5
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java24
2 files changed, 25 insertions, 4 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
index fd1c7ff..eccb734 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
@@ -63,8 +63,9 @@ public class DataCommandHandler
String dataFullID = extractString(request, ModelerConstants.DATA_FULL_ID_PROPERTY);
String dataID = extractString(request, ModelerConstants.DATA_ID_PROPERTY);
String dataName = extractString(request, ModelerConstants.DATA_NAME_PROPERTY);
- int xProperty = extractInt(request, ModelerConstants.X_PROPERTY);
- int yProperty = extractInt(request, ModelerConstants.Y_PROPERTY);
+ int xProperty = extractInt(request, ModelerConstants.X_PROPERTY) - ModelerConstants.POOL_LANE_MARGIN;
+ int yProperty = extractInt(request, ModelerConstants.Y_PROPERTY)- ModelerConstants.POOL_LANE_MARGIN
+ - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT;
int widthProperty = extractInt(request, ModelerConstants.WIDTH_PROPERTY);
int heightProperty = extractInt(request, ModelerConstants.HEIGHT_PROPERTY);
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
index 461e5c9..8536262 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
@@ -824,11 +824,31 @@ public abstract class ModelElementMarshaller
public JsonObject toDataSymbolJson(DataSymbolType dataSymbol)
{
JsonObject dataSymbolJson = new JsonObject();
+ int laneOffsetX = 0;
+ int laneOffsetY = 0;
+ ISwimlaneSymbol container = (dataSymbol.eContainer() instanceof ISwimlaneSymbol)
+ ? (ISwimlaneSymbol) dataSymbol.eContainer()
+ : null;
+ while (null != container)
+ {
+ laneOffsetX += container.getXPos();
+ laneOffsetY += container.getYPos();
+ // recurse
+ container = (container.eContainer() instanceof ISwimlaneSymbol)
+ ? (ISwimlaneSymbol) container.eContainer()
+ : null;
+ }
+
dataSymbolJson.addProperty(ModelerConstants.OID_PROPERTY,
dataSymbol.getElementOid());
- dataSymbolJson.addProperty(ModelerConstants.X_PROPERTY, dataSymbol.getXPos());
- dataSymbolJson.addProperty(ModelerConstants.Y_PROPERTY, dataSymbol.getYPos());
+ dataSymbolJson.addProperty(ModelerConstants.X_PROPERTY,
+ dataSymbol.getXPos() + laneOffsetX
+ + ModelerConstants.POOL_LANE_MARGIN);
+ dataSymbolJson.addProperty(ModelerConstants.Y_PROPERTY,
+ dataSymbol.getYPos() + laneOffsetY
+ + ModelerConstants.POOL_LANE_MARGIN
+ + ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
dataSymbolJson.addProperty(ModelerConstants.UUID_PROPERTY,
eObjectUUIDMapper().getUUID(dataSymbol));
dataSymbolJson.addProperty(ModelerConstants.TYPE_PROPERTY,