JBoss Tools SVN: r9398 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 10:30:04 -0400 (Tue, 29 Jul 2008)
New Revision: 9398
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/StartStateWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java
Log:
DefaultNodeWrapper and DefaultFlowWrapper
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-07-29 14:28:37 UTC (rev 9397)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/ProcessWrapper.java 2008-07-29 14:30:04 UTC (rev 9398)
@@ -1,12 +1,11 @@
package org.jboss.tools.flow.jpdl4.graph.wrapper;
-import org.jboss.tools.flow.common.core.Node;
-import org.jboss.tools.flow.editor.core.AbstractRootWrapper;
+import org.jboss.tools.flow.editor.core.DefaultFlowWrapper;
import org.jboss.tools.flow.editor.core.NodeWrapper;
import org.jboss.tools.flow.jpdl4.core.Process;
import org.jboss.tools.flow.jpdl4.core.StartState;
-public class ProcessWrapper extends AbstractRootWrapper {
+public class ProcessWrapper extends DefaultFlowWrapper {
public ProcessWrapper() {
setElement(new Process());
@@ -16,42 +15,6 @@
return (Process) getElement();
}
- public String getName() {
- return getProcess().getName();
- }
-
- public void setName(String name) {
- getProcess().setName(name);
- }
-
- public Integer getRouterLayout() {
- Integer routerLayout = (Integer) getProcess().getMetaData("routerLayout");
- if (routerLayout == null) {
- return ROUTER_LAYOUT_MANUAL;
- }
- return routerLayout;
- }
-
- public void internalSetRouterLayout(Integer routerLayout) {
- getProcess().setMetaData("routerLayout", routerLayout);
- }
-
- protected void internalAddElement(NodeWrapper element) {
- Node node = (Node)element.getElement();
- long id = 0;
- for (Node n: getProcess().getNodes()) {
- if (n.getId() > id) {
- id = n.getId();
- }
- }
- node.setId(++id);
- getProcess().addNode(node);
- }
-
- protected void internalRemoveElement(NodeWrapper element) {
- getProcess().removeNode((Node)element.getElement());
- }
-
public boolean acceptsElement(NodeWrapper element) {
if (element.getElement() instanceof StartState) {
return getProcess().getStartState() == null;
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 14:28:37 UTC (rev 9397)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/StartStateWrapper.java 2008-07-29 14:30:04 UTC (rev 9398)
@@ -7,8 +7,6 @@
public class StartStateWrapper extends DefaultNodeWrapper {
- private static final long serialVersionUID = 1L;
-
public StartStateWrapper() {
setElement(new StartState());
setName("Start");
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 14:28:37 UTC (rev 9397)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java 2008-07-29 14:30:04 UTC (rev 9398)
@@ -5,7 +5,6 @@
import org.jboss.tools.flow.common.core.Node;
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;
16 years, 5 months
JBoss Tools SVN: r9397 - trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 10:28:37 -0400 (Tue, 29 Jul 2008)
New Revision: 9397
Modified:
trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ProcessWrapper.java
Log:
AbstractRootWrapper -> AbstractFlowWrapper
Modified: trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ProcessWrapper.java
===================================================================
--- trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ProcessWrapper.java 2008-07-29 14:26:35 UTC (rev 9396)
+++ trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ProcessWrapper.java 2008-07-29 14:28:37 UTC (rev 9397)
@@ -18,7 +18,7 @@
import org.drools.ruleflow.core.RuleFlowProcess;
import org.drools.workflow.core.Node;
-import org.jboss.tools.flow.editor.core.AbstractRootWrapper;
+import org.jboss.tools.flow.editor.core.AbstractFlowWrapper;
import org.jboss.tools.flow.editor.core.NodeWrapper;
/**
@@ -26,7 +26,7 @@
*
* @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
*/
-public class ProcessWrapper extends AbstractRootWrapper {
+public class ProcessWrapper extends AbstractFlowWrapper {
private static final long serialVersionUID = 400L;
16 years, 5 months
JBoss Tools SVN: r9396 - in trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor: command and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 10:26:35 -0400 (Tue, 29 Jul 2008)
New Revision: 9396
Added:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultFlowWrapper.java
Removed:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/action/VerticalAutoLayoutAction.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/command/SplitConnectionCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/ContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/editpart/RootEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/policy/ConnectionEditPolicy.java
Log:
DefaultNodeWrapper and DefaultFlowWrapper
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/action/VerticalAutoLayoutAction.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/action/VerticalAutoLayoutAction.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/action/VerticalAutoLayoutAction.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -31,7 +31,7 @@
import org.eclipse.ui.actions.ActionDelegate;
import org.jboss.tools.flow.editor.GenericModelEditor;
import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
-import org.jboss.tools.flow.editor.core.AbstractRootWrapper;
+import org.jboss.tools.flow.editor.core.AbstractFlowWrapper;
import org.jboss.tools.flow.editor.core.NodeWrapper;
/**
@@ -60,7 +60,7 @@
for (Map.Entry<String, Node> entry: mapping.entrySet()) {
Node node = entry.getValue();
NodeWrapper nodeWrapper =
- ((AbstractRootWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey());
+ ((AbstractFlowWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey());
nodeWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
}
// TODO: implement changes as a command, so we can support undo
@@ -70,7 +70,7 @@
@SuppressWarnings("unchecked")
protected DirectedGraph createDirectedGraph(Map<String, Node> mapping) {
DirectedGraph graph = new DirectedGraph();
- AbstractRootWrapper processWrapper = (AbstractRootWrapper) ((GenericModelEditor) editor).getModel();
+ AbstractFlowWrapper processWrapper = (AbstractFlowWrapper) ((GenericModelEditor) editor).getModel();
for (NodeWrapper elementWrapper: processWrapper.getElements()) {
Node node = new Node();
Integer width = (Integer) elementWrapper.getConstraint().width;
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/command/SplitConnectionCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/command/SplitConnectionCommand.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/command/SplitConnectionCommand.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -18,7 +18,7 @@
import org.eclipse.gef.commands.Command;
import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
-import org.jboss.tools.flow.editor.core.AbstractRootWrapper;
+import org.jboss.tools.flow.editor.core.AbstractFlowWrapper;
import org.jboss.tools.flow.editor.core.NodeWrapper;
/**
@@ -28,7 +28,7 @@
*/
public class SplitConnectionCommand extends Command {
- private AbstractRootWrapper parent;
+ private AbstractFlowWrapper parent;
private NodeWrapper oldSource;
private NodeWrapper oldTarget;
private AbstractConnectionWrapper oldConnection;
@@ -53,7 +53,7 @@
secondConnection.connect(newElement, oldTarget);
}
- public void setParent(AbstractRootWrapper process) {
+ public void setParent(AbstractFlowWrapper process) {
if (process == null) {
throw new IllegalArgumentException("process is null");
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -50,7 +50,7 @@
return elements;
}
- public AbstractRootWrapper getProcessWrapper() {
+ public AbstractFlowWrapper getProcessWrapper() {
return getParent().getProcessWrapper();
}
Copied: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractFlowWrapper.java (from rev 9375, trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractFlowWrapper.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractFlowWrapper.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -0,0 +1,105 @@
+package org.jboss.tools.flow.editor.core;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A wrapper for a process element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class AbstractFlowWrapper extends AbstractWrapper implements ContainerWrapper {
+
+ public static final int CHANGE_ELEMENTS = 1;
+ public static final int CHANGE_VISUAL = 2;
+
+ public static final Integer ROUTER_LAYOUT_MANUAL = new Integer(0);
+ public static final Integer ROUTER_LAYOUT_MANHATTAN = new Integer(1);
+ public static final Integer ROUTER_LAYOUT_SHORTEST_PATH = new Integer(2);
+
+ private Map<String, NodeWrapper> elements = new HashMap<String, NodeWrapper>();
+ private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
+
+ public abstract Integer getRouterLayout();
+
+ public void setRouterLayout(Integer routerLayout) {
+ internalSetRouterLayout(routerLayout);
+ notifyListeners(CHANGE_VISUAL);
+ }
+
+ protected void internalSetRouterLayout(Integer routerLayout) {
+ }
+
+ public List<NodeWrapper> getElements() {
+ return Collections.unmodifiableList(
+ new ArrayList<NodeWrapper>(elements.values()));
+ }
+
+ public NodeWrapper getElement(String id) {
+ return (NodeWrapper) elements.get(id);
+ }
+
+ public void addElement(NodeWrapper element) {
+ if (!acceptsElement(element)) return;
+ internalAddElement(element);
+ localAddElement(element);
+ notifyListeners(CHANGE_ELEMENTS);
+ }
+
+ public void localAddElement(NodeWrapper element) {
+ elements.put(element.getId(), element);
+ }
+
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
+ protected abstract void internalAddElement(NodeWrapper element);
+
+ public void removeElement(NodeWrapper element) {
+ elements.remove(element.getId());
+ notifyListeners(CHANGE_ELEMENTS);
+ internalRemoveElement(element);
+ }
+
+ protected abstract void internalRemoveElement(NodeWrapper element);
+
+ public AbstractFlowWrapper getProcessWrapper() {
+ return this;
+ }
+
+ public void addListener(ModelListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(ModelListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void notifyListeners(int change) {
+ ModelEvent event = new ModelEvent(change);
+ for (ModelListener listener: listeners) {
+ listener.modelChanged(event);
+ }
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractFlowWrapper.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -1,105 +0,0 @@
-package org.jboss.tools.flow.editor.core;
-
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A wrapper for a process element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
- */
-public abstract class AbstractRootWrapper extends AbstractWrapper implements ContainerWrapper {
-
- public static final int CHANGE_ELEMENTS = 1;
- public static final int CHANGE_VISUAL = 2;
-
- public static final Integer ROUTER_LAYOUT_MANUAL = new Integer(0);
- public static final Integer ROUTER_LAYOUT_MANHATTAN = new Integer(1);
- public static final Integer ROUTER_LAYOUT_SHORTEST_PATH = new Integer(2);
-
- private Map<String, NodeWrapper> elements = new HashMap<String, NodeWrapper>();
- private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
-
- public abstract Integer getRouterLayout();
-
- public void setRouterLayout(Integer routerLayout) {
- internalSetRouterLayout(routerLayout);
- notifyListeners(CHANGE_VISUAL);
- }
-
- protected void internalSetRouterLayout(Integer routerLayout) {
- }
-
- public List<NodeWrapper> getElements() {
- return Collections.unmodifiableList(
- new ArrayList<NodeWrapper>(elements.values()));
- }
-
- public NodeWrapper getElement(String id) {
- return (NodeWrapper) elements.get(id);
- }
-
- public void addElement(NodeWrapper element) {
- if (!acceptsElement(element)) return;
- internalAddElement(element);
- localAddElement(element);
- notifyListeners(CHANGE_ELEMENTS);
- }
-
- public void localAddElement(NodeWrapper element) {
- elements.put(element.getId(), element);
- }
-
- public boolean acceptsElement(NodeWrapper element) {
- return true;
- }
-
- protected abstract void internalAddElement(NodeWrapper element);
-
- public void removeElement(NodeWrapper element) {
- elements.remove(element.getId());
- notifyListeners(CHANGE_ELEMENTS);
- internalRemoveElement(element);
- }
-
- protected abstract void internalRemoveElement(NodeWrapper element);
-
- public AbstractRootWrapper getProcessWrapper() {
- return this;
- }
-
- public void addListener(ModelListener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(ModelListener listener) {
- listeners.remove(listener);
- }
-
- public void notifyListeners(int change) {
- ModelEvent event = new ModelEvent(change);
- for (ModelListener listener: listeners) {
- listener.modelChanged(event);
- }
- }
-
-}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/ContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/ContainerWrapper.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/ContainerWrapper.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -28,7 +28,7 @@
List<NodeWrapper> getElements();
- AbstractRootWrapper getProcessWrapper();
+ AbstractFlowWrapper getProcessWrapper();
boolean acceptsElement(NodeWrapper element);
Added: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultFlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultFlowWrapper.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultFlowWrapper.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -0,0 +1,38 @@
+package org.jboss.tools.flow.editor.core;
+
+import org.jboss.tools.flow.common.core.Flow;
+import org.jboss.tools.flow.common.core.Node;
+import org.jboss.tools.flow.editor.core.AbstractFlowWrapper;
+import org.jboss.tools.flow.editor.core.NodeWrapper;
+
+public class DefaultFlowWrapper extends AbstractFlowWrapper {
+
+ public Integer getRouterLayout() {
+ Integer routerLayout = (Integer) ((Flow)getElement()).getMetaData("routerLayout");
+ if (routerLayout == null) {
+ return ROUTER_LAYOUT_MANUAL;
+ }
+ return routerLayout;
+ }
+
+ public void internalSetRouterLayout(Integer routerLayout) {
+ ((Flow)getElement()).setMetaData("routerLayout", routerLayout);
+ }
+
+ protected void internalAddElement(NodeWrapper element) {
+ Node node = (Node)element.getElement();
+ long id = 0;
+ for (Node n: ((Flow)getElement()).getNodes()) {
+ if (n.getId() > id) {
+ id = n.getId();
+ }
+ }
+ node.setId(++id);
+ ((Flow)getElement()).addNode(node);
+ }
+
+ protected void internalRemoveElement(NodeWrapper element) {
+ ((Flow)getElement()).removeNode((Node)element.getElement());
+ }
+
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/editpart/RootEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/editpart/RootEditPart.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/editpart/RootEditPart.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -36,7 +36,7 @@
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
import org.eclipse.swt.SWT;
-import org.jboss.tools.flow.editor.core.AbstractRootWrapper;
+import org.jboss.tools.flow.editor.core.AbstractFlowWrapper;
import org.jboss.tools.flow.editor.core.ModelEvent;
import org.jboss.tools.flow.editor.core.ModelListener;
import org.jboss.tools.flow.editor.core.NodeWrapper;
@@ -50,8 +50,8 @@
*/
public class RootEditPart extends AbstractGraphicalEditPart implements ModelListener {
- public AbstractRootWrapper getProcessWrapper() {
- return (AbstractRootWrapper) getModel();
+ public AbstractFlowWrapper getProcessWrapper() {
+ return (AbstractFlowWrapper) getModel();
}
protected IFigure createFigure() {
@@ -83,9 +83,9 @@
}
public void modelChanged(ModelEvent event) {
- if (event.getChange() == AbstractRootWrapper.CHANGE_ELEMENTS) {
+ if (event.getChange() == AbstractFlowWrapper.CHANGE_ELEMENTS) {
refreshChildren();
- } else if (event.getChange() == AbstractRootWrapper.CHANGE_VISUAL) {
+ } else if (event.getChange() == AbstractFlowWrapper.CHANGE_VISUAL) {
refreshVisuals();
}
}
@@ -108,11 +108,11 @@
layer.setAntialias(SWT.ON);
}
- if (getProcessWrapper().getRouterLayout().equals(AbstractRootWrapper.ROUTER_LAYOUT_MANUAL)) {
+ if (getProcessWrapper().getRouterLayout().equals(AbstractFlowWrapper.ROUTER_LAYOUT_MANUAL)) {
AutomaticRouter router = new FanRouter();
router.setNextRouter(new BendpointConnectionRouter());
layer.setConnectionRouter(router);
- } else if (getProcessWrapper().getRouterLayout().equals(AbstractRootWrapper.ROUTER_LAYOUT_MANHATTAN)) {
+ } else if (getProcessWrapper().getRouterLayout().equals(AbstractFlowWrapper.ROUTER_LAYOUT_MANHATTAN)) {
layer.setConnectionRouter(new ManhattanConnectionRouter());
} else {
layer.setConnectionRouter(new ShortestPathConnectionRouter(getFigure()));
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/policy/ConnectionEditPolicy.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/policy/ConnectionEditPolicy.java 2008-07-29 13:56:29 UTC (rev 9395)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/policy/ConnectionEditPolicy.java 2008-07-29 14:26:35 UTC (rev 9396)
@@ -25,7 +25,7 @@
import org.jboss.tools.flow.editor.command.DeleteConnectionCommand;
import org.jboss.tools.flow.editor.command.SplitConnectionCommand;
import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
-import org.jboss.tools.flow.editor.core.AbstractRootWrapper;
+import org.jboss.tools.flow.editor.core.AbstractFlowWrapper;
import org.jboss.tools.flow.editor.core.ConnectionFactory;
import org.jboss.tools.flow.editor.core.NodeWrapper;
import org.jboss.tools.flow.editor.editpart.ConnectionEditPart;
@@ -70,7 +70,7 @@
SplitConnectionCommand cmd = new SplitConnectionCommand();
cmd.setElementConnection(((AbstractConnectionWrapper) getHost().getModel()));
cmd.setNewSecondConnection(elementConnectionFactory.createElementConnection());
- cmd.setParent(((AbstractRootWrapper) ((ConnectionEditPart) getHost())
+ cmd.setParent(((AbstractFlowWrapper) ((ConnectionEditPart) getHost())
.getSource().getParent().getModel()));
cmd.setNewElement(((NodeWrapper) ((CreateRequest) request).getNewObject()));
return cmd;
16 years, 5 months
JBoss Tools SVN: r9395 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper.
by jbosstools-commits@lists.jboss.org
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() {
16 years, 5 months
JBoss Tools SVN: r9394 - in trunk/flow/plugins/org.jboss.tools.flow.common.graph: src/org/jboss/tools/flow/editor/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:55:37 -0400 (Tue, 29 Jul 2008)
New Revision: 9394
Added:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultNodeWrapper.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/META-INF/MANIFEST.MF
Log:
create a DefaultNodeWrapper implementation
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/META-INF/MANIFEST.MF
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/META-INF/MANIFEST.MF 2008-07-29 13:48:25 UTC (rev 9393)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/META-INF/MANIFEST.MF 2008-07-29 13:55:37 UTC (rev 9394)
@@ -6,6 +6,7 @@
Bundle-Activator: org.jboss.tools.flow.JBossToolsProcessPlugin
Bundle-Vendor: JBoss
Require-Bundle:
+ org.jboss.tools.flow.common.core;bundle-version="1.0.0",
org.eclipse.ui.views,
org.eclipse.draw2d,
org.eclipse.gef,
Added: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultNodeWrapper.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/DefaultNodeWrapper.java 2008-07-29 13:55:37 UTC (rev 9394)
@@ -0,0 +1,60 @@
+package org.jboss.tools.flow.editor.core;
+
+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 DefaultNodeWrapper 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;
+ }
+}
16 years, 5 months
JBoss Tools SVN: r9393 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:48:25 -0400 (Tue, 29 Jul 2008)
New Revision: 9393
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/EndState.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Process.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/StartState.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/State.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/SuperState.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Transition.java
Log:
rename Abstract* -> Default*
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/EndState.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/EndState.java 2008-07-29 13:48:00 UTC (rev 9392)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/EndState.java 2008-07-29 13:48:25 UTC (rev 9393)
@@ -1,7 +1,7 @@
package org.jboss.tools.flow.jpdl4.core;
-import org.jboss.tools.flow.common.core.AbstractNode;
+import org.jboss.tools.flow.common.core.DefaultNode;
-public class EndState extends AbstractNode {
+public class EndState extends DefaultNode {
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Process.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Process.java 2008-07-29 13:48:00 UTC (rev 9392)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Process.java 2008-07-29 13:48:25 UTC (rev 9393)
@@ -2,10 +2,10 @@
import java.util.Iterator;
-import org.jboss.tools.flow.common.core.AbstractFlow;
+import org.jboss.tools.flow.common.core.DefaultFlow;
import org.jboss.tools.flow.common.core.Node;
-public class Process extends AbstractFlow {
+public class Process extends DefaultFlow {
public StartState getStartState() {
for (Iterator<Node> iterator = getNodes().iterator(); iterator.hasNext(); ) {
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/StartState.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/StartState.java 2008-07-29 13:48:00 UTC (rev 9392)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/StartState.java 2008-07-29 13:48:25 UTC (rev 9393)
@@ -1,7 +1,7 @@
package org.jboss.tools.flow.jpdl4.core;
-import org.jboss.tools.flow.common.core.AbstractNode;
+import org.jboss.tools.flow.common.core.DefaultNode;
-public class StartState extends AbstractNode {
+public class StartState extends DefaultNode {
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/State.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/State.java 2008-07-29 13:48:00 UTC (rev 9392)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/State.java 2008-07-29 13:48:25 UTC (rev 9393)
@@ -1,7 +1,7 @@
package org.jboss.tools.flow.jpdl4.core;
-import org.jboss.tools.flow.common.core.AbstractNode;
+import org.jboss.tools.flow.common.core.DefaultNode;
-public class State extends AbstractNode {
+public class State extends DefaultNode {
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/SuperState.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/SuperState.java 2008-07-29 13:48:00 UTC (rev 9392)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/SuperState.java 2008-07-29 13:48:25 UTC (rev 9393)
@@ -1,7 +1,7 @@
package org.jboss.tools.flow.jpdl4.core;
-import org.jboss.tools.flow.common.core.AbstractNodeContainer;
+import org.jboss.tools.flow.common.core.DefaultContainer;
-public class SuperState extends AbstractNodeContainer {
+public class SuperState extends DefaultContainer {
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Transition.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Transition.java 2008-07-29 13:48:00 UTC (rev 9392)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.core/src/org/jboss/tools/flow/jpdl4/core/Transition.java 2008-07-29 13:48:25 UTC (rev 9393)
@@ -1,32 +1,12 @@
package org.jboss.tools.flow.jpdl4.core;
-import java.util.HashMap;
-
-import org.jboss.tools.flow.common.core.AbstractConnection;
+import org.jboss.tools.flow.common.core.DefaultConnection;
import org.jboss.tools.flow.common.core.Node;
-public class Transition extends AbstractConnection {
-
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
+public class Transition extends DefaultConnection {
public Transition(Node from, Node to) {
super(from, to);
}
-
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
- public String getFromType() {
- return null;
- }
-
- public String getToType() {
- return null;
- }
-
+
}
16 years, 5 months
JBoss Tools SVN: r9392 - trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:48:00 -0400 (Tue, 29 Jul 2008)
New Revision: 9392
Added:
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Container.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultConnection.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultContainer.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultFlow.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultNode.java
Removed:
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractConnection.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractFlow.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNode.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/NodeContainer.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Flow.java
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Node.java
Log:
rename Abstract* -> Default*
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractConnection.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractConnection.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractConnection.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -1,31 +0,0 @@
-package org.jboss.tools.flow.common.core;
-
-import java.util.HashMap;
-
-public abstract class AbstractConnection implements Connection {
-
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
- private Node from, to;
-
- public AbstractConnection(Node from, Node to) {
- this.from = from;
- this.to = to;
- }
-
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
- public Node getFrom() {
- return from;
- }
-
- public Node getTo() {
- return to;
- }
-
-}
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractFlow.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractFlow.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractFlow.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -1,88 +0,0 @@
-package org.jboss.tools.flow.common.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-public class AbstractFlow implements Flow {
-
- private String name;
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
- private ArrayList<Node> nodes = new ArrayList<Node>();
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
- public List<Node> getNodes() {
- return nodes;
- }
-
- public void addNode(Node node) {
- nodes.add(node);
- node.setNodeContainer(this);
- }
-
- public void removeNode(Node node) {
- node.setNodeContainer(null);
- nodes.remove(node);
- }
-
- public String getId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getPackageName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getVersion() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void setId(String id) {
- // TODO Auto-generated method stub
-
- }
-
- public void setPackageName(String packageName) {
- // TODO Auto-generated method stub
-
- }
-
- public void setType(String type) {
- // TODO Auto-generated method stub
-
- }
-
- public void setVersion(String version) {
- // TODO Auto-generated method stub
-
- }
-
- public Node getNode(long id) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNode.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNode.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNode.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -1,87 +0,0 @@
-package org.jboss.tools.flow.common.core;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class AbstractNode implements Node {
-
- private long id;
- private String name;
- private NodeContainer container;
-
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
-
- public long getId() {
- return id;
- }
-
- public void setId(long l) {
- id = l;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
- public NodeContainer getNodeContainer() {
- return container;
- }
-
- public void setNodeContainer(NodeContainer container) {
- this.container = container;
- }
-
- public void addIncomingConnection(String type, Connection connection) {
- // TODO Auto-generated method stub
-
- }
-
- public void addOutgoingConnection(String type, Connection connection) {
- // TODO Auto-generated method stub
-
- }
-
- public Map<String, List<Connection>> getIncomingConnections() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Connection> getIncomingConnections(String type) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Map<String, List<Connection>> getOutgoingConnections() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Connection> getOutgoingConnections(String type) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void removeIncomingConnection(String type, Connection connection) {
- // TODO Auto-generated method stub
-
- }
-
- public void removeOutgoingConnection(String type, Connection connection) {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -1,52 +0,0 @@
-package org.jboss.tools.flow.common.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-public abstract class AbstractNodeContainer extends AbstractNode implements NodeContainer {
-
- private String name;
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
- private ArrayList<Node> nodes = new ArrayList<Node>();
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Object getMetaData(String key) {
- return metaData.get(key);
- }
-
- public void setMetaData(String key, Object value) {
- metaData.put(key, value);
- }
-
- public List<Node> getNodes() {
- return nodes;
- }
-
- public void addNode(Node node) {
- nodes.add(node);
- node.setNodeContainer(this);
- }
-
- public void removeNode(Node node) {
- node.setNodeContainer(null);
- nodes.remove(node);
- }
-
- public Node getNode(long id) {
- for (Node node : nodes) {
- if (node.getId() == id) {
- return node;
- }
- }
- return null;
- }
-
-}
Copied: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Container.java (from rev 9373, trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/NodeContainer.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Container.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Container.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -0,0 +1,47 @@
+package org.jboss.tools.flow.common.core;
+
+import java.util.List;
+
+/**
+ * A container of nodes.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface Container {
+
+ /**
+ * Returns the nodes of this node container.
+ *
+ * @return the nodes of this node container
+ */
+ List<Node> getNodes();
+
+ /**
+ * Returns the node with the given id
+ *
+ * @param id
+ * the node id
+ * @return the node with the given id
+ * @throws IllegalArgumentException
+ * if an unknown id is passed
+ */
+ Node getNode(long id);
+
+ /**
+ * Method for adding a node to this node container.
+ * Note that the node will get an id unique for this node container.
+ *
+ * @param node the node to be added
+ * @throws IllegalArgumentException if <code>node</code> is null
+ */
+ void addNode(Node node);
+
+ /**
+ * Method for removing a node from this node container
+ *
+ * @param node the node to be removed
+ * @throws IllegalArgumentException if <code>node</code> is null or unknown
+ */
+ void removeNode(Node node);
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Container.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultConnection.java (from rev 9373, trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractConnection.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultConnection.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultConnection.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -0,0 +1,39 @@
+package org.jboss.tools.flow.common.core;
+
+import java.util.HashMap;
+
+public abstract class DefaultConnection implements Connection {
+
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+ private Node from, to;
+
+ public DefaultConnection(Node from, Node to) {
+ this.from = from;
+ this.to = to;
+ }
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+ public Node getFrom() {
+ return from;
+ }
+
+ public Node getTo() {
+ return to;
+ }
+
+ public String getFromType() {
+ return null;
+ }
+
+ public String getToType() {
+ return null;
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultConnection.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultContainer.java (from rev 9389, trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultContainer.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultContainer.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -0,0 +1,52 @@
+package org.jboss.tools.flow.common.core;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public abstract class DefaultContainer extends DefaultNode implements Container {
+
+ private String name;
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+ private ArrayList<Node> nodes = new ArrayList<Node>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+ public List<Node> getNodes() {
+ return nodes;
+ }
+
+ public void addNode(Node node) {
+ nodes.add(node);
+ node.setNodeContainer(this);
+ }
+
+ public void removeNode(Node node) {
+ node.setNodeContainer(null);
+ nodes.remove(node);
+ }
+
+ public Node getNode(long id) {
+ for (Node node : nodes) {
+ if (node.getId() == id) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultContainer.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultFlow.java (from rev 9373, trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractFlow.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultFlow.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultFlow.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -0,0 +1,88 @@
+package org.jboss.tools.flow.common.core;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class DefaultFlow implements Flow {
+
+ private String name;
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+ private ArrayList<Node> nodes = new ArrayList<Node>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+ public List<Node> getNodes() {
+ return nodes;
+ }
+
+ public void addNode(Node node) {
+ nodes.add(node);
+ node.setNodeContainer(this);
+ }
+
+ public void removeNode(Node node) {
+ node.setNodeContainer(null);
+ nodes.remove(node);
+ }
+
+ public String getId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getPackageName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getVersion() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setId(String id) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setPackageName(String packageName) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setType(String type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setVersion(String version) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Node getNode(long id) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultFlow.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultNode.java (from rev 9380, trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNode.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultNode.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultNode.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -0,0 +1,87 @@
+package org.jboss.tools.flow.common.core;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class DefaultNode implements Node {
+
+ private long id;
+ private String name;
+ private Container container;
+
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long l) {
+ id = l;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public Container getNodeContainer() {
+ return container;
+ }
+
+ public void setNodeContainer(Container container) {
+ this.container = container;
+ }
+
+ public void addIncomingConnection(String type, Connection connection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addOutgoingConnection(String type, Connection connection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Map<String, List<Connection>> getIncomingConnections() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Connection> getIncomingConnections(String type) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, List<Connection>> getOutgoingConnections() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Connection> getOutgoingConnections(String type) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void removeIncomingConnection(String type, Connection connection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void removeOutgoingConnection(String type, Connection connection) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/DefaultNode.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Flow.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Flow.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Flow.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -25,7 +25,7 @@
*
* @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
*/
-public interface Flow extends NodeContainer {
+public interface Flow extends Container {
/**
* Sets the id of this process.
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Node.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Node.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/Node.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -80,9 +80,9 @@
List<Connection> getOutgoingConnections(String type);
- NodeContainer getNodeContainer();
+ Container getNodeContainer();
- void setNodeContainer(NodeContainer nodeContainer);
+ void setNodeContainer(Container nodeContainer);
void setMetaData(String name, Object value);
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/NodeContainer.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/NodeContainer.java 2008-07-29 13:41:00 UTC (rev 9391)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/NodeContainer.java 2008-07-29 13:48:00 UTC (rev 9392)
@@ -1,47 +0,0 @@
-package org.jboss.tools.flow.common.core;
-
-import java.util.List;
-
-/**
- * A container of nodes.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
- */
-public interface NodeContainer {
-
- /**
- * Returns the nodes of this node container.
- *
- * @return the nodes of this node container
- */
- List<Node> getNodes();
-
- /**
- * Returns the node with the given id
- *
- * @param id
- * the node id
- * @return the node with the given id
- * @throws IllegalArgumentException
- * if an unknown id is passed
- */
- Node getNode(long id);
-
- /**
- * Method for adding a node to this node container.
- * Note that the node will get an id unique for this node container.
- *
- * @param node the node to be added
- * @throws IllegalArgumentException if <code>node</code> is null
- */
- void addNode(Node node);
-
- /**
- * Method for removing a node from this node container
- *
- * @param node the node to be removed
- * @throws IllegalArgumentException if <code>node</code> is null or unknown
- */
- void removeNode(Node node);
-
-}
16 years, 5 months
JBoss Tools SVN: r9391 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph: src/org/jboss/tools/flow/jpdl4/graph/editor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:41:00 -0400 (Tue, 29 Jul 2008)
New Revision: 9391
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/icons/super.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/JpdlEditPartFactory.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/TransitionWrapper.java
Log:
node container support
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/icons/super.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/icons/super.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java 2008-07-29 13:40:27 UTC (rev 9390)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java 2008-07-29 13:41:00 UTC (rev 9391)
@@ -12,6 +12,7 @@
import org.jboss.tools.flow.jpdl4.graph.wrapper.EndStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.StartStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.StateWrapper;
+import org.jboss.tools.flow.jpdl4.graph.wrapper.SuperStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.TransitionWrapperFactory;
public class JpdlPaletteFactory extends PaletteFactory {
@@ -53,6 +54,16 @@
);
entries.add(combined);
+ combined = new CombinedTemplateCreationEntry(
+ "Super State",
+ "Create a new Super State",
+ SuperStateWrapper.class,
+ new SimpleFactory(SuperStateWrapper.class),
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/super.gif")),
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/super.gif"))
+ );
+ entries.add(combined);
+
return entries;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/JpdlEditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/JpdlEditPartFactory.java 2008-07-29 13:40:27 UTC (rev 9390)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/JpdlEditPartFactory.java 2008-07-29 13:41:00 UTC (rev 9391)
@@ -2,11 +2,13 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.flow.editor.editpart.ContainerEditPart;
import org.jboss.tools.flow.editor.editpart.RootEditPart;
import org.jboss.tools.flow.jpdl4.graph.wrapper.EndStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.ProcessWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.StartStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.StateWrapper;
+import org.jboss.tools.flow.jpdl4.graph.wrapper.SuperStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.TransitionWrapper;
public class JpdlEditPartFactory implements EditPartFactory {
@@ -15,6 +17,8 @@
EditPart result = null;
if (model instanceof ProcessWrapper) {
result = new RootEditPart();
+ } else if (model instanceof SuperStateWrapper) {
+ result = new ContainerEditPart();
} else if (model instanceof StartStateWrapper) {
result = new StartStateEditPart();
} else if (model instanceof StateWrapper) {
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-07-29 13:40:27 UTC (rev 9390)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/ProcessWrapper.java 2008-07-29 13:41:00 UTC (rev 9391)
@@ -37,7 +37,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) {
@@ -49,7 +49,7 @@
}
protected void internalRemoveElement(NodeWrapper element) {
- getProcess().removeNode(((BaseNodeWrapper) element).getNode());
+ getProcess().removeNode((Node)element.getElement());
}
public boolean acceptsElement(NodeWrapper element) {
Added: 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 (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/SuperStateWrapper.java 2008-07-29 13:41:00 UTC (rev 9391)
@@ -0,0 +1,84 @@
+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.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.NodeWrapper;
+import org.jboss.tools.flow.jpdl4.core.Process;
+import org.jboss.tools.flow.jpdl4.core.StartState;
+import org.jboss.tools.flow.jpdl4.core.SuperState;
+
+public class SuperStateWrapper extends AbstractContainerWrapper {
+
+ public SuperStateWrapper() {
+ setElement(new SuperState());
+ }
+
+ public Process getProcess() {
+ ContainerWrapper parent = getParent();
+ while (parent instanceof NodeWrapper && ((NodeWrapper)parent).getParent() != null) {
+ parent = ((NodeWrapper)parent).getParent();
+ }
+ if (parent instanceof ProcessWrapper) {
+ return ((ProcessWrapper)parent).getProcess();
+ }
+ return null;
+ }
+
+ public Node getNode() {
+ return (Node)getElement();
+ }
+
+ protected void internalAddElement(NodeWrapper element) {
+ Node node = ((BaseNodeWrapper) element).getNode();
+ long id = 0;
+ for (Node n: getProcess().getNodes()) {
+ if (n.getId() > id) {
+ id = n.getId();
+ }
+ }
+ node.setId(++id);
+ ((NodeContainer)getParent().getElement()).addNode(node);
+ }
+
+ protected void internalRemoveElement(NodeWrapper element) {
+ getProcess().removeNode(((BaseNodeWrapper) element).getNode());
+ }
+
+ protected 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);
+ }
+
+ 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 boolean acceptsElement(NodeWrapper element) {
+ if (element.getElement() instanceof StartState) {
+ return getProcess().getStartState() == null;
+ }
+ return super.acceptsElement(element);
+ }
+
+ public String getId() {
+ long id = getNode().getId();
+ return id == -1 ? null : getNode().getId() + "";
+ }
+
+ public String getName() {
+ return getNode().getName();
+ }
+
+}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapper.java 2008-07-29 13:40:27 UTC (rev 9390)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapper.java 2008-07-29 13:41:00 UTC (rev 9391)
@@ -25,8 +25,8 @@
public void connect(NodeWrapper source, NodeWrapper target) {
super.connect(source, target);
- Node from = ((BaseNodeWrapper) getSource()).getNode();
- Node to = ((BaseNodeWrapper) getTarget()).getNode();
+ Node from = (Node)getSource().getElement();
+ Node to = (Node)getTarget().getElement();
setElement(new Transition(from, to));
}
16 years, 5 months
JBoss Tools SVN: r9390 - trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:40:27 -0400 (Tue, 29 Jul 2008)
New Revision: 9390
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java
Log:
node container support
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java 2008-07-29 13:39:52 UTC (rev 9389)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/org/jboss/tools/flow/editor/core/AbstractContainerWrapper.java 2008-07-29 13:40:27 UTC (rev 9390)
@@ -54,4 +54,18 @@
return getParent().getProcessWrapper();
}
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
+ public boolean acceptsIncomingConnection(
+ AbstractConnectionWrapper connection, NodeWrapper source) {
+ return true;
+ }
+
+ public boolean acceptsOutgoingConnection(
+ AbstractConnectionWrapper connection, NodeWrapper target) {
+ return true;
+ }
+
}
16 years, 5 months
JBoss Tools SVN: r9389 - trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-07-29 09:39:52 -0400 (Tue, 29 Jul 2008)
New Revision: 9389
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java
Log:
node container support
Modified: trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java 2008-07-29 13:06:13 UTC (rev 9388)
+++ trunk/flow/plugins/org.jboss.tools.flow.common.core/src/org/jboss/tools/flow/common/core/AbstractNodeContainer.java 2008-07-29 13:39:52 UTC (rev 9389)
@@ -4,7 +4,7 @@
import java.util.HashMap;
import java.util.List;
-public abstract class AbstractNodeContainer implements NodeContainer {
+public abstract class AbstractNodeContainer extends AbstractNode implements NodeContainer {
private String name;
private HashMap<String, Object> metaData = new HashMap<String, Object>();
16 years, 5 months