summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-07-18 02:16:39 (EDT)
committer Manik Kishore2012-07-19 02:20:38 (EDT)
commitd8c7ce1e3fc770c7c88c5f31b0995366a37ac54c (patch)
treefac671b95b03ca27e48ff48aaff44f8018946e12
parentbf3a83147ea3a330a0d64fe22c0836cfc5f28897 (diff)
downloadorg.eclipse.stardust.ui.web-d8c7ce1e3fc770c7c88c5f31b0995366a37ac54c.zip
org.eclipse.stardust.ui.web-d8c7ce1e3fc770c7c88c5f31b0995366a37ac54c.tar.gz
org.eclipse.stardust.ui.web-d8c7ce1e3fc770c7c88c5f31b0995366a37ac54c.tar.bz2
Jira-ID: CRNT-25414
1)Change the change protocol function for create/delete/move in m_command.js to remove context and directly pass modelId 2)Made changes in m_swimlaneSymbol.js and m_symbol.js to adapt to new command. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@57727 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_command.js21
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js2
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js21
3 files changed, 17 insertions, 27 deletions
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_command.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_command.js
index d9693cb..a75c79b 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_command.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_command.js
@@ -55,26 +55,17 @@ define([ "m_utils", "m_constants", "m_user" ], function(m_utils, m_constants, m_
changes : changes
} ]);
},
- createMoveNodeSymbolCommand : function(baseUri, targetElement, newObject, context) {
- // TODO This code needs be removed as soon modelId passed instead of context (see createUpdateModelElementCommand)
- var modelId = context.diagram.model.id;
-
- return new ChangeDescriptor("nodeSymbol.move", modelId, [{oid: targetElement.oid, changes: newObject}]);
+ createMoveNodeSymbolCommand : function(modelId, oid, changes) {
+ return new ChangeDescriptor("nodeSymbol.move", modelId, [{oid: oid, changes: changes}]);
},
- createCreateNodeCommand : function(commandType, baseUri, targetElement, newObject, context) {
- // TODO This code needs be removed as soon modelId passed instead of context (see createUpdateModelElementCommand)
- var modelId = context.diagram.model.id;
-
- return new ChangeDescriptor(commandType, modelId, [{oid: targetElement.oid, changes: newObject}]);
+ createCreateNodeCommand : function(commandType, modelId, oid, changes) {
+ return new ChangeDescriptor(commandType, modelId, [{oid: oid, changes: changes}]);
},
createUpdateModelElementCommand : function(modelId, oid, changes) {
return new ChangeDescriptor("modelElement.update", modelId, [{oid: oid, changes: changes}]);
},
- createRemoveNodeCommand : function(commandType, baseUri, targetElement, newObject, context) {
- // TODO This code needs be removed as soon modelId passed instead of context (see createUpdateModelElementCommand)
- var modelId = context.diagram.model.id;
-
- return new ChangeDescriptor(commandType, modelId, [{oid: targetElement.oid, changes: newObject}]);
+ createRemoveNodeCommand : function(commandType, modelId, oid, changes) {
+ return new ChangeDescriptor(commandType, modelId, [{oid: oid, changes: changes}]);
},
// TODO Might be simple Request causing command to be broadcasted
createRequestJoinCommand : function(prospect) {
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 2bc1c40..4a78f13 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
@@ -823,7 +823,7 @@ define(
var newGeometry = {"x": this.x, "y" : this.y, "oid" : this.oid, "width" : this.width , "height" :this.height};
- var command = m_command.createMoveNodeSymbolCommand(this.getPath(true), {oid: this.oid}, newGeometry, this);
+ var command = m_command.createMoveNodeSymbolCommand(this.diagram.model.id, this.oid, newGeometry);
m_commandsController.submitCommand(command);
}
};
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 e192333..f871b51 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
@@ -913,8 +913,8 @@ define(
//this.diagram.submitUpdate();
var oldGeometry = {"x": this.dragStartX, "y" : this.dragStartY, "oid" : this.oid};
var newGeometry = {"x": this.x, "y" : this.y, "oid" : this.oid};
-
- var command = m_command.createMoveNodeSymbolCommand(this.getPath(true), {oid: this.oid}, newGeometry, this);
+
+ var command = m_command.createMoveNodeSymbolCommand(this.diagram.model.id, this.oid, newGeometry);
m_commandsController.submitCommand(command);
} else {
this.diagram.snapSymbol(this);
@@ -927,7 +927,7 @@ define(
var oldGeometry = {"x": this.dragStartX, "y" : this.dragStartY, "oid" : this.oid};
var newGeometry = {"x": this.x, "y" : this.y, "oid" : this.oid};
- var command = m_command.createMoveNodeSymbolCommand(this.getPath(true), {oid: this.oid}, newGeometry, this);
+ var command = m_command.createMoveNodeSymbolCommand(this.diagram.model.id, this.oid, newGeometry);
m_commandsController.submitCommand(command);
}
}
@@ -1184,8 +1184,8 @@ define(
*
*/
Symbol.prototype.createAndSubmitDeleteCommand = function() {
- var command = m_command.createRemoveNodeCommand(this.getCommandIdForNode("delete"), this.getPath(true),
- {oid : this.parentSymbol.oid}, this.createTransferObject(), this);
+ var command = m_command.createRemoveNodeCommand(this.getCommandIdForNode("delete"), this.diagram.model.id,
+ this.parentSymbol.oid, this.createTransferObject());
m_commandsController.submitCommand(command);
}
@@ -1193,10 +1193,9 @@ define(
var commandType = this.getCommandIdForNode("create");
if (commandType) {
var command = m_command.createCreateNodeCommand(this
- .getCommandIdForNode("create"), this
- .getPath(true), {
- oid : this.parentSymbol.oid
- }, this.createTransferObject(), this);
+ .getCommandIdForNode("create"),
+ this.diagram.model.id, this.parentSymbol.oid,
+ this.createTransferObject());
m_commandsController.submitCommand(command);
} else {
this.submitCreation();
@@ -1239,8 +1238,8 @@ define(
*/
Symbol.prototype.stretchStop = function() {
var newGeometry = {"x": this.x, "y" : this.y, "oid" : this.oid, "width" : this.width , "height" :this.height};
-
- var command = m_command.createMoveNodeSymbolCommand(this.getPath(true), {oid: this.oid}, newGeometry, this);
+
+ var command = m_command.createMoveNodeSymbolCommand(this.diagram.model.id, this.oid, newGeometry);
m_commandsController.submitCommand(command);
};