| author | Sidharth Singh | 2012-08-29 09:38:23 (EDT) |
|---|---|---|
| committer | Stephan Born | 2012-08-29 09:38:23 (EDT) |
| commit | c23ac234c17706a1494972c4e750ee485ae5bea3 (patch) (side-by-side diff) | |
| tree | a03693b0440004d925f95f6fca782a4ab59b3075 | |
| parent | ebda0fb5a5735f3862766fe6b1c8fc64166d960a (diff) | |
| download | org.eclipse.stardust.ui.web-c23ac234c17706a1494972c4e750ee485ae5bea3.zip org.eclipse.stardust.ui.web-c23ac234c17706a1494972c4e750ee485ae5bea3.tar.gz org.eclipse.stardust.ui.web-c23ac234c17706a1494972c4e750ee485ae5bea3.tar.bz2 | |
CRNT-25990
1)Added method in m_connection.js updateAnchorPointForGateway to change anchorPoint for gateway when connection created from flyoutMenu.
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58768 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
3 files changed, 27 insertions, 0 deletions
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js index 7fa3918..c906db5 100644 --- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js +++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js @@ -266,6 +266,30 @@ define( }
/**
+ * when connection is created from Flyout Menu, anchor points
+ * needs to be moved to 6 O’clock or 3 O'clock
+ */
+ Connection.prototype.updateAnchorPointForGateway = function() {
+ var orientation = null;
+ if (this.fromAnchorPoint.symbol.type == m_constants.GATEWAY_SYMBOL) {
+ var startSymbol = this.fromAnchorPoint.symbol;
+ var targetSymbol = this.toAnchorPoint.symbol;
+ if (startSymbol.x > targetSymbol.x + targetSymbol.width) {
+ // Start Symbol is at right, show arrow at left
+ orientation = 3;
+ } else if (startSymbol.x + startSymbol.width < targetSymbol.x) {
+ // Start Symbol is at left, show arrow at right
+ orientation = 1;
+ } else {
+ // default orientation is SOUTH for gateway
+ orientation = 2;
+ }
+ this
+ .setFirstAnchorPoint(startSymbol.anchorPoints[orientation]);
+ }
+ };
+
+ /**
*
*/
Connection.prototype.setFirstAnchorPoint = function(anchorPoint) {
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js index 81c0719..2dad6ea 100644 --- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js +++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js @@ -1254,6 +1254,7 @@ define( var status = this.placeNewSymbol(x - this.X_OFFSET,
y - this.Y_OFFSET, true);
this.currentConnection.toModelElementOid = this.lastSymbol.oid;
+ this.currentConnection.updateAnchorPointForGateway();
this.currentConnection.complete();
this.currentConnection = null;
} else {
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 2a1434f..bc6c2a6 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 @@ -1139,7 +1139,9 @@ define( var status = this.diagram.placeNewSymbol(x
- this.diagram.X_OFFSET, y
- this.diagram.Y_OFFSET, true);
+
this.diagram.currentConnection.toModelElementOid = this.oid;
+ this.diagram.currentConnection.updateAnchorPointForGateway();
this.diagram.currentConnection.complete();
this.diagram.currentConnection = null;
} else {
|

