summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-04 05:29:04 (EDT)
committerStephan Born2012-09-04 05:29:04 (EDT)
commit638e7d875ded4a2b637a879cb57d19209a8dc14a (patch)
tree629ab0dd870d4f02eb18d3daf5b3d784e97f4f6c
parentcfaf87a438dd0050df395cded6cace4b6639c699 (diff)
downloadorg.eclipse.stardust.ui.web-638e7d875ded4a2b637a879cb57d19209a8dc14a.zip
org.eclipse.stardust.ui.web-638e7d875ded4a2b637a879cb57d19209a8dc14a.tar.gz
org.eclipse.stardust.ui.web-638e7d875ded4a2b637a879cb57d19209a8dc14a.tar.bz2
CRNT-25997
1)Added check in m_symbol.js, m_swimlaneSymbol.js if connection_mode Symbol move is not allowed 2)Added code in m_diagram.js onclick to undo createConnection on click in canvas in connection mode. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58893 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js5
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js28
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js132
3 files changed, 91 insertions, 74 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 7df7f45..2940557 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
@@ -1274,6 +1274,11 @@ define(
} else if (this.mode == this.NORMAL_MODE) {
this.clearCurrentSelection();
m_messageDisplay.clear();
+ } else if (this.mode == this.CONNECTION_MODE
+ && this.currentConnection != null) {
+ this.currentConnection.remove();
+ this.currentConnection = null;
+ this.mode = this.NORMAL_MODE;
}
};
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 f3c7173..c7c13b9 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
@@ -745,38 +745,46 @@ define(
* Temporarily commented out as left stretch is disabled
*/
SwimlaneSymbol.prototype.stretchLeft = function(dX, dY, x, y) {
- this.width = this.preDragState.width - dX;
- this.x = this.preDragState.x + dX;
+ if (this.diagram.mode == this.diagram.NORMAL_MODE) {
+ this.width = this.preDragState.width - dX;
+ this.x = this.preDragState.x + dX;
- this.adjustGeometry();
+ this.adjustGeometry();
+ }
};
/**
* Temporarily commented out as top stretch is disabled
*/
SwimlaneSymbol.prototype.stretchTop = function(dX, dY, x, y) {
- this.height = this.preDragState.height - dY;
- this.y = this.preDragState.y + dY;
+ if (this.diagram.mode == this.diagram.NORMAL_MODE) {
+ this.height = this.preDragState.height - dY;
+ this.y = this.preDragState.y + dY;
- this.adjustGeometry();
+ this.adjustGeometry();
+ }
};
/**
*
*/
SwimlaneSymbol.prototype.stretchRight = function(dX, dY, x, y) {
- this.width = this.preDragState.width + dX;
+ if (this.diagram.mode == this.diagram.NORMAL_MODE) {
+ this.width = this.preDragState.width + dX;
- this.adjustGeometry();
+ this.adjustGeometry();
+ }
};
/**
*
*/
SwimlaneSymbol.prototype.stretchBottom = function(dX, dY, x, y) {
- this.height = this.preDragState.height + dY;
+ if (this.diagram.mode == this.diagram.NORMAL_MODE) {
+ this.height = this.preDragState.height + dY;
- this.adjustGeometry();
+ this.adjustGeometry();
+ }
};
/**
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 ade6875..a698b5f 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
@@ -864,91 +864,70 @@ define(
*/
Symbol.prototype.dragStart = function() {
// TODO hide for all selected
+ if (this.diagram.mode == this.diagram.NORMAL_MODE) {
+ this.hideProximitySensor();
- this.hideProximitySensor();
-
- if (!this.selected) {
- // deselect other symbols before drag
- this.diagram.deselectCurrentSelection();
- this.diagram.currentSelection = [];
- this.select();
- }
+ if (!this.selected) {
+ // deselect other symbols before drag
+ this.diagram.deselectCurrentSelection();
+ this.diagram.currentSelection = [];
+ this.select();
+ }
- // Remember drag start position
+ // Remember drag start position
- this.dragStartX = this.x;
- this.dragStartY = this.y;
+ this.dragStartX = this.x;
+ this.dragStartY = this.y;
+ }
};
/**
*
*/
Symbol.prototype.dragStop = function() {
- this.showProximitySensor();
-
+ if (this.diagram.mode == this.diagram.NORMAL_MODE) {
+ this.showProximitySensor();
// Only process if symbol has been moved at all
+ if (this.x != this.dragStartX
+ || this.y != this.dragStartY) {
+ if (this.requiresParentSymbol()) {
+ var newParentSymbol = this.diagram.poolSymbol
+ .findContainerSymbol(this.getXCenter(),
+ this.getYCenter());
- if (this.x != this.dragStartX || this.y != this.dragStartY) {
- if (this.requiresParentSymbol()) {
- var newParentSymbol = this.diagram.poolSymbol
- .findContainerSymbol(this.getXCenter(),
- this.getYCenter());
-
- if (newParentSymbol == null) {
- this.move(this.dragStartX, this.dragStartY);
+ if (newParentSymbol == null) {
+ this.move(this.dragStartX, this.dragStartY);
- m_messageDisplay
- .showErrorMessage("Symbol is not contained in Swimlane. Reverting drag.");
+ m_messageDisplay
+ .showErrorMessage("Symbol is not contained in Swimlane. Reverting drag.");
- return;
- }
-
- if (newParentSymbol != this.parentSymbol) {
- m_utils.removeItemFromArray(
- this.parentSymbol.containedSymbols,
- this);
+ return;
+ }
- this.parentSymbol = newParentSymbol;
+ if (newParentSymbol != this.parentSymbol) {
+ m_utils.removeItemFromArray(
+ this.parentSymbol.containedSymbols,
+ this);
- this.parentSymbol.containedSymbols.push(this);
+ this.parentSymbol = newParentSymbol;
- this.parentSymbolId = newParentSymbol.id;
+ this.parentSymbol.containedSymbols
+ .push(this);
- this.onParentSymbolChange();
- }
+ this.parentSymbolId = newParentSymbol.id;
- this.diagram.snapSymbol(this);
- this.parentSymbol.adjustToSymbolBoundaries(this.x,
- this.y);
-
- // Other parts of the diagram may have been affected
- // - update the diagram
-
- // 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.diagram.model.id, this.oid,
- newGeometry);
- m_commandsController.submitCommand(command);
- } else {
- this.diagram.snapSymbol(this);
+ this.onParentSymbolChange();
+ }
- // TODO Put in method
+ this.diagram.snapSymbol(this);
+ this.parentSymbol.adjustToSymbolBoundaries(
+ this.x, this.y);
- if (this.isCompleted() != null) {
- // this.submitUpdate();
+ // Other parts of the diagram may have been
+ // affected
+ // - update the diagram
+ // this.diagram.submitUpdate();
var oldGeometry = {
"x" : this.dragStartX,
"y" : this.dragStartY,
@@ -965,6 +944,31 @@ define(
this.diagram.model.id,
this.oid, newGeometry);
m_commandsController.submitCommand(command);
+ } else {
+ this.diagram.snapSymbol(this);
+
+ // TODO Put in method
+
+ if (this.isCompleted() != null) {
+ // this.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.diagram.model.id,
+ this.oid, newGeometry);
+ m_commandsController.submitCommand(command);
+ }
}
}
}