summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-10-19 06:08:13 (EDT)
committerManik Kishore2012-10-19 06:08:13 (EDT)
commit360abc22fb05eb07ef979c00bb95c03aeae97611 (patch)
tree5beea1551995018bbade564beaa35ff0f1be859f
parentc8170a3a4c973dd6ebcc41a7b6f6abf28f83a1e9 (diff)
downloadorg.eclipse.stardust.ui.web-360abc22fb05eb07ef979c00bb95c03aeae97611.zip
org.eclipse.stardust.ui.web-360abc22fb05eb07ef979c00bb95c03aeae97611.tar.gz
org.eclipse.stardust.ui.web-360abc22fb05eb07ef979c00bb95c03aeae97611.tar.bz2
CRNT-26663
Added code to update the AnchorPoint cacheX and cacheY used when lanes are minimized. Moved the code updateServerSideCoordinates to m_symbol.js from individual symbols git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@60182 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js3
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js3
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js4
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js3
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js46
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js9
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js7
7 files changed, 47 insertions, 28 deletions
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js
index a1c2122..1b975b8 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js
@@ -317,9 +317,6 @@ define(
this.sequentialMultiProcessingMarkerIcon.show();
}
- // Store the server side co-ord, required for moving symbol
- // when other lane is minimized.
- this.updateServerSideCoordinates();
};
/**
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
index 6161ea0..dbf75ed 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
@@ -269,9 +269,6 @@ define(
this.text.attr("text", data.name);
this.modelElement = data;
}
- // Store the server side co-ord, required for moving symbol
- // when other lane is minimized.
- this.updateServerSideCoordinates();
};
/**
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js
index c92c741..6054d88 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js
@@ -128,7 +128,6 @@ define(
transferObject.image = null;
transferObject.startImageUrl = null;
transferObject.stopImageUrl = null;
-
return transferObject;
};
@@ -201,9 +200,6 @@ define(
m_constants.EVENT_STOP_STROKE_WIDTH);
this.image.attr("src", this.stopImageUrl);
}
- // Store the server side co-ord, required for moving symbol
- // when other lane is minimized.
- this.updateServerSideCoordinates();
};
/**
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js
index e97a3bd..c458d69 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js
@@ -423,9 +423,6 @@ define(
this.orCircle.show();
}
- // Store the server side co-ord, required for moving symbol
- // when other lane is minimized.
- this.updateServerSideCoordinates();
};
GatewaySymbol.prototype.recalculateBoundingBox = function() {
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 c1610f2..06a6de2 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
@@ -304,7 +304,9 @@ define(
this.recalculateBoundingBox();
this.adjustGeometry();
-
+ // If any lane is minimized , x co-ord needs to be
+ // adjusted
+ this.adjustCurrentLaneCoordinates(swimlaneSymbol);
//The create REST call for swimlanes is made after the swimlabe is created and re-positioned.
swimlaneSymbol.createAndSubmitCreateCommand();
} else {
@@ -313,6 +315,23 @@ define(
};
/**
+ * Adjust the co-ordinates for current swimalane, and set offset
+ * required for calcualating x/y for symbols contained in lane
+ */
+ PoolSymbol.prototype.adjustCurrentLaneCoordinates = function(
+ swimlaneSymbol) {
+ var xOffset = 0;
+ for ( var n in this.laneSymbols) {
+ if (this.laneSymbols[n].minimized) {
+ xOffset = this.laneSymbols[n].cacheWidth - this.laneSymbols[n].width;
+ swimlaneSymbol.x += xOffset;
+ swimlaneSymbol.symbolXOffset = xOffset;
+ break;
+ }
+ }
+ };
+
+ /**
*
*/
PoolSymbol.prototype.recalculateBoundingBox = function() {
@@ -409,11 +428,11 @@ define(
0);
}
} else {
- if (this.laneSymbols[n].symbolXOffset > 0 ) {
+ if (this.laneSymbols[n].symbolXOffset > 0) {
// Reset the offset, when adjacant lane is
// maximized
this.laneSymbols[n].symbolXOffset -= (currentLane.cacheWidth - currentLane.width);
- //Move the lane to right
+ // Move the lane to right
this.laneSymbols[n].moveBy(
currentLane.cacheWidth
- currentLane.width, 0);
@@ -426,16 +445,21 @@ define(
- this.laneSymbols[n].symbolXOffset,
this.laneSymbols[n].containedSymbols[c].serverSideCoordinates.y);
- // TODO - Cache Anchor Points stored when lane is minimized, needs to be
+ // Cache Anchor Points stored when lane is minimized, needs to be
// moved when adj lane is maximized and current lane is in minimized state
- /* for(var m in this.laneSymbols[n].containedSymbols[c].anchorPoints){
- if(this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheX){
- this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheX += this.laneSymbols[n].symbolXOffset;
- }
- if(this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheY){
- this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheY += this.laneSymbols[n].symbolXOffset;
+ for ( var m in this.laneSymbols[n].containedSymbols[c].anchorPoints) {
+ if (this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheX) {
+ var symbolNewAnchorPointLocation = this.laneSymbols[n].containedSymbols[c].x
+ + this.laneSymbols[n].containedSymbols[c].width
+ / 2;
+ this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheX += (symbolNewAnchorPointLocation - this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheX);
+ }else if (this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheY) {
+ var symbolNewAnchorPointLocation = this.laneSymbols[n].containedSymbols[c].y
+ + this.laneSymbols[n].containedSymbols[c].height
+ / 2;
+ this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheY += (symbolNewAnchorPointLocation - this.laneSymbols[n].containedSymbols[c].anchorPoints[m].cacheY);
}
- }*/
+ }
}
}
}
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js
index 367d40e..09446a1 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js
@@ -123,11 +123,13 @@ define(
SwimlaneSymbol.prototype.initializeFromJson = function() {
this.prepareNoPosition();
this.completeNoTransfer();
+ this.updateServerSideCoordinates();
for ( var n in this.activitySymbols) {
var activitySymbol = m_activitySymbol
.createActivitySymbolFromJson(this.diagram,
this, this.activitySymbols[n]);
+ this.activitySymbols[n].updateServerSideCoordinates();
}
// Create gateways
@@ -135,6 +137,7 @@ define(
for ( var n in this.gatewaySymbols) {
m_gatewaySymbol.createGatewaySymbolFromJson(
this.diagram, this, this.gatewaySymbols[n]);
+ this.gatewaySymbols[n].updateServerSideCoordinates();
}
// Create event symbols
@@ -142,6 +145,7 @@ define(
for ( var n in this.eventSymbols) {
m_eventSymbol.createEventSymbolFromJson(this.diagram,
this, this.eventSymbols[n]);
+ this.eventSymbols[n].updateServerSideCoordinates();
}
// Create data symbols
@@ -149,12 +153,14 @@ define(
for ( var n in this.dataSymbols) {
m_dataSymbol.createDataSymbolFromJson(this.diagram,
this, this.dataSymbols[n]);
+ this.dataSymbols[n].updateServerSideCoordinates();
}
// Create data symbols
for ( var n in this.annotationSymbols) {
m_annotationSymbol.createFromJson(this.diagram,
this, this.annotationSymbols[n]);
+ this.annotationSymbols[n].updateServerSideCoordinates();
}
};
@@ -669,9 +675,6 @@ define(
this.text.attr("text", this.name);
}
this.participantName = this.text.attr("text");
- // Store the server side co-ord, required for moving symbol
- // when other lane is minimized.
- this.updateServerSideCoordinates();
};
/**
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 15e2fc2..5b805b2 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
@@ -155,7 +155,9 @@ define(
Symbol.prototype.updateServerSideCoordinates = function() {
this.serverSideCoordinates = {
x : this.x,
- y : this.y
+ y : this.y,
+ width : this.width,
+ height :this.height
};
};
@@ -947,6 +949,9 @@ define(
Symbol.prototype.refresh = function() {
this.refreshFromModelElement();
this.refreshCommentPrimitives();
+ // Store the server side co-ord, required for moving symbol
+ // when other lane is minimized.
+ this.updateServerSideCoordinates();
this.recalculateBoundingBox();
this.adjustGeometry();
// Reroute connections in case the connection has moved