summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-10 03:37:42 (EDT)
committer Stephan Born2012-09-10 03:37:42 (EDT)
commit2377c8526e3d953262432290c387a6c979b35155 (patch)
treeb62c7cdf59b312edd2b0e236fbd8a9f39d1ebdfe
parent2ddff12823d2dbbf4cd2632ca6f16f2b4b93a558 (diff)
downloadorg.eclipse.stardust.ui.web-2377c8526e3d953262432290c387a6c979b35155.zip
org.eclipse.stardust.ui.web-2377c8526e3d953262432290c387a6c979b35155.tar.gz
org.eclipse.stardust.ui.web-2377c8526e3d953262432290c387a6c979b35155.tar.bz2
CRNT-26000
1)Added code to check nos of connections for EventSymbol in m_eventSymbol.js and used in validateAnchorPoint in m_connection.js git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@59032 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js13
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js47
2 files changed, 30 insertions, 30 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 e5bb08a..3d60913 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
@@ -1352,15 +1352,14 @@ define(
this.removePrimitives();
this.removeFlyOutMenu();
this.removeProximitySensor();
- m_utils.removeItemFromArray(
- this.diagram.currentSelection, this);
- m_utils.removeItemFromArray(
- this.diagram.connections, this);
+ m_utils.removeItemFromArray(this.diagram.currentSelection,
+ this);
+ m_utils.removeItemFromArray(this.diagram.connections, this);
// Remove this connection from FROM and TO Symbol's
// connection array
m_utils.removeItemFromArray(
this.fromAnchorPoint.symbol.connections, this);
- if(this.toAnchorPoint.symbol){
+ if (this.toAnchorPoint.symbol) {
m_utils.removeItemFromArray(
this.toAnchorPoint.symbol.connections, this);
}
@@ -1443,7 +1442,7 @@ define(
.showErrorMessage("Events can be connected only to activities and gateways.");
return false;
}
- else if (fromAnchorPoint.symbol.connections.length > 1) {
+ else if (!fromAnchorPoint.symbol.validateCreateConnection()) {
// Start Event can have only one OUT connection
m_messageDisplay
.showErrorMessage("No further connection allowed for this Event.");
@@ -1471,7 +1470,7 @@ define(
m_messageDisplay
.showErrorMessage("Only out sequence flow connections are allowed on Start Events.");
return false;
- } else if (toAnchorPoint.symbol.connections.length > 1) {
+ } else if (!toAnchorPoint.symbol.validateCreateConnection()) {
// End Event can have only one IN connection
m_messageDisplay
.showErrorMessage("No further connection allowed for this Event.");
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 2b4c631..da2ec4c 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
@@ -3,7 +3,7 @@
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors: SunGard CSA LLC - initial API and implementation and/or initial
* documentation
******************************************************************************/
@@ -50,7 +50,7 @@ define(
};
/**
- *
+ *
*/
function EventSymbol() {
var symbol = m_symbol.createSymbol();
@@ -85,14 +85,14 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.toString = function() {
return "Lightdust.EventSymbol";
};
/**
- *
+ *
*/
EventSymbol.prototype.initializeFromJson = function(lane) {
m_utils.inheritMethods(this.modelElement.prototype,
@@ -112,7 +112,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.createTransferObject = function() {
var transferObject = {};
@@ -130,7 +130,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.getPath = function(withId) {
var path = "/models/" + this.diagram.model.id
@@ -145,7 +145,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.createPrimitives = function() {
this.circle = m_canvasManager.drawCircle(this.x
@@ -180,13 +180,13 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.initializeEventHandling = function() {
};
/**
- *
+ *
*/
EventSymbol.prototype.refreshFromModelElement = function() {
if (this.modelElement.eventType == m_constants.START_EVENT_TYPE) {
@@ -201,7 +201,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.createFlyOutMenu = function() {
// For stop event, right menu will be empty.
@@ -236,7 +236,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.highlight = function() {
this.circle.attr({
@@ -245,7 +245,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.dehighlight = function() {
this.circle.attr({
@@ -254,7 +254,7 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.adjustPrimitives = function(dX, dY) {
this.circle.animate({
@@ -270,7 +270,7 @@ define(
* m_constants.EVENT_ICON_WIDTH
}, this.diagram.animationDelay,
this.diagram.animationEasing);
-
+
if (this.diagram.symbolGlow
&& this.lastModifyingUser != null) {
if (this.glow) {
@@ -286,17 +286,18 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.recalculateBoundingBox = function() {
// Noting to be done here
};
/**
- *
+ *
*/
EventSymbol.prototype.validateCreateConnection = function() {
- if (this.connections.length > 0) {
+ if (this.connections.length > 0
+ && this.connections[0].oid > 0) {
m_messageDisplay
.showMessage("No further connection allowed for this Event.");
@@ -307,14 +308,14 @@ define(
};
/**
- *
+ *
*/
EventSymbol.prototype.onComplete = function() {
this.onParentSymbolChange();
};
/*
- *
+ *
*/
EventSymbol.prototype.onParentSymbolChange = function() {
if (this.modelElement.eventType == m_constants.START_EVENT_TYPE
@@ -328,7 +329,7 @@ define(
}
/**
- *
+ *
*/
function EventSymbol_connectToClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -336,7 +337,7 @@ define(
}
/**
- *
+ *
*/
function EventSymbol_connectToGatewayClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -344,7 +345,7 @@ define(
}
/**
- *
+ *
*/
function EventSymbol_connectToActivityClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -352,7 +353,7 @@ define(
}
/**
- *
+ *
*/
function EventSymbol_removeClosure() {
this.auxiliaryProperties.callbackScope