summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-22 07:53:09 (EDT)
committer Stephan Born2012-08-22 07:53:09 (EDT)
commit3778a21dbab6136e457632e25bf4e98032f5dd67 (patch)
tree94899299f24da8f3330ed5cefa191168ffecfbd1
parent3122f2543b2933470886467832cc37fb4615299b (diff)
downloadorg.eclipse.stardust.ui.web-3778a21dbab6136e457632e25bf4e98032f5dd67.zip
org.eclipse.stardust.ui.web-3778a21dbab6136e457632e25bf4e98032f5dd67.tar.gz
org.eclipse.stardust.ui.web-3778a21dbab6136e457632e25bf4e98032f5dd67.tar.bz2
CRNT-25835
1)Added optional sync attribute in createAndSubmitCreateCommand() in m_symbol.js for synchronous submit. 2)Added code to set currentConneciton modelElementOID on symbols click() fn. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58608 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js10
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js34
2 files changed, 32 insertions, 12 deletions
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 bd2660c..3ed5273 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
@@ -902,7 +902,7 @@ define(
for ( var n in this.separatorList) {
this.separatorList[n].moveBy(dX
* Math.abs(this.separatorDX), dY
- * Math.abs(this.separatorDY));
+ * Math.abs(this.separatorDY));
this.separatorList[n].parentSymbol.adjustToSymbolBoundaries();
}
}
@@ -1196,10 +1196,12 @@ define(
};
/**
- *
+ * sync : Synchronous AJAX call is made, if set(needed in
+ * scenario like creating symbol from flyout menu where symbol
+ * should be created before createConnection)
*/
- Diagram.prototype.placeNewSymbol = function(x, y) {
- this.newSymbol.complete();
+ Diagram.prototype.placeNewSymbol = function(x, y, sync) {
+ this.newSymbol.complete(sync);
// If symbol is not contained in swimlane, return
if (!this.newSymbol.isCompleted()) {
this.newSymbol = null;
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 94b9f96..5b3f4b8 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
@@ -218,11 +218,13 @@ define(
};
/**
- *
+ * sync : Synchronous AJAX call is made, if set(needed in
+ * scenario like creating symbol from flyout menu where symbol
+ * should be created before createConnection)
*/
- Symbol.prototype.complete = function() {
+ Symbol.prototype.complete = function(sync) {
this.completeNoTransfer(this);
- this.createAndSubmitCreateCommand();
+ this.createAndSubmitCreateCommand(sync);
if (this.requiresParentSymbol()) {
// TODO Needs to be called on create, otherwise it may
@@ -1130,12 +1132,21 @@ define(
if (!this.isCompleted()) {
// returns 'true' if symbol was placed at new loc. else
// false
- var status = this.diagram.placeNewSymbol(x
- - this.diagram.X_OFFSET, y
- - this.diagram.Y_OFFSET);
+ if (null != this.diagram.currentConnection) {
+ 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.complete();
+ this.diagram.currentConnection = null;
+ } else {
+ var status = this.diagram.placeNewSymbol(x
+ - this.diagram.X_OFFSET, y
+ - this.diagram.Y_OFFSET);
+ }
// If symbol is outside the swimlane, remove it
if (!status) {
- this.removePrimitives();
+ this.remove();
}
} else {
if (this.diagram.isInConnectionMode()) {
@@ -1248,18 +1259,25 @@ define(
m_commandsController.submitCommand(command);
}
- Symbol.prototype.createAndSubmitCreateCommand = function() {
+ /**
+ * sync : Synchronous AJAX call is made, if set(needed in
+ * scenario like creating symbol from flyout menu where symbol
+ * should be created before createConnection)
+ */
+ Symbol.prototype.createAndSubmitCreateCommand = function(sync) {
var commandType = this.getCommandIdForNode("create");
if (commandType) {
var command = m_command.createCreateNodeCommand(this
.getCommandIdForNode("create"),
this.diagram.model.id, this.parentSymbol.oid,
this.createTransferObject());
+ command.sync = sync ? true : false;
m_commandsController.submitCommand(command);
} else {
this.submitCreation();
}
}
+
/**
*
*/