summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-23 01:29:54 (EDT)
committerStephan Born2012-08-23 01:29:54 (EDT)
commit31490983c829d838f40241461338fd6bc95f4e11 (patch)
tree14a5635fdbb975d6b830e2602eb6ed94a316eb84
parent25a2f18c4f277961c3d9fb0919964c0c1ecc03e4 (diff)
downloadorg.eclipse.stardust.ui.web-31490983c829d838f40241461338fd6bc95f4e11.zip
org.eclipse.stardust.ui.web-31490983c829d838f40241461338fd6bc95f4e11.tar.gz
org.eclipse.stardust.ui.web-31490983c829d838f40241461338fd6bc95f4e11.tar.bz2
CRNT-25577
1)Added code to update connections in processCommand in m_diagram.js 2)Added check in updateControlFlowConnection for FROM_ANCHOR_POINT_ORIENTATION_PROPERTY and TO_ANCHOR_POINT ORIENTATION json check. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58623 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java19
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js53
2 files changed, 63 insertions, 9 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
index e0b272e..a74e661 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
@@ -331,12 +331,19 @@ public abstract class ModelElementUnmarshaller
transition.setExpression(expression);
}
- controlFlowConnection.setSourceAnchor(mapAnchorOrientation(extractInt(
- controlFlowConnectionJson,
- ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY)));
- controlFlowConnection.setTargetAnchor(mapAnchorOrientation(extractInt(
- controlFlowConnectionJson,
- ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY)));
+ // While routing , anchor point orientation changes
+ if (controlFlowConnectionJson.has(ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY))
+ {
+ controlFlowConnection.setSourceAnchor(mapAnchorOrientation(extractInt(
+ controlFlowConnectionJson,
+ ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY)));
+ }
+ if (controlFlowConnectionJson.has(ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY))
+ {
+ controlFlowConnection.setTargetAnchor(mapAnchorOrientation(extractInt(
+ controlFlowConnectionJson,
+ ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY)));
+ }
}
/**
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 3ed5273..ea36de4 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
@@ -550,10 +550,10 @@ define(
Diagram.prototype.findConnection = function(conn) {
for ( var i = 0; i < this.connections.length; i++) {
- if (this.connections[i].oid == conn.oid) {
- return this.connections[i];
- } else if (this.connections[i].fromModelElementOid == conn.fromModelElementOid
+ if (this.connections[i].fromModelElementOid == conn.fromModelElementOid
&& this.connections[i].toModelElementOid == conn.toModelElementOid) {
+ // while adding a connection, to update connection
+ // connection is searched using modelELementOid
return this.connections[i];
}
}
@@ -562,6 +562,36 @@ define(
};
/**
+ *
+ */
+ Diagram.prototype.findConnectionByGuid = function(guid) {
+
+ if (null != guid) {
+ for ( var i = 0; i < this.connections.length; i++) {
+ if (this.connections[i].oid == guid) {
+ return this.connections[i];
+ }
+ }
+ }
+ return null;
+ };
+
+ /**
+ *
+ */
+ Diagram.prototype.findConnectionByModelElementGuid = function(guid) {
+
+ if (null != guid) {
+ for ( var i = 0; i < this.connections.length; i++) {
+ if (this.connections[i].modelElement.oid == guid) {
+ return this.connections[i];
+ }
+ }
+ }
+ return null;
+ };
+
+ /**
* The diagram serves as a dispatcher for all changes on model
* elements underneath the diagram process.
*/
@@ -630,6 +660,23 @@ define(
// TODO - update properties panel on
// modelElement change
}
+
+ // Check if connection is modified
+ var conn = this
+ .findConnectionByGuid(obj.changes.modified[i].oid);
+
+ if (null != conn) {
+ conn.applyChanges(obj.changes.modified[i]);
+ conn.refresh();
+ } else {
+ conn = this
+ .findConnectionByModelElementGuid(obj.changes.modified[i].oid);
+ if (null != conn) {
+ m_utils.inheritFields(conn.modelElement,
+ obj.changes.modified[i]);
+ conn.refresh();
+ }
+ }
}
// Delete removed elements