Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:56:29 -0400 (Tue, 29 Jul 2008)
New Revision: 9395
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/BaseNodeWrapper.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/StartStateWrapper.java
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/SuperStateWrapper.java
Log:
remove BaseNodeWrapper; make node wrappers extend DefaultNodeWrapper
Deleted:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/BaseNodeWrapper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/BaseNodeWrapper.java 2008-07-29
13:55:37 UTC (rev 9394)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/BaseNodeWrapper.java 2008-07-29
13:56:29 UTC (rev 9395)
@@ -1,60 +0,0 @@
-package org.jboss.tools.flow.jpdl4.graph.wrapper;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.jboss.tools.flow.common.core.Node;
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
-import org.jboss.tools.flow.editor.core.AbstractNodeWrapper;
-import org.jboss.tools.flow.editor.core.NodeWrapper;
-
-public abstract class BaseNodeWrapper extends AbstractNodeWrapper {
-
- public void setNode(Node node) {
- setElement(node);
- }
-
- public Node getNode() {
- return (Node) getElement();
- }
-
- public String getId() {
- long id = getNode().getId();
- return id == -1 ? null : getNode().getId() + "";
- }
-
- public String getName() {
- return getNode().getName();
- }
-
- public void internalSetName(String name) {
- getNode().setName(name);
- notifyListeners(CHANGE_VISUAL);
- }
-
- protected void internalSetConstraint(Rectangle constraint) {
- Node node = getNode();
- node.setMetaData("x", constraint.x);
- node.setMetaData("y", constraint.y);
- node.setMetaData("width", constraint.width);
- node.setMetaData("height", constraint.height);
- }
-
- public Rectangle internalGetConstraint() {
- Node node = getNode();
- Integer x = (Integer) node.getMetaData("x");
- Integer y = (Integer) node.getMetaData("y");
- Integer width = (Integer) node.getMetaData("width");
- Integer height = (Integer) node.getMetaData("height");
- return new Rectangle(x == null ? 0 : x, y == null ? 0 : y,
- width == null ? -1 : width, height == null ? -1 : height);
- }
-
- public boolean acceptsIncomingConnection(
- AbstractConnectionWrapper connection, NodeWrapper source) {
- return true;
- }
-
- public boolean acceptsOutgoingConnection(
- AbstractConnectionWrapper connection, NodeWrapper target) {
- return true;
- }
-}
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-07-29
13:55:37 UTC (rev 9394)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/EndStateWrapper.java 2008-07-29
13:56:29 UTC (rev 9395)
@@ -1,10 +1,11 @@
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.jpdl4.core.EndState;
-public class EndStateWrapper extends BaseNodeWrapper {
+public class EndStateWrapper extends DefaultNodeWrapper {
public EndStateWrapper() {
setElement(new EndState());
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-07-29
13:55:37 UTC (rev 9394)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StartStateWrapper.java 2008-07-29
13:56:29 UTC (rev 9395)
@@ -1,10 +1,11 @@
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.jpdl4.core.StartState;
-public class StartStateWrapper extends BaseNodeWrapper {
+public class StartStateWrapper extends DefaultNodeWrapper {
private static final long serialVersionUID = 1L;
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-07-29
13:55:37 UTC (rev 9394)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StateWrapper.java 2008-07-29
13:56:29 UTC (rev 9395)
@@ -1,8 +1,9 @@
package org.jboss.tools.flow.jpdl4.graph.wrapper;
+import org.jboss.tools.flow.editor.core.DefaultNodeWrapper;
import org.jboss.tools.flow.jpdl4.core.State;
-public class StateWrapper extends BaseNodeWrapper {
+public class StateWrapper extends DefaultNodeWrapper {
public StateWrapper() {
setElement(new State());
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java 2008-07-29
13:55:37 UTC (rev 9394)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java 2008-07-29
13:56:29 UTC (rev 9395)
@@ -1,10 +1,11 @@
package org.jboss.tools.flow.jpdl4.graph.wrapper;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.jboss.tools.flow.common.core.Container;
import org.jboss.tools.flow.common.core.Node;
-import org.jboss.tools.flow.common.core.NodeContainer;
import org.jboss.tools.flow.editor.core.AbstractContainerWrapper;
import org.jboss.tools.flow.editor.core.ContainerWrapper;
+import org.jboss.tools.flow.editor.core.DefaultNodeWrapper;
import org.jboss.tools.flow.editor.core.NodeWrapper;
import org.jboss.tools.flow.jpdl4.core.Process;
import org.jboss.tools.flow.jpdl4.core.StartState;
@@ -32,7 +33,7 @@
}
protected void internalAddElement(NodeWrapper element) {
- Node node = ((BaseNodeWrapper) element).getNode();
+ Node node = (Node)element.getElement();
long id = 0;
for (Node n: getProcess().getNodes()) {
if (n.getId() > id) {
@@ -40,11 +41,11 @@
}
}
node.setId(++id);
- ((NodeContainer)getParent().getElement()).addNode(node);
+ ((Container)getParent().getElement()).addNode(node);
}
protected void internalRemoveElement(NodeWrapper element) {
- getProcess().removeNode(((BaseNodeWrapper) element).getNode());
+ getProcess().removeNode((Node)element.getElement());
}
protected Rectangle internalGetConstraint() {
Show replies by date