Author: koen.aers(a)jboss.com
Date: 2008-08-05 11:42:25 -0400 (Tue, 05 Aug 2008)
New Revision: 9524
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/EndStateAcceptsOutgoingConnectionStrategy.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/StartStateAcceptsIncomingConnectionStrategy.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/EndStateWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/ProcessWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StartStateWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StateWrapper.java
Log:
add support for pluggable strategy for nodes to accept incoming and outgoing connections
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/EndStateAcceptsOutgoingConnectionStrategy.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/EndStateAcceptsOutgoingConnectionStrategy.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/EndStateAcceptsOutgoingConnectionStrategy.java 2008-08-05
15:42:25 UTC (rev 9524)
@@ -0,0 +1,16 @@
+package org.jboss.tools.flow.jpdl4.graph.strategy;
+
+import org.jboss.tools.flow.common.core.Connection;
+import org.jboss.tools.flow.common.core.Node;
+import org.jboss.tools.flow.editor.strategy.AcceptsOutgoingConnectionStrategy;
+
+public class EndStateAcceptsOutgoingConnectionStrategy implements
AcceptsOutgoingConnectionStrategy {
+
+ public boolean acceptsOutgoingConnection(Connection connection, Node source) {
+ return false;
+ }
+
+ public void setNode(Node node) {
+ }
+
+}
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/StartStateAcceptsIncomingConnectionStrategy.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/StartStateAcceptsIncomingConnectionStrategy.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/strategy/StartStateAcceptsIncomingConnectionStrategy.java 2008-08-05
15:42:25 UTC (rev 9524)
@@ -0,0 +1,16 @@
+package org.jboss.tools.flow.jpdl4.graph.strategy;
+
+import org.jboss.tools.flow.common.core.Connection;
+import org.jboss.tools.flow.common.core.Node;
+import org.jboss.tools.flow.editor.strategy.AcceptsIncomingConnectionStrategy;
+
+public class StartStateAcceptsIncomingConnectionStrategy implements
AcceptsIncomingConnectionStrategy {
+
+ public boolean acceptsIncomingConnection(Connection connection, Node source) {
+ return false;
+ }
+
+ public void setNode(Node node) {
+ }
+
+}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/EndStateWrapper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/EndStateWrapper.java 2008-08-05
15:41:43 UTC (rev 9523)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/EndStateWrapper.java 2008-08-05
15:42:25 UTC (rev 9524)
@@ -1,22 +1,19 @@
package org.jboss.tools.flow.jpdl4.graph.wrapper;
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
import org.jboss.tools.flow.editor.core.DefaultNodeWrapper;
-import org.jboss.tools.flow.editor.core.NodeWrapper;
+import org.jboss.tools.flow.editor.strategy.AcceptsOutgoingConnectionStrategy;
import org.jboss.tools.flow.jpdl4.core.EndState;
+import
org.jboss.tools.flow.jpdl4.graph.strategy.EndStateAcceptsOutgoingConnectionStrategy;
public class EndStateWrapper extends DefaultNodeWrapper {
public EndStateWrapper() {
- setElement(new EndState());
+ EndState element = new EndState();
+ setElement(element);
setName("End");
+ AcceptsOutgoingConnectionStrategy strategy = new
EndStateAcceptsOutgoingConnectionStrategy();
+ strategy.setNode(element);
+ setAcceptsOutgoingConnectionStrategy(strategy);
}
- public EndState getEndState() {
- return (EndState) getElement();
- }
-
- public boolean acceptsOutgoingConnection(AbstractConnectionWrapper connection,
NodeWrapper target) {
- return false;
- }
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/ProcessWrapper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/ProcessWrapper.java 2008-08-05
15:41:43 UTC (rev 9523)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/ProcessWrapper.java 2008-08-05
15:42:25 UTC (rev 9524)
@@ -7,9 +7,11 @@
public class ProcessWrapper extends DefaultFlowWrapper {
public ProcessWrapper() {
- setElement(new Process());
+ Process process = new Process();
+ setElement(process);
ProcessAcceptsElementStrategy acceptsElementStrategy = new
ProcessAcceptsElementStrategy();
- acceptsElementStrategy.setContainer((Process)getElement());
+ acceptsElementStrategy.setContainer(process);
+ setAcceptsElementStrategy(acceptsElementStrategy);
}
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StartStateWrapper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StartStateWrapper.java 2008-08-05
15:41:43 UTC (rev 9523)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StartStateWrapper.java 2008-08-05
15:42:25 UTC (rev 9524)
@@ -1,23 +1,19 @@
package org.jboss.tools.flow.jpdl4.graph.wrapper;
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
import org.jboss.tools.flow.editor.core.DefaultNodeWrapper;
-import org.jboss.tools.flow.editor.core.NodeWrapper;
+import org.jboss.tools.flow.editor.strategy.AcceptsIncomingConnectionStrategy;
import org.jboss.tools.flow.jpdl4.core.StartState;
+import
org.jboss.tools.flow.jpdl4.graph.strategy.StartStateAcceptsIncomingConnectionStrategy;
public class StartStateWrapper extends DefaultNodeWrapper {
public StartStateWrapper() {
- setElement(new StartState());
+ StartState element = new StartState();
+ setElement(element);
setName("Start");
+ AcceptsIncomingConnectionStrategy strategy = new
StartStateAcceptsIncomingConnectionStrategy();
+ strategy.setNode(element);
+
}
- public StartState getStartState() {
- return (StartState) getElement();
- }
-
- public boolean acceptsIncomingConnection(AbstractConnectionWrapper connection,
NodeWrapper source) {
- return false;
- }
-
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StateWrapper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StateWrapper.java 2008-08-05
15:41:43 UTC (rev 9523)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StateWrapper.java 2008-08-05
15:42:25 UTC (rev 9524)
@@ -6,13 +6,9 @@
public class StateWrapper extends DefaultNodeWrapper {
public StateWrapper() {
- setElement(new State());
- getState().setName("State");
+ State element = new State();
+ setElement(element);
+ element.setName("State");
}
- public State getState() {
- return (State) getElement();
- }
-
-
}
Show replies by date