summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-07 10:35:57 (EDT)
committer Stephan Born2012-09-07 10:35:57 (EDT)
commit7dc6129390b4adff2a9f7a9422dc045f985c988a (patch)
tree40897c98e3910566c7ce9272ff62e228d8cc6971
parent26130bc85d204d7d56e7a6da2a3017ef15ad470e (diff)
downloadorg.eclipse.stardust.ui.web-7dc6129390b4adff2a9f7a9422dc045f985c988a.zip
org.eclipse.stardust.ui.web-7dc6129390b4adff2a9f7a9422dc045f985c988a.tar.gz
org.eclipse.stardust.ui.web-7dc6129390b4adff2a9f7a9422dc045f985c988a.tar.bz2
CRNT-26000
1)Added code to prevent creation of object from flyout menu if connection validation fails. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@59020 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js11
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js27
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js7
3 files changed, 31 insertions, 14 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 5cb1e7b..e5bb08a 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
@@ -1431,12 +1431,19 @@ define(
m_messageDisplay
.showErrorMessage("Only in sequence flow connections are allowed on End Events.");
return false;
- } else if (null != toAnchorPoint
+ }// Connection between Event and Data not supported
+ else if (null != toAnchorPoint
&& toAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
m_messageDisplay
.showErrorMessage("Data connections/associations are not supported for symbol.");
return false;
- }else if (fromAnchorPoint.symbol.connections.length > 1) {
+ }else if (null != toAnchorPoint
+ && toAnchorPoint.symbol.type == m_constants.EVENT_SYMBOL) {
+ m_messageDisplay
+ .showErrorMessage("Events can be connected only to activities and gateways.");
+ return false;
+ }
+ else if (fromAnchorPoint.symbol.connections.length > 1) {
// Start Event can have only one OUT connection
m_messageDisplay
.showErrorMessage("No further connection allowed for this Event.");
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 b6d82ed..235276b 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
@@ -1344,13 +1344,13 @@ define(
this.currentConnection = m_connection.createConnection(
this, symbol.anchorPoints[1]);
}
+ if(null!=this.currentConnection){
+ m_messageDisplay
+ .showMessage("Select second anchor point for connection.");
- m_messageDisplay
- .showMessage("Select second anchor point for connection.");
-
- // Set dummy anchor point
-
- this.currentConnection.setDummySecondAnchorPoint();
+ // Set dummy anchor point
+ this.currentConnection.setDummySecondAnchorPoint();
+ }
};
/**
@@ -1389,9 +1389,18 @@ define(
startSymbol.y + 200);
this.currentConnection = m_connection.createConnection(
this, startSymbol.anchorPoints[2]);
- this.currentConnection.prepare();
- this.currentConnection
- .setSecondAnchorPointNoComplete(this.newSymbol.anchorPoints[0]);
+ if (null != this.currentConnection
+ && this.currentConnection.validateAnchorPoint(
+ this.currentConnection.fromAnchorPoint,
+ this.newSymbol.anchorPoints[0])) {
+ this.currentConnection.prepare();
+ this.currentConnection
+ .setSecondAnchorPointNoComplete(this.newSymbol.anchorPoints[0]);
+ } else {
+ this.newSymbol.remove();
+ this.newSymbol = null;
+ this.currentConnection = null;
+ }
} else {
this.newSymbol.prepare(startSymbol.x + 200,
startSymbol.y);
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 a698b5f..a233541 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
@@ -1249,9 +1249,10 @@ define(
this.removeFlyOutMenu();
this.removeProximitySensor();
this.removeAnchorPoints();
-
- m_utils.removeItemFromArray(
- this.parentSymbol.containedSymbols, this);
+ if(this.parentSymbol){
+ m_utils.removeItemFromArray(
+ this.parentSymbol.containedSymbols, this);
+ }
m_utils.removeItemFromArray(this.diagram.symbols, this);
};