summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-07-23 10:11:16 (EDT)
committer Manik Kishore2012-07-30 01:51:15 (EDT)
commit405af38cd109b7591b391fb31967292866d8feab (patch)
tree5a3f67777a8fb5614729dfba9f98a47442db40ec
parent0c4457f4c455b05ecc5e44539b83162165c9a9a0 (diff)
downloadorg.eclipse.stardust.ui.web-405af38cd109b7591b391fb31967292866d8feab.zip
org.eclipse.stardust.ui.web-405af38cd109b7591b391fb31967292866d8feab.tar.gz
org.eclipse.stardust.ui.web-405af38cd109b7591b391fb31967292866d8feab.tar.bz2
Jira-ID: CRNT-25437
1)Added code to adjust the x,y values of Symbols at commmandHandler. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@57866 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java6
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/EventCommandHandler.java122
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/GatewayCommandHandler.java9
3 files changed, 76 insertions, 61 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java
index d622c76..0a41faf 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java
@@ -87,8 +87,10 @@ public class ActivityCommandHandler implements ICommandHandler
ModelerConstants.APPLICATION_FULL_ID_PROPERTY);
String subProcessID = extractString(request, ModelerConstants.MODEL_ELEMENT_PROPERTY,
ModelerConstants.SUBPROCESS_ID);
- int xProperty = extractInt(request, X_PROPERTY);
- int yProperty = extractInt(request, Y_PROPERTY);
+ //TODO -Remove the adjustment and pass correct co-ordinates for symbols.
+ int xProperty = extractInt(request, X_PROPERTY) - ModelerConstants.POOL_LANE_MARGIN;
+ int yProperty = extractInt(request, Y_PROPERTY) - ModelerConstants.POOL_LANE_MARGIN
+ - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT;
int widthProperty = extractInt(request, WIDTH_PROPERTY);
int heightProperty = extractInt(request, HEIGHT_PROPERTY);
synchronized (model)
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/EventCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/EventCommandHandler.java
index 184bf3a..bb74b78 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/EventCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/EventCommandHandler.java
@@ -72,44 +72,51 @@ public class EventCommandHandler implements ICommandHandler
ProcessDefinitionType processDefinition, JsonObject request)
{
- long maxOid = XpdlModelUtils.getMaxUsedOid(model);
-
- if (START_EVENT.equals(extractString(request,
- ModelerConstants.MODEL_ELEMENT_PROPERTY, EVENT_TYPE_PROPERTY)))
- {
- StartEventSymbol startEventSymbol = AbstractElementBuilder.F_CWM.createStartEventSymbol();
- startEventSymbol.setElementOid(++maxOid);
-
- startEventSymbol.setXPos(extractInt(request, X_PROPERTY)
- - parentLaneSymbol.getXPos());
- startEventSymbol.setYPos(extractInt(request, Y_PROPERTY)
- - parentLaneSymbol.getYPos());
- startEventSymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
- startEventSymbol.setHeight(extractInt(request, HEIGHT_PROPERTY));
-
- // TODO evaluate other properties
-
- processDefinition.getDiagram()
- .get(0)
- .getStartEventSymbols()
- .add(startEventSymbol);
- parentLaneSymbol.getStartEventSymbols().add(startEventSymbol);
- }
- else
+ synchronized (model)
{
- EndEventSymbol endEventSymbol = AbstractElementBuilder.F_CWM.createEndEventSymbol();
- endEventSymbol.setElementOid(++maxOid);
-
- endEventSymbol.setXPos(extractInt(request, X_PROPERTY)
- - parentLaneSymbol.getXPos());
- endEventSymbol.setYPos(extractInt(request, Y_PROPERTY)
- - parentLaneSymbol.getYPos());
- endEventSymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
- endEventSymbol.setHeight(extractInt(request, HEIGHT_PROPERTY));
-
- processDefinition.getDiagram().get(0).getEndEventSymbols().add(endEventSymbol);
-
- parentLaneSymbol.getEndEventSymbols().add(endEventSymbol);
+ long maxOid = XpdlModelUtils.getMaxUsedOid(model);
+
+ if (START_EVENT.equals(extractString(request,
+ ModelerConstants.MODEL_ELEMENT_PROPERTY, EVENT_TYPE_PROPERTY)))
+ {
+ StartEventSymbol startEventSymbol = AbstractElementBuilder.F_CWM.createStartEventSymbol();
+ startEventSymbol.setElementOid(++maxOid);
+ // TODO - Pass correct x,y co-ordinates rather than adjustment at server
+ startEventSymbol.setXPos(extractInt(request, X_PROPERTY)
+ - parentLaneSymbol.getXPos() - ModelerConstants.POOL_LANE_MARGIN);
+ startEventSymbol.setYPos(extractInt(request, Y_PROPERTY)
+ - parentLaneSymbol.getYPos() - ModelerConstants.POOL_LANE_MARGIN
+ - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ startEventSymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
+ startEventSymbol.setHeight(extractInt(request, HEIGHT_PROPERTY));
+
+ // TODO evaluate other properties
+
+ processDefinition.getDiagram()
+ .get(0)
+ .getStartEventSymbols()
+ .add(startEventSymbol);
+ parentLaneSymbol.getStartEventSymbols().add(startEventSymbol);
+ }
+ else
+ {
+ EndEventSymbol endEventSymbol = AbstractElementBuilder.F_CWM.createEndEventSymbol();
+ endEventSymbol.setElementOid(++maxOid);
+
+ endEventSymbol.setXPos(extractInt(request, X_PROPERTY)
+ - parentLaneSymbol.getXPos());
+ endEventSymbol.setYPos(extractInt(request, Y_PROPERTY)
+ - parentLaneSymbol.getYPos());
+ endEventSymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
+ endEventSymbol.setHeight(extractInt(request, HEIGHT_PROPERTY));
+
+ processDefinition.getDiagram()
+ .get(0)
+ .getEndEventSymbols()
+ .add(endEventSymbol);
+
+ parentLaneSymbol.getEndEventSymbols().add(endEventSymbol);
+ }
}
}
@@ -117,26 +124,29 @@ public class EventCommandHandler implements ICommandHandler
ProcessDefinitionType processDefinition, JsonObject request)
{
Long eventOId = extractLong(request, ModelerConstants.OID_PROPERTY);
- if (START_EVENT.equals(extractString(request,
- ModelerConstants.MODEL_ELEMENT_PROPERTY, EVENT_TYPE_PROPERTY)))
- {
- StartEventSymbol startEventSymbol = MBFacade.findStartEventSymbol(
- parentLaneSymbol, eventOId);
- processDefinition.getDiagram()
- .get(0)
- .getStartEventSymbols()
- .remove(startEventSymbol);
- parentLaneSymbol.getStartEventSymbols().remove(startEventSymbol);
- }
- else
+ synchronized (model)
{
- EndEventSymbol endEventSymbol = MBFacade.findEndEventSymbol(parentLaneSymbol,
- eventOId);
- processDefinition.getDiagram()
- .get(0)
- .getEndEventSymbols()
- .remove(endEventSymbol);
- parentLaneSymbol.getEndEventSymbols().remove(endEventSymbol);
+ if (START_EVENT.equals(extractString(request,
+ ModelerConstants.MODEL_ELEMENT_PROPERTY, EVENT_TYPE_PROPERTY)))
+ {
+ StartEventSymbol startEventSymbol = MBFacade.findStartEventSymbol(
+ parentLaneSymbol, eventOId);
+ processDefinition.getDiagram()
+ .get(0)
+ .getStartEventSymbols()
+ .remove(startEventSymbol);
+ parentLaneSymbol.getStartEventSymbols().remove(startEventSymbol);
+ }
+ else
+ {
+ EndEventSymbol endEventSymbol = MBFacade.findEndEventSymbol(parentLaneSymbol,
+ eventOId);
+ processDefinition.getDiagram()
+ .get(0)
+ .getEndEventSymbols()
+ .remove(endEventSymbol);
+ parentLaneSymbol.getEndEventSymbols().remove(endEventSymbol);
+ }
}
}
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/GatewayCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/GatewayCommandHandler.java
index 5e60455..7f50f4f 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/GatewayCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/GatewayCommandHandler.java
@@ -87,9 +87,12 @@ public class GatewayCommandHandler implements ICommandHandler
ActivitySymbolType gatewaySymbol = AbstractElementBuilder.F_CWM.createActivitySymbolType();
gatewaySymbol.setElementOid(++maxOid);
-
- gatewaySymbol.setXPos(extractInt(request, X_PROPERTY) - parentLaneSymbol.getXPos());
- gatewaySymbol.setYPos(extractInt(request, Y_PROPERTY) - parentLaneSymbol.getYPos());
+ // TODO - Pass correct x,y co-ordinates rather than adjustment at server
+ gatewaySymbol.setXPos(extractInt(request, X_PROPERTY)
+ - parentLaneSymbol.getXPos() - ModelerConstants.POOL_LANE_MARGIN);
+ gatewaySymbol.setYPos(extractInt(request, Y_PROPERTY)
+ - parentLaneSymbol.getYPos() - ModelerConstants.POOL_LANE_MARGIN
+ - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
gatewaySymbol.setActivity(gateway);
gateway.getActivitySymbols().add(gatewaySymbol);