summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-12 05:52:19 (EDT)
committer Stephan Born2012-09-12 05:52:19 (EDT)
commit27b364ca133635b4546c55d422ab97b9886a60ee (patch)
tree52624a17c9cd77a090afa94158d8684f67a4bc07
parent7fb77dc8fd746c6e713a25eb2c7a52b6ab5be605 (diff)
downloadorg.eclipse.stardust.ui.web-27b364ca133635b4546c55d422ab97b9886a60ee.zip
org.eclipse.stardust.ui.web-27b364ca133635b4546c55d422ab97b9886a60ee.tar.gz
org.eclipse.stardust.ui.web-27b364ca133635b4546c55d422ab97b9886a60ee.tar.bz2
CRNT-26157
1)added check in ModelElementUnmarshaller.java updateNodeSymbol() for x,y git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@59114 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java61
1 files changed, 33 insertions, 28 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
index 2372ea2..9663a45 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
@@ -592,38 +592,43 @@ public abstract class ModelElementUnmarshaller implements ModelUnmarshaller
*/
private void updateNodeSymbol(INodeSymbol nodeSymbol, JsonObject nodeSymbolJto)
{
- int x = extractInt(nodeSymbolJto, ModelerConstants.X_PROPERTY);
- int y = extractInt(nodeSymbolJto, ModelerConstants.Y_PROPERTY);
-
- // adjust coordinates from global to local
- int laneOffsetX = 0;
- int laneOffsetY = 0;
- ISwimlaneSymbol container = (nodeSymbol.eContainer() instanceof ISwimlaneSymbol)
- ? (ISwimlaneSymbol) nodeSymbol.eContainer()
- : null;
- while (null != container)
+ if (nodeSymbolJto.has(ModelerConstants.X_PROPERTY)
+ && nodeSymbolJto.has(ModelerConstants.Y_PROPERTY))
{
- laneOffsetX += container.getXPos();
- laneOffsetY += container.getYPos();
-
- // recurse
- container = (container.eContainer() instanceof ISwimlaneSymbol)
- ? (ISwimlaneSymbol) container.eContainer()
+ int x = extractInt(nodeSymbolJto, ModelerConstants.X_PROPERTY);
+ int y = extractInt(nodeSymbolJto, ModelerConstants.Y_PROPERTY);
+
+ // adjust coordinates from global to local
+ int laneOffsetX = 0;
+ int laneOffsetY = 0;
+ ISwimlaneSymbol container = (nodeSymbol.eContainer() instanceof ISwimlaneSymbol)
+ ? (ISwimlaneSymbol) nodeSymbol.eContainer()
: null;
- }
+ while (null != container)
+ {
+ laneOffsetX += container.getXPos();
+ laneOffsetY += container.getYPos();
- nodeSymbol.setXPos(x - laneOffsetX);
- nodeSymbol.setYPos(y - laneOffsetY);
+ // recurse
+ container = (container.eContainer() instanceof ISwimlaneSymbol)
+ ? (ISwimlaneSymbol) container.eContainer()
+ : null;
+ }
+
+ nodeSymbol.setXPos(x - laneOffsetX);
+ nodeSymbol.setYPos(y - laneOffsetY);
+
+ if (nodeSymbolJto.has(ModelerConstants.WIDTH_PROPERTY))
+ {
+ int width = extractInt(nodeSymbolJto, ModelerConstants.WIDTH_PROPERTY);
+ nodeSymbol.setWidth(width);
+ }
+ if (nodeSymbolJto.has(ModelerConstants.HEIGHT_PROPERTY))
+ {
+ int height = extractInt(nodeSymbolJto, ModelerConstants.HEIGHT_PROPERTY);
+ nodeSymbol.setHeight(height);
+ }
- if (nodeSymbolJto.has(ModelerConstants.WIDTH_PROPERTY))
- {
- int width = extractInt(nodeSymbolJto, ModelerConstants.WIDTH_PROPERTY);
- nodeSymbol.setWidth(width);
- }
- if (nodeSymbolJto.has(ModelerConstants.HEIGHT_PROPERTY))
- {
- int height = extractInt(nodeSymbolJto, ModelerConstants.HEIGHT_PROPERTY);
- nodeSymbol.setHeight(height);
}
}