summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-30 03:16:11 (EDT)
committerStephan Born2012-08-30 03:16:11 (EDT)
commitdb862879dc6d189d41177909340dbb3f92cb173c (patch)
treebc7b5c6fcbc7b2fff1f98b31b4e17796eda7d82f
parentf3f58672991c52867043f684920cf9173fb14a63 (diff)
downloadorg.eclipse.stardust.ui.web-db862879dc6d189d41177909340dbb3f92cb173c.zip
org.eclipse.stardust.ui.web-db862879dc6d189d41177909340dbb3f92cb173c.tar.gz
org.eclipse.stardust.ui.web-db862879dc6d189d41177909340dbb3f92cb173c.tar.bz2
CRNT-25577
1)Removed the adjustment done at server side and client side in X,Y co-ordinates at ModelElementMarshaller,Handler classes 2)Added check in m_poolSymbol.js adjustChildSymbols() to check if symbol is on lane Header then set dy. 3)Removed the adjustment in newGoemetry in dragStop of symbol in m_symbol.js git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58790 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java5
-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/edit/diagram/node/EventCommandHandler.java10
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/GatewayCommandHandler.java5
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java26
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js98
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js12
7 files changed, 76 insertions, 85 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 c2a2de2..5fd8591 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
@@ -69,9 +69,8 @@ public class ActivityCommandHandler
String subProcessID = extractString(request, ModelerConstants.MODEL_ELEMENT_PROPERTY,
ModelerConstants.SUBPROCESS_ID);
//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 xProperty = extractInt(request, X_PROPERTY);
+ int yProperty = extractInt(request, Y_PROPERTY);
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/DataCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
index c0ca30a..cb11f42 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
@@ -61,9 +61,8 @@ 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) - ModelerConstants.POOL_LANE_MARGIN;
- int yProperty = extractInt(request, ModelerConstants.Y_PROPERTY) - ModelerConstants.POOL_LANE_MARGIN
- - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT;
+ int xProperty = extractInt(request, ModelerConstants.X_PROPERTY);
+ int yProperty = extractInt(request, ModelerConstants.Y_PROPERTY);
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/edit/diagram/node/EventCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/EventCommandHandler.java
index 177c2d7..54ea0b7 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
@@ -66,10 +66,9 @@ public class EventCommandHandler
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);
+ - parentLaneSymbol.getXPos());
startEventSymbol.setYPos(extractInt(request, Y_PROPERTY)
- - parentLaneSymbol.getYPos() - ModelerConstants.POOL_LANE_MARGIN
- - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ - parentLaneSymbol.getYPos());
startEventSymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
startEventSymbol.setHeight(extractInt(request, HEIGHT_PROPERTY));
@@ -87,10 +86,9 @@ public class EventCommandHandler
endEventSymbol.setElementOid(++maxOid);
endEventSymbol.setXPos(extractInt(request, X_PROPERTY)
- - parentLaneSymbol.getXPos() - ModelerConstants.POOL_LANE_MARGIN);
+ - parentLaneSymbol.getXPos());
endEventSymbol.setYPos(extractInt(request, Y_PROPERTY)
- - parentLaneSymbol.getYPos() - ModelerConstants.POOL_LANE_MARGIN
- - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ - parentLaneSymbol.getYPos());
endEventSymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
endEventSymbol.setHeight(extractInt(request, HEIGHT_PROPERTY));
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 41f82da..41b6354 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
@@ -77,10 +77,9 @@ public class GatewayCommandHandler
gatewaySymbol.setElementOid(++maxOid);
// TODO - Pass correct x,y co-ordinates rather than adjustment at server
gatewaySymbol.setXPos(extractInt(request, X_PROPERTY)
- - parentLaneSymbol.getXPos() - ModelerConstants.POOL_LANE_MARGIN);
+ - parentLaneSymbol.getXPos());
gatewaySymbol.setYPos(extractInt(request, Y_PROPERTY)
- - parentLaneSymbol.getYPos() - ModelerConstants.POOL_LANE_MARGIN
- - ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ - parentLaneSymbol.getYPos());
gatewaySymbol.setActivity(gateway);
gatewaySymbol.setWidth(extractInt(request, WIDTH_PROPERTY));
gatewaySymbol.setHeight(extractInt(request, 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 767d09e..9bdaf37 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
@@ -643,10 +643,9 @@ public abstract class ModelElementMarshaller
activitySymbolJson.addProperty(ModelerConstants.OID_PROPERTY,
activitySymbol.getElementOid());
activitySymbolJson.addProperty(ModelerConstants.X_PROPERTY,
- activitySymbol.getXPos() + laneOffsetX + ModelerConstants.POOL_LANE_MARGIN);
+ activitySymbol.getXPos() + laneOffsetX);
activitySymbolJson.addProperty(ModelerConstants.Y_PROPERTY,
- activitySymbol.getYPos() + laneOffsetY + ModelerConstants.POOL_LANE_MARGIN
- + ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ activitySymbol.getYPos() + laneOffsetY);
activitySymbolJson.addProperty(ModelerConstants.WIDTH_PROPERTY,
activitySymbol.getWidth());
activitySymbolJson.addProperty(ModelerConstants.HEIGHT_PROPERTY,
@@ -734,13 +733,11 @@ public abstract class ModelElementMarshaller
startEventSymbol.getElementOid());
// TODO check this math
- eventSymbolJson.addProperty(ModelerConstants.X_PROPERTY,
- startEventSymbol.getXPos() + laneOffsetX + ModelerConstants.POOL_LANE_MARGIN
- + (startEventSymbol.getWidth() / 2)
- - ModelerConstants.START_END_SYMBOL_LEFT_OFFSET);
+ eventSymbolJson.addProperty(ModelerConstants.X_PROPERTY, startEventSymbol.getXPos()
+ + laneOffsetX + (startEventSymbol.getWidth() / 2)
+ - ModelerConstants.START_END_SYMBOL_LEFT_OFFSET);
eventSymbolJson.addProperty(ModelerConstants.Y_PROPERTY, startEventSymbol.getYPos()
- + laneOffsetY + ModelerConstants.POOL_LANE_MARGIN
- + ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ + laneOffsetY);
JsonObject eventJson = new JsonObject();
eventSymbolJson.add(ModelerConstants.MODEL_ELEMENT_PROPERTY, eventJson);
@@ -788,11 +785,9 @@ public abstract class ModelElementMarshaller
eventSymbolJson.addProperty(ModelerConstants.OID_PROPERTY,
endEventSymbol.getElementOid());
eventSymbolJson.addProperty(ModelerConstants.X_PROPERTY, endEventSymbol.getXPos()
- + laneOffsetX + ModelerConstants.POOL_LANE_MARGIN
- + ModelerConstants.START_END_SYMBOL_LEFT_OFFSET);
+ + laneOffsetX + ModelerConstants.START_END_SYMBOL_LEFT_OFFSET);
eventSymbolJson.addProperty(ModelerConstants.Y_PROPERTY, endEventSymbol.getYPos()
- + laneOffsetY + ModelerConstants.POOL_LANE_MARGIN
- + ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ + laneOffsetY);
JsonObject eventJson = new JsonObject();
eventSymbolJson.add(ModelerConstants.MODEL_ELEMENT_PROPERTY, eventJson);
@@ -943,10 +938,9 @@ public abstract class ModelElementMarshaller
dataSymbolJson.addProperty(ModelerConstants.OID_PROPERTY,
dataSymbol.getElementOid());
dataSymbolJson.addProperty(ModelerConstants.X_PROPERTY, dataSymbol.getXPos()
- + laneOffsetX + ModelerConstants.POOL_LANE_MARGIN);
+ + laneOffsetX);
dataSymbolJson.addProperty(ModelerConstants.Y_PROPERTY, dataSymbol.getYPos()
- + laneOffsetY + ModelerConstants.POOL_LANE_MARGIN
- + ModelerConstants.POOL_SWIMLANE_TOP_BOX_HEIGHT);
+ + laneOffsetY);
dataSymbolJson.addProperty(ModelerConstants.UUID_PROPERTY,
eObjectUUIDMapper().getUUID(dataSymbol));
dataSymbolJson.addProperty(ModelerConstants.TYPE_PROPERTY,
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js
index a8a596c..e42a19d 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js
@@ -34,7 +34,7 @@ define(
};
/**
- *
+ *
*/
function PoolSymbol() {
var symbol = m_symbol.createSymbol();
@@ -50,7 +50,7 @@ define(
this.height = 0;
this.orientation = null;
var laneIndex = 1;
-
+
/**
* Binds all client-side aspects to the object (graphics
@@ -66,14 +66,14 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.toString = function() {
return "[object Lightdust.PoolSymbol()]";
};
/**
- *
+ *
*/
PoolSymbol.prototype.initializeFromJson = function() {
var hasLanes = false;
@@ -97,7 +97,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createTransferObject = function() {
var transferObject = {};
@@ -115,7 +115,7 @@ define(
transferObject.laneSymbols[laneSymbol] = this.laneSymbols[laneSymbol]
.createTransferObject();
}
-
+
transferObject.containedSymbols = [];
for ( var symbol in this.containedSymbols) {
@@ -127,7 +127,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createCreateCommand = function() {
return m_command.createCommand("/models/"
@@ -137,7 +137,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createUpdateCommand = function() {
return m_command.createCommand("/models/"
@@ -147,7 +147,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createPrimitives = function() {
this.borderRectangle = m_canvasManager
@@ -202,7 +202,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createChildSymbols = function() {
// if (this.laneSymbols.size() == 0) {
@@ -211,14 +211,14 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.isContainerSymbol = function() {
return true;
};
/**
- *
+ *
*/
PoolSymbol.prototype.createDefaultLane = function() {
laneIndex = 0;
@@ -239,14 +239,14 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createSwimlaneSymbol = function() {
this.createSwimlaneSymbolFromParticipant(null, this);
};
/**
- *
+ *
*/
PoolSymbol.prototype.createSwimlaneSymbolFromParticipant = function(
participant) {
@@ -262,9 +262,9 @@ define(
}
this.laneSymbols.push(swimlaneSymbol);
-
+
// Required to receive command callbacks
-
+
this.diagram.lastSymbol = swimlaneSymbol;
swimlaneSymbol
@@ -290,7 +290,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.recalculateBoundingBox = function() {
this.width = this.calculateWidth();
@@ -302,7 +302,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.calculateWidth = function() {
if (this.diagram.flowOrientation == m_constants.DIAGRAM_FLOW_ORIENTATION_VERTICAL) {
@@ -327,7 +327,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.calculateHeight = function() {
if (this.diagram.flowOrientation == m_constants.DIAGRAM_FLOW_ORIENTATION_VERTICAL) {
@@ -353,7 +353,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.adjustPrimitives = function(dX, dY) {
if (this.diagram.flowOrientation == m_constants.DIAGRAM_FLOW_ORIENTATION_VERTICAL) {
@@ -384,7 +384,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.adjustChildSymbols = function() {
if (this.diagram.flowOrientation == m_constants.DIAGRAM_FLOW_ORIENTATION_VERTICAL) {
@@ -395,14 +395,20 @@ define(
//(due to a lane being shrunk from top)
var dY = 0;
for ( var n in this.laneSymbols) {
- dY = (this.y
- + m_constants.POOL_SWIMLANE_TOP_BOX_HEIGHT
- + m_constants.POOL_SWIMLANE_MARGIN) - this.laneSymbols[n].y;
- if (parseInt(dY) != 0) {
- break;
+ var dYNew = (this.y + 2
+ * m_constants.POOL_SWIMLANE_TOP_BOX_HEIGHT + m_constants.POOL_SWIMLANE_MARGIN)
+ - this.laneSymbols[n].y;
+ // If child symbols are on lane header, dY is set to
+ // move the child symbols
+ for ( var c in this.laneSymbols[n].containedSymbols) {
+ if (this.laneSymbols[n].containedSymbols[c].y <= dYNew) {
+ if (dY < dYNew) {
+ dY = dYNew;
+ }
+ }
}
}
-
+
for ( var n in this.laneSymbols) {
var dX = currentX - this.laneSymbols[n].x;
this.laneSymbols[n].x = currentX;
@@ -411,7 +417,7 @@ define(
+ m_constants.POOL_SWIMLANE_MARGIN;
currentX += this.laneSymbols[n].width;
currentX += m_constants.POOL_SWIMLANE_MARGIN;
-
+
for (var c in this.laneSymbols[n].containedSymbols) {
this.laneSymbols[n].containedSymbols[c].moveBy(dX, dY);
}
@@ -424,7 +430,7 @@ define(
for ( var n in this.laneSymbols) {
var dY = currentY - this.laneSymbols[n].y;
-
+
this.laneSymbols[n].x = this.x
+ m_constants.POOL_SWIMLANE_TOP_BOX_HEIGHT
+ m_constants.POOL_SWIMLANE_MARGIN;
@@ -439,14 +445,14 @@ define(
this.laneSymbols[n].adjustGeometry();
}
}
-
- /* Call hideSnapLines, as the moveBy function invokes checkSnaplines causing the
+
+ /* Call hideSnapLines, as the moveBy function invokes checkSnaplines causing the
* snap lines to be created. */
this.diagram.hideSnapLines();
};
/**
- *
+ *
*/
PoolSymbol.prototype.flipFlowOrientation = function(
flowOrientation) {
@@ -459,7 +465,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createFlyOutMenuBackground = function(x,
y, height, width) {
@@ -487,7 +493,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.initializeEventHandling = function() {
// this.borderRectangle.auxiliaryProperties.callbackScope =
@@ -495,7 +501,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.adjustFlyOutMenu = function(x, y, width,
height) {
@@ -508,13 +514,13 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.createFlyOutMenu = function() {
};
/**
- *
+ *
*/
PoolSymbol.prototype.createProximitySensorPrimitive = function() {
var POOL_PROXIMITY_SENSOR_WIDTH = 3;
@@ -530,7 +536,7 @@ define(
};
/**
- *
+ *
* @param x
* @param y
* @param width
@@ -542,7 +548,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.findContainerSymbol = function(x, y) {
// TODO Add recursion for nested swimlanes
@@ -556,7 +562,7 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.findLane = function(id) {
// TODO Add recursion for nested swimlanes
@@ -570,14 +576,14 @@ define(
};
/**
- *
+ *
*/
PoolSymbol.prototype.requiresParentSymbol = function() {
return false;
};
/**
- *
+ *
*/
PoolSymbol.prototype.getLaneIndex = function() {
@@ -591,7 +597,7 @@ define(
return laneIndex;
};
-
+
PoolSymbol.prototype.getAllDataSymbols = function(dataSymbols) {
for ( var n in this.laneSymbols) {
this.laneSymbols[n].getAllDataSymbols(dataSymbols);
@@ -599,16 +605,16 @@ define(
return dataSymbols;
};
-
+
PoolSymbol.prototype.removeLane = function(laneSymbol) {
/* remove lane from lane symbols array. */
m_utils.removeItemFromArray(this.laneSymbols, laneSymbol);
-
+
/* Create a default lane if the very last lane was deleted. */
if(this.laneSymbols.length == 0) {
this.createDefaultLane();
}
-
+
this.recalculateBoundingBox();
this.adjustGeometry();
};
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
index bc6c2a6..7d9657b 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
@@ -929,10 +929,8 @@ define(
"oid" : this.oid
};
var newGeometry = {
- "x" : this.x - m_constants.POOL_LANE_MARGIN,
- "y" : this.y
- - m_constants.POOL_LANE_MARGIN
- - m_constants.POOL_SWIMLANE_TOP_BOX_HEIGHT,
+ "x" : this.x,
+ "y" : this.y,
"oid" : this.oid
};
@@ -955,10 +953,8 @@ define(
"oid" : this.oid
};
var newGeometry = {
- "x" : this.x - m_constants.POOL_LANE_MARGIN,
- "y" : this.y
- - m_constants.POOL_LANE_MARGIN
- - m_constants.POOL_SWIMLANE_TOP_BOX_HEIGHT,
+ "x" : this.x,
+ "y" : this.y,
"oid" : this.oid
};