Author: koen.aers(a)jboss.com
Date: 2009-05-11 11:55:21 -0400 (Mon, 11 May 2009)
New Revision: 15174
Added:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
Removed:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
Log:
4.0.0.beta2 release
Copied: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common (from rev 14456,
trunk/flow/plugins/org.jboss.tools.flow.common)
Deleted: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-04-02
12:41:29 UTC (rev 14456)
+++ tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.jboss.tools.flow.common;singleton:=true
-Bundle-Version: 1.0.0.beta1
-Bundle-Activator: org.jboss.tools.flow.common.Activator
-Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle:
- org.eclipse.ui.views,
- org.eclipse.draw2d,
- org.eclipse.gef,
- org.eclipse.jface,
- org.eclipse.core.runtime,
- org.eclipse.ui,
- org.eclipse.core.resources,
- org.eclipse.ui.ide
-Bundle-ActivationPolicy: lazy
-Export-Package:
org.jboss.tools.flow.common;uses:="org.eclipse.core.runtime,org.eclipse.ui.plugin,org.osgi.framework",
- org.jboss.tools.flow.common.action,
- org.jboss.tools.flow.common.command,
- org.jboss.tools.flow.common.editor,
- org.jboss.tools.flow.common.editpart,
- org.jboss.tools.flow.common.figure,
- org.jboss.tools.flow.common.model,
- org.jboss.tools.flow.common.policy,
- org.jboss.tools.flow.common.properties,
- org.jboss.tools.flow.common.registry,
- org.jboss.tools.flow.common.strategy,
- org.jboss.tools.flow.common.wrapper
-Bundle-ClassPath: .
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Localization: plugin
Copied: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF (from
rev 14987, trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF)
===================================================================
--- tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
(rev 0)
+++ tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.flow.common;singleton:=true
+Bundle-Version: 1.0.0.beta2
+Bundle-Activator: org.jboss.tools.flow.common.Activator
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle:
+ org.eclipse.ui.views,
+ org.eclipse.draw2d,
+ org.eclipse.gef,
+ org.eclipse.jface,
+ org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide
+Bundle-ActivationPolicy: lazy
+Export-Package:
org.jboss.tools.flow.common;uses:="org.eclipse.core.runtime,org.eclipse.ui.plugin,org.osgi.framework",
+ org.jboss.tools.flow.common.action,
+ org.jboss.tools.flow.common.command,
+ org.jboss.tools.flow.common.editor,
+ org.jboss.tools.flow.common.editpart,
+ org.jboss.tools.flow.common.figure,
+ org.jboss.tools.flow.common.model,
+ org.jboss.tools.flow.common.policy,
+ org.jboss.tools.flow.common.properties,
+ org.jboss.tools.flow.common.registry,
+ org.jboss.tools.flow.common.strategy,
+ org.jboss.tools.flow.common.wrapper
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Localization: plugin
Deleted: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd 2009-04-02
12:41:29 UTC (rev 14456)
+++ tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,266 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.jboss.tools.flow.common"
xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.jboss.tools.flow.common"
id="elements" name="Flow Language Elements"/>
- </appinfo>
- <documentation>
- This extension point provides a way to contribute language elements to a target
flow language.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="element" minOccurs="1"
maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string"
use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="element">
- <complexType>
- <choice>
- <element ref="flow"/>
- <element ref="container"/>
- <element ref="node"/>
- <element ref="connection"/>
- </choice>
- <attribute name="id" type="string"
use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string"
use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="language" type="string"
use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="figure" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="resource"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="flow">
- <complexType>
- <attribute name="acceptsElementStrategy"
type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="node">
- <complexType>
- <sequence>
- <element ref="figure" minOccurs="0"
maxOccurs="1"/>
- </sequence>
- <attribute name="acceptsIncomingConnectionStrategy"
type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="acceptsOutgoingConnectionStrategy"
type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="container">
- <complexType>
- <attribute name="acceptsElementStrategy"
type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="acceptsIncomingConnectionStrategy"
type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="acceptsOutgoingConnectionStrategy"
type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="connection" type="string">
- </element>
-
- <element name="figure">
- <complexType>
- <choice minOccurs="0" maxOccurs="1">
- <element ref="ellipse"/>
- <element ref="rectangle"/>
- <element ref="rounded-rectangle"/>
- </choice>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.figure.ElementFigure"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="color" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="resource"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="ellipse" type="string">
- </element>
-
- <element name="rectangle" type="string">
- </element>
-
- <element name="rounded-rectangle" type="string">
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
Copied: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd (from
rev 14968, trunk/flow/plugins/org.jboss.tools.flow.common/schema/elements.exsd)
===================================================================
--- tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd
(rev 0)
+++ tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/schema/elements.exsd 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,266 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.flow.common"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.flow.common"
id="elements" name="Flow Language Elements"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a way to contribute language elements to a target
flow language.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="element" minOccurs="1"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="element">
+ <complexType>
+ <choice minOccurs="0" maxOccurs="1">
+ <element ref="flow"/>
+ <element ref="container"/>
+ <element ref="node"/>
+ <element ref="connection"/>
+ </choice>
+ <attribute name="id" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="language" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="figure" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="flow">
+ <complexType>
+ <attribute name="acceptsElementStrategy"
type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="node">
+ <complexType>
+ <sequence>
+ <element ref="figure" minOccurs="0"
maxOccurs="1"/>
+ </sequence>
+ <attribute name="acceptsIncomingConnectionStrategy"
type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsOutgoingConnectionStrategy"
type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="container">
+ <complexType>
+ <attribute name="acceptsElementStrategy"
type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsIncomingConnectionStrategy"
type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsOutgoingConnectionStrategy"
type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="connection" type="string">
+ </element>
+
+ <element name="figure">
+ <complexType>
+ <choice minOccurs="0" maxOccurs="1">
+ <element ref="ellipse"/>
+ <element ref="rectangle"/>
+ <element ref="rounded-rectangle"/>
+ </choice>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.flow.common.figure.ElementFigure"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="color" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ellipse" type="string">
+ </element>
+
+ <element name="rectangle" type="string">
+ </element>
+
+ <element name="rounded-rectangle" type="string">
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,103 +0,0 @@
-package org.jboss.tools.flow.common.action;
-
-/*
- * 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.HashMap;
-import java.util.Map;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.draw2d.graph.DirectedGraph;
-import org.eclipse.draw2d.graph.DirectedGraphLayout;
-import org.eclipse.draw2d.graph.Edge;
-import org.eclipse.draw2d.graph.Node;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.jboss.tools.flow.common.Activator;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.FlowWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * Action for auto layouting a process.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class VerticalAutoLayoutAction extends Action implements IAction {
-
- public static final String ID =
"org.jboss.tools.process.editor.action.VerticalAutoLayoutAction";
-
- private GraphicalViewer diagramViewer;
-
- public VerticalAutoLayoutAction(GraphicalViewer diagramViewer) {
- this.diagramViewer = diagramViewer;
- initialize();
- }
-
- protected void initialize() {
- setId(ID);
- setText("Auto Layout (Vertical)");
- setImageDescriptor(
- ImageDescriptor.createFromURL(
- Activator.getDefault().getBundle().getEntry("icons/layoutV.gif")));
- setToolTipText("Auto layout the process (vertical)");
- }
-
- public void run() {
- Map<String, Node> mapping = new HashMap<String, Node>();
- DirectedGraph graph = createDirectedGraph(mapping);
- DirectedGraphLayout layout = new DirectedGraphLayout();
- layout.visit(graph);
- for (Map.Entry<String, Node> entry: mapping.entrySet()) {
- Node node = entry.getValue();
- NodeWrapper nodeWrapper =
-
((FlowWrapper)diagramViewer.getContents().getModel()).getElement(entry.getKey());
- nodeWrapper.setConstraint(new Rectangle(node.x, node.y, node.width,
node.height));
- }
- }
-
- @SuppressWarnings("unchecked")
- protected DirectedGraph createDirectedGraph(Map<String, Node> mapping) {
- DirectedGraph graph = new DirectedGraph();
- FlowWrapper processWrapper =
(FlowWrapper)diagramViewer.getContents().getModel();
- for (NodeWrapper elementWrapper: processWrapper.getElements()) {
- Node node = new Node();
- Integer width = (Integer) elementWrapper.getConstraint().width;
- Integer height = (Integer) elementWrapper.getConstraint().height;
- if (width == null || width <= 0) {
- width = 80;
- }
- if (height == null || height <= 0) {
- height = 40;
- }
- node.setSize(new Dimension(width, height));
- graph.nodes.add(node);
- mapping.put(elementWrapper.getId(), node);
- }
- for (NodeWrapper elementWrapper: processWrapper.getElements()) {
- for (ConnectionWrapper connection: elementWrapper.getIncomingConnections())
{
- Node source = mapping.get(connection.getSource().getId());
- Node target = mapping.get(connection.getTarget().getId());
- graph.edges.add(new Edge(source, target));
- }
- }
- return graph;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,103 @@
+package org.jboss.tools.flow.common.action;
+
+/*
+ * 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.HashMap;
+import java.util.Map;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.draw2d.graph.DirectedGraph;
+import org.eclipse.draw2d.graph.DirectedGraphLayout;
+import org.eclipse.draw2d.graph.Edge;
+import org.eclipse.draw2d.graph.Node;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.flow.common.Activator;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Action for auto layouting a process.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class VerticalAutoLayoutAction extends Action implements IAction {
+
+ public static final String ID =
"org.jboss.tools.process.editor.action.VerticalAutoLayoutAction";
+
+ private GraphicalViewer diagramViewer;
+
+ public VerticalAutoLayoutAction(GraphicalViewer diagramViewer) {
+ this.diagramViewer = diagramViewer;
+ initialize();
+ }
+
+ protected void initialize() {
+ setId(ID);
+ setText("Auto Layout (Vertical)");
+ setImageDescriptor(
+ ImageDescriptor.createFromURL(
+ Activator.getDefault().getBundle().getEntry("icons/layoutV.gif")));
+ setToolTipText("Auto layout the process (vertical)");
+ }
+
+ public void run() {
+ Map<String, Node> mapping = new HashMap<String, Node>();
+ DirectedGraph graph = createDirectedGraph(mapping);
+ DirectedGraphLayout layout = new DirectedGraphLayout();
+ layout.visit(graph);
+ for (Map.Entry<String, Node> entry: mapping.entrySet()) {
+ Node node = entry.getValue();
+ NodeWrapper nodeWrapper =
+
((FlowWrapper)diagramViewer.getContents().getModel()).getNodeWrapper(entry.getKey());
+ nodeWrapper.setConstraint(new Rectangle(node.x, node.y, node.width,
node.height));
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected DirectedGraph createDirectedGraph(Map<String, Node> mapping) {
+ DirectedGraph graph = new DirectedGraph();
+ FlowWrapper processWrapper =
(FlowWrapper)diagramViewer.getContents().getModel();
+ for (NodeWrapper elementWrapper: processWrapper.getNodeWrappers()) {
+ Node node = new Node();
+ Integer width = (Integer) elementWrapper.getConstraint().width;
+ Integer height = (Integer) elementWrapper.getConstraint().height;
+ if (width == null || width <= 0) {
+ width = 80;
+ }
+ if (height == null || height <= 0) {
+ height = 40;
+ }
+ node.setSize(new Dimension(width, height));
+ graph.nodes.add(node);
+ mapping.put(elementWrapper.getId(), node);
+ }
+ for (NodeWrapper elementWrapper: processWrapper.getNodeWrappers()) {
+ for (ConnectionWrapper connection: elementWrapper.getIncomingConnections())
{
+ Node source = mapping.get(connection.getSource().getId());
+ Node target = mapping.get(connection.getTarget().getId());
+ graph.edges.add(new Edge(source, target));
+ }
+ }
+ return graph;
+ }
+
+}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
(from rev 14940,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,32 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class AddChildCommand extends Command {
+
+ private Wrapper child;
+ private Wrapper parent;
+ private Object type;
+
+ public void execute() {
+ parent.addChild(type, child);
+ }
+
+ public void setChild(Wrapper newChild) {
+ child = newChild;
+ }
+
+ public void setType(Object newType) {
+ type = newType;
+ }
+
+ public void setParent(Wrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.removeChild(type, child);
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,63 +0,0 @@
-package org.jboss.tools.flow.common.command;
-
-/*
- * 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 org.eclipse.gef.commands.Command;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * A command for adding an element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class AddElementCommand extends Command {
-
- private NodeWrapper child;
- private ContainerWrapper parent;
-
- public void execute() {
- parent.addElement(child);
- child.setParent(parent);
- }
-
- protected ContainerWrapper getParent() {
- return parent;
- }
-
- protected NodeWrapper getChild() {
- return child;
- }
-
- public void setChild(NodeWrapper newChild) {
- child = newChild;
- }
-
- public void setParent(ContainerWrapper newParent) {
- parent = newParent;
- }
-
- public void undo() {
- parent.removeElement(child);
- child.setParent(null);
- }
-
- public boolean canExecute() {
- return parent.acceptsElement(child);
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
(from rev 14940,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,63 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * 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 org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for adding an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class AddNodeCommand extends Command {
+
+ private NodeWrapper child;
+ private ContainerWrapper parent;
+
+ public void execute() {
+ parent.addElement(child);
+ child.setParent(parent);
+ }
+
+ protected ContainerWrapper getParent() {
+ return parent;
+ }
+
+ protected NodeWrapper getChild() {
+ return child;
+ }
+
+ public void setChild(NodeWrapper newChild) {
+ child = newChild;
+ }
+
+ public void setParent(ContainerWrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.removeElement(child);
+ child.setParent(null);
+ }
+
+ public boolean canExecute() {
+ return parent.acceptsElement(child);
+ }
+
+}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
(from rev 14940,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,36 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class DeleteChildCommand extends Command {
+
+ private Wrapper child;
+ private Wrapper parent;
+ private Object type;
+
+ public void execute() {
+ parent.removeChild(type, child);
+ }
+
+ public void setChild(Wrapper newChild) {
+ child = newChild;
+ }
+
+ public void setType(Object newType) {
+ type = newType;
+ }
+
+ public void setParent(Wrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.addChild(type, child);
+ }
+
+ public boolean canExecute() {
+ return child != null && parent != null && type != null;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,130 +0,0 @@
-package org.jboss.tools.flow.common.command;
-
-/*
- * 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.List;
-
-import org.eclipse.gef.commands.Command;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * A command for deleting an element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class DeleteElementCommand extends Command {
-
- private NodeWrapper child;
- private ContainerWrapper parent;
-
- private List<DeleteElementCommand> embeddedCommands;
-
- private List<NodeWrapper> incomingElementWrappers = new
ArrayList<NodeWrapper>();
- private List<NodeWrapper> outgoingElementWrappers = new
ArrayList<NodeWrapper>();
- private List<ConnectionWrapper> incomingConnections = new
ArrayList<ConnectionWrapper>();
- private List<ConnectionWrapper> outgoingConnections = new
ArrayList<ConnectionWrapper>();
-
-
- private void deleteConnections(NodeWrapper element) {
- for (ConnectionWrapper connection: element.getIncomingConnections()) {
- incomingElementWrappers.add(connection.getSource());
- incomingConnections.add(connection);
- }
- for (ConnectionWrapper connection: element.getOutgoingConnections()) {
- outgoingElementWrappers.add(connection.getTarget());
- outgoingConnections.add(connection);
- }
- for (ConnectionWrapper connection: incomingConnections) {
- connection.disconnect();
- }
- for (ConnectionWrapper connection: outgoingConnections) {
- connection.disconnect();
- }
- }
-
- private void initializeEmbeddedCommands() {
- embeddedCommands = new ArrayList<DeleteElementCommand>();
- ContainerWrapper container = (ContainerWrapper)child;
- List<NodeWrapper> children = container.getElements();
- for (NodeWrapper w : children) {
- DeleteElementCommand c = new DeleteElementCommand();
- c.setParent(container);
- c.setChild(w);
- embeddedCommands.add(c);
- }
- }
-
- private void executeEmbeddedCommands() {
- if (embeddedCommands == null) {
- initializeEmbeddedCommands();
- }
- for (DeleteElementCommand c : embeddedCommands) {
- c.execute();
- }
- }
-
- public void execute() {
- if (child instanceof ContainerWrapper) {
- executeEmbeddedCommands();
- }
- deleteConnections(child);
- parent.removeElement(child);
- }
-
- private void restoreConnections() {
- int i = 0;
- for (ConnectionWrapper connection: incomingConnections) {
- connection.connect((NodeWrapper) incomingElementWrappers.get(i), child);
- i++;
- }
- i = 0;
- for (ConnectionWrapper connection: outgoingConnections) {
- connection.connect(child, (NodeWrapper) outgoingElementWrappers.get(i));
- i++;
- }
- incomingConnections.clear();
- incomingElementWrappers.clear();
- outgoingConnections.clear();
- outgoingElementWrappers.clear();
- }
-
- public void setChild(NodeWrapper child) {
- this.child = child;
- }
-
- public void setParent(ContainerWrapper parent) {
- this.parent = parent;
- }
-
- private void undoEmbeddedCommands() {
- for (DeleteElementCommand c : embeddedCommands) {
- c.undo();
- }
- }
-
- public void undo() {
- parent.addElement(child);
- restoreConnections();
- if (child instanceof ContainerWrapper) {
- undoEmbeddedCommands();
- }
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
(from rev 14940,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,130 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * 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.List;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for deleting an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class DeleteNodeCommand extends Command {
+
+ private NodeWrapper child;
+ private ContainerWrapper parent;
+
+ private List<DeleteNodeCommand> embeddedCommands;
+
+ private List<NodeWrapper> incomingElementWrappers = new
ArrayList<NodeWrapper>();
+ private List<NodeWrapper> outgoingElementWrappers = new
ArrayList<NodeWrapper>();
+ private List<ConnectionWrapper> incomingConnections = new
ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new
ArrayList<ConnectionWrapper>();
+
+
+ private void deleteConnections(NodeWrapper element) {
+ for (ConnectionWrapper connection: element.getIncomingConnections()) {
+ incomingElementWrappers.add(connection.getSource());
+ incomingConnections.add(connection);
+ }
+ for (ConnectionWrapper connection: element.getOutgoingConnections()) {
+ outgoingElementWrappers.add(connection.getTarget());
+ outgoingConnections.add(connection);
+ }
+ for (ConnectionWrapper connection: incomingConnections) {
+ connection.disconnect();
+ }
+ for (ConnectionWrapper connection: outgoingConnections) {
+ connection.disconnect();
+ }
+ }
+
+ private void initializeEmbeddedCommands() {
+ embeddedCommands = new ArrayList<DeleteNodeCommand>();
+ ContainerWrapper container = (ContainerWrapper)child;
+ List<NodeWrapper> children = container.getNodeWrappers();
+ for (NodeWrapper w : children) {
+ DeleteNodeCommand c = new DeleteNodeCommand();
+ c.setParent(container);
+ c.setChild(w);
+ embeddedCommands.add(c);
+ }
+ }
+
+ private void executeEmbeddedCommands() {
+ if (embeddedCommands == null) {
+ initializeEmbeddedCommands();
+ }
+ for (DeleteNodeCommand c : embeddedCommands) {
+ c.execute();
+ }
+ }
+
+ public void execute() {
+ if (child instanceof ContainerWrapper) {
+ executeEmbeddedCommands();
+ }
+ deleteConnections(child);
+ parent.removeElement(child);
+ }
+
+ private void restoreConnections() {
+ int i = 0;
+ for (ConnectionWrapper connection: incomingConnections) {
+ connection.connect((NodeWrapper) incomingElementWrappers.get(i), child);
+ i++;
+ }
+ i = 0;
+ for (ConnectionWrapper connection: outgoingConnections) {
+ connection.connect(child, (NodeWrapper) outgoingElementWrappers.get(i));
+ i++;
+ }
+ incomingConnections.clear();
+ incomingElementWrappers.clear();
+ outgoingConnections.clear();
+ outgoingElementWrappers.clear();
+ }
+
+ public void setChild(NodeWrapper child) {
+ this.child = child;
+ }
+
+ public void setParent(ContainerWrapper parent) {
+ this.parent = parent;
+ }
+
+ private void undoEmbeddedCommands() {
+ for (DeleteNodeCommand c : embeddedCommands) {
+ c.undo();
+ }
+ }
+
+ public void undo() {
+ parent.addElement(child);
+ restoreConnections();
+ if (child instanceof ContainerWrapper) {
+ undoEmbeddedCommands();
+ }
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,124 +0,0 @@
-package org.jboss.tools.flow.common.editpart;
-
-/*
- * 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.List;
-
-import org.eclipse.draw2d.AbsoluteBendpoint;
-import org.eclipse.draw2d.BendpointConnectionRouter;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
-import org.eclipse.gef.requests.CreationFactory;
-import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
-import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
-import org.jboss.tools.flow.common.registry.ElementRegistry;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.LabelWrapper;
-import org.jboss.tools.flow.common.wrapper.ModelEvent;
-import org.jboss.tools.flow.common.wrapper.ModelListener;
-import org.jboss.tools.flow.common.wrapper.Wrapper;
-
-/**
- * Implementation of a connection EditPart.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class ConnectionEditPart extends AbstractConnectionEditPart implements
ModelListener {
-
- public ConnectionWrapper getElementConnection() {
- return (ConnectionWrapper) getModel();
- }
-
- public List<Wrapper> getModelChildren() {
- List<Wrapper> result = new ArrayList<Wrapper>();
- LabelWrapper label = getElementConnection().getLabel();
- if (label != null) result.add(label);
- return result;
- }
-
- protected void createEditPolicies() {
- ConnectionEditPolicy connectionEditPolicy = new ConnectionEditPolicy();
- connectionEditPolicy.setElementConnectionFactory(getElementConnectionFactory());
- installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new
ConnectionEndpointEditPolicy());
- installEditPolicy(EditPolicy.CONNECTION_ROLE, connectionEditPolicy);
- installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new
ConnectionBendpointEditPolicy());
- }
-
- protected CreationFactory getElementConnectionFactory() {
- return ElementRegistry.getCreationFactory(getElementConnection().getElement());
- }
-
-
- protected Class<?> getElementConnectionType() {
- return DefaultConnectionWrapper.class;
- }
-
- protected IFigure createFigure() {
- PolylineConnection result = new PolylineConnection();
- result.setForegroundColor(ColorConstants.gray);
- result.setConnectionRouter(new BendpointConnectionRouter());
- result.setTargetDecoration(new PolygonDecoration());
- return result;
- }
-
- public void setSelected(int value) {
- super.setSelected(value);
- if (value != EditPart.SELECTED_NONE) {
- ((PolylineConnection)getFigure()).setLineWidth(2);
- } else {
- ((PolylineConnection)getFigure()).setLineWidth(1);
- }
- }
-
- public void modelChanged(ModelEvent event) {
- if (event.getChange() == ConnectionWrapper.CHANGE_BENDPOINTS) {
- refreshBendpoints();
- }
- }
-
- public void activate() {
- super.activate();
- getElementConnection().addListener(this);
- }
-
- public void deactivate() {
- getElementConnection().removeListener(this);
- super.deactivate();
- }
-
- protected void refreshBendpoints() {
- List<Point> bendpoints = getElementConnection().getBendpoints();
- List<Point> constraint = new ArrayList<Point>();
- for (int i = 0; i < bendpoints.size(); i++) {
- constraint.add(new AbsoluteBendpoint((Point) bendpoints.get(i)));
- }
- getConnectionFigure().setRoutingConstraint(constraint);
- }
-
- protected void refreshVisuals() {
- refreshBendpoints();
- }
-}
\ No newline at end of file
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,124 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * 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.List;
+
+import org.eclipse.draw2d.AbsoluteBendpoint;
+import org.eclipse.draw2d.BendpointConnectionRouter;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
+import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
+import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+/**
+ * Implementation of a connection EditPart.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class ConnectionEditPart extends AbstractConnectionEditPart implements
ModelListener {
+
+ public ConnectionWrapper getElementConnection() {
+ return (ConnectionWrapper) getModel();
+ }
+
+ public List<Wrapper> getModelChildren() {
+ List<Wrapper> result = new ArrayList<Wrapper>();
+ LabelWrapper label = getElementConnection().getLabel();
+ if (label != null) result.add(label);
+ return result;
+ }
+
+ protected void createEditPolicies() {
+ ConnectionEditPolicy connectionEditPolicy = new ConnectionEditPolicy();
+ connectionEditPolicy.setElementConnectionFactory(getElementConnectionFactory());
+ installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new
ConnectionEndpointEditPolicy());
+ installEditPolicy(EditPolicy.CONNECTION_ROLE, connectionEditPolicy);
+ installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new
ConnectionBendpointEditPolicy());
+ }
+
+ protected CreationFactory getElementConnectionFactory() {
+ return ElementRegistry.getCreationFactory(getElementConnection().getElement());
+ }
+
+
+ protected Class<?> getElementConnectionType() {
+ return DefaultConnectionWrapper.class;
+ }
+
+ protected IFigure createFigure() {
+ PolylineConnection result = new PolylineConnection();
+ result.setForegroundColor(ColorConstants.gray);
+ result.setConnectionRouter(new BendpointConnectionRouter());
+ result.setTargetDecoration(new PolygonDecoration());
+ return result;
+ }
+
+ public void setSelected(int value) {
+ super.setSelected(value);
+ if (value != EditPart.SELECTED_NONE) {
+ ((PolylineConnection)getFigure()).setLineWidth(2);
+ } else {
+ ((PolylineConnection)getFigure()).setLineWidth(1);
+ }
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == ConnectionWrapper.CHANGE_BENDPOINTS) {
+ refreshBendpoints();
+ }
+ }
+
+ public void activate() {
+ super.activate();
+ getElementConnection().addListener(this);
+ }
+
+ public void deactivate() {
+ getElementConnection().removeListener(this);
+ super.deactivate();
+ }
+
+ protected void refreshBendpoints() {
+ List<Point> bendpoints = getElementConnection().getBendpoints();
+ List<Point> constraint = new ArrayList<Point>();
+ for (int i = 0; i < bendpoints.size(); i++) {
+ constraint.add(new AbsoluteBendpoint((Point) bendpoints.get(i)));
+ }
+ getConnectionFigure().setRoutingConstraint(constraint);
+ }
+
+ protected void refreshVisuals() {
+ refreshBendpoints();
+ }
+}
\ No newline at end of file
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,81 +0,0 @@
-package org.jboss.tools.flow.common.editpart;
-
-/*
- * 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.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.MouseWheelHelper;
-import org.eclipse.gef.editparts.ViewportMouseWheelHelper;
-import org.jboss.tools.flow.common.figure.ElementContainerFigure;
-import org.jboss.tools.flow.common.policy.ElementContainerLayoutEditPolicy;
-import org.jboss.tools.flow.common.wrapper.AbstractContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.ModelEvent;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-public class ContainerEditPart extends ElementEditPart {
-
- protected AbstractContainerWrapper getElementContainerElementWrapper() {
- return (AbstractContainerWrapper) getModel();
- }
-
- protected IFigure createFigure() {
- return new ElementContainerFigure();
- }
-
- protected void createEditPolicies() {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, null);
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new
ElementContainerLayoutEditPolicy());
- }
-
- public void modelChanged(ModelEvent event) {
- if (event.getChange() == ContainerWrapper.ADD_ELEMENT) {
- refreshChildren();
- Object changedObject = event.getChangedObject();
- if (changedObject != null) {
- EditPart editPart =
(EditPart)getViewer().getEditPartRegistry().get(changedObject);
- if (editPart instanceof ElementEditPart) {
- ((ElementEditPart)editPart).performDirectEdit();
- }
- }
- } else if (event.getChange() == ContainerWrapper.REMOVE_ELEMENT) {
- refreshChildren();
- } else {
- super.modelChanged(event);
- }
- }
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class key) {
- if (key == MouseWheelHelper.class) {
- return new ViewportMouseWheelHelper(this);
- }
- return super.getAdapter(key);
- }
-
- protected List<NodeWrapper> getModelChildren() {
- return getElementContainerElementWrapper().getElements();
- }
-
- public IFigure getContentPane() {
- return ((ElementContainerFigure) getFigure()).getPane();
- }
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,81 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * 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.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.MouseWheelHelper;
+import org.eclipse.gef.editparts.ViewportMouseWheelHelper;
+import org.jboss.tools.flow.common.figure.ElementContainerFigure;
+import org.jboss.tools.flow.common.policy.ElementContainerLayoutEditPolicy;
+import org.jboss.tools.flow.common.wrapper.AbstractContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+public class ContainerEditPart extends ElementEditPart {
+
+ protected AbstractContainerWrapper getElementContainerElementWrapper() {
+ return (AbstractContainerWrapper) getModel();
+ }
+
+ protected IFigure createFigure() {
+ return new ElementContainerFigure();
+ }
+
+ protected void createEditPolicies() {
+ super.createEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, null);
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new
ElementContainerLayoutEditPolicy());
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == ContainerWrapper.ADD_ELEMENT) {
+ refreshChildren();
+ Object changedObject = event.getChangedObject();
+ if (changedObject != null) {
+ EditPart editPart =
(EditPart)getViewer().getEditPartRegistry().get(changedObject);
+ if (editPart instanceof ElementEditPart) {
+ ((ElementEditPart)editPart).performDirectEdit();
+ }
+ }
+ } else if (event.getChangeType() == ContainerWrapper.REMOVE_ELEMENT) {
+ refreshChildren();
+ } else {
+ super.modelChanged(event);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class key) {
+ if (key == MouseWheelHelper.class) {
+ return new ViewportMouseWheelHelper(this);
+ }
+ return super.getAdapter(key);
+ }
+
+ protected List<NodeWrapper> getModelChildren() {
+ return getElementContainerElementWrapper().getNodeWrappers();
+ }
+
+ public IFigure getContentPane() {
+ return ((ElementContainerFigure) getFigure()).getPane();
+ }
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,150 +0,0 @@
-package org.jboss.tools.flow.common.editpart;
-
-/*
- * 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.List;
-
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.NodeEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.jboss.tools.flow.common.figure.ElementFigure;
-import org.jboss.tools.flow.common.policy.ElementDirectEditManager;
-import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
-import org.jboss.tools.flow.common.policy.ElementEditPolicy;
-import org.jboss.tools.flow.common.policy.ElementNodeEditPolicy;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.ModelEvent;
-import org.jboss.tools.flow.common.wrapper.ModelListener;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * Default implementation of an element EditPart.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public abstract class ElementEditPart extends AbstractGraphicalEditPart implements
NodeEditPart, ModelListener {
-
- private DirectEditManager manager;
-
- public NodeWrapper getElementWrapper() {
- return (NodeWrapper) getModel();
- }
-
- public ElementFigure getElementFigure() {
- return (ElementFigure) getFigure();
- }
-
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ElementNodeEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ElementEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
- }
-
- protected List<ConnectionWrapper> getModelSourceConnections() {
- return getElementWrapper().getOutgoingConnections();
- }
-
- protected List<ConnectionWrapper> getModelTargetConnections() {
- return getElementWrapper().getIncomingConnections();
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
- return getElementFigure().getSourceConnectionAnchor();
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
- return getElementFigure().getTargetConnectionAnchor();
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- return getElementFigure().getSourceConnectionAnchor();
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- return getElementFigure().getTargetConnectionAnchor();
- }
-
- protected void refreshVisuals() {
- NodeWrapper element = getElementWrapper();
- ElementFigure figure = (ElementFigure) getFigure();
- figure.setText(element.getName());
- if (element.getConstraint().width == -1) {
- element.getConstraint().width = figure.getBounds().width;
- }
- if (element.getConstraint().height == -1) {
- element.getConstraint().height = figure.getBounds().height;
- }
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure,
element.getConstraint());
- }
-
- public void modelChanged(ModelEvent event) {
- if (event.getChange() == NodeWrapper.ADD_INCOMING_CONNECTION) {
- refreshTargetConnections();
- } else if (event.getChange() == NodeWrapper.REMOVE_INCOMING_CONNECTION) {
- refreshTargetConnections();
- } else if (event.getChange() == NodeWrapper.ADD_OUTGOING_CONNECTION) {
- refreshSourceConnections();
- } else if (event.getChange() == NodeWrapper.REMOVE_OUTGOING_CONNECTION) {
- refreshSourceConnections();
- } else if (event.getChange() == NodeWrapper.CHANGE_VISUAL) {
- refreshVisuals();
- }
- }
-
- public void activate() {
- super.activate();
- getElementWrapper().addListener(this);
- }
-
- public void deactivate() {
- getElementWrapper().removeListener(this);
- super.deactivate();
- }
-
- public void performRequest(Request request) {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
- performDirectEdit();
- } if (request.getType() == RequestConstants.REQ_OPEN) {
- doubleClicked();
- } else {
- super.performRequest(request);
- }
- }
-
- protected void doubleClicked() {
- // do nothing
- }
-
- protected void performDirectEdit() {
- Label label = ((ElementFigure) getFigure()).getLabel();
- if (label == null) {
- return;
- }
- if (manager == null) {
- manager = new ElementDirectEditManager(this, new CellEditorLocator(label));
- }
- manager.show();
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,150 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * 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.List;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.NodeEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.jboss.tools.flow.common.figure.ElementFigure;
+import org.jboss.tools.flow.common.policy.ElementDirectEditManager;
+import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
+import org.jboss.tools.flow.common.policy.ElementEditPolicy;
+import org.jboss.tools.flow.common.policy.ElementNodeEditPolicy;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Default implementation of an element EditPart.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public abstract class ElementEditPart extends AbstractGraphicalEditPart implements
NodeEditPart, ModelListener {
+
+ private DirectEditManager manager;
+
+ public NodeWrapper getElementWrapper() {
+ return (NodeWrapper) getModel();
+ }
+
+ public ElementFigure getElementFigure() {
+ return (ElementFigure) getFigure();
+ }
+
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ElementNodeEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ElementEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
+ }
+
+ protected List<ConnectionWrapper> getModelSourceConnections() {
+ return getElementWrapper().getOutgoingConnections();
+ }
+
+ protected List<ConnectionWrapper> getModelTargetConnections() {
+ return getElementWrapper().getIncomingConnections();
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
+ return getElementFigure().getSourceConnectionAnchor();
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
+ return getElementFigure().getTargetConnectionAnchor();
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ return getElementFigure().getSourceConnectionAnchor();
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ return getElementFigure().getTargetConnectionAnchor();
+ }
+
+ protected void refreshVisuals() {
+ NodeWrapper element = getElementWrapper();
+ ElementFigure figure = (ElementFigure) getFigure();
+ figure.setText(element.getName());
+ if (element.getConstraint().width == -1) {
+ element.getConstraint().width = figure.getBounds().width;
+ }
+ if (element.getConstraint().height == -1) {
+ element.getConstraint().height = figure.getBounds().height;
+ }
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure,
element.getConstraint());
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == NodeWrapper.ADD_ELEMENT &&
"incomingConnection".equals(event.getChangeDiscriminator())) {
+ refreshTargetConnections();
+ } else if (event.getChangeType() == NodeWrapper.REMOVE_ELEMENT &&
"incomingConnection".equals(event.getChangeDiscriminator())) {
+ refreshTargetConnections();
+ } else if (event.getChangeType() == NodeWrapper.ADD_ELEMENT &&
"outgoingConnection".equals(event.getChangeDiscriminator())) {
+ refreshSourceConnections();
+ } else if (event.getChangeType() == NodeWrapper.REMOVE_ELEMENT &&
"outgoingConnection".equals(event.getChangeDiscriminator())) {
+ refreshSourceConnections();
+ } else if (event.getChangeType() == NodeWrapper.CHANGE_VISUAL) {
+ refreshVisuals();
+ }
+ }
+
+ public void activate() {
+ super.activate();
+ getElementWrapper().addListener(this);
+ }
+
+ public void deactivate() {
+ getElementWrapper().removeListener(this);
+ super.deactivate();
+ }
+
+ public void performRequest(Request request) {
+ if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ performDirectEdit();
+ } if (request.getType() == RequestConstants.REQ_OPEN) {
+ doubleClicked();
+ } else {
+ super.performRequest(request);
+ }
+ }
+
+ protected void doubleClicked() {
+ // do nothing
+ }
+
+ protected void performDirectEdit() {
+ Label label = ((ElementFigure) getFigure()).getLabel();
+ if (label == null) {
+ return;
+ }
+ if (manager == null) {
+ manager = new ElementDirectEditManager(this, new CellEditorLocator(label));
+ }
+ manager.show();
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,134 +0,0 @@
-package org.jboss.tools.flow.common.editpart;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.jboss.tools.flow.common.policy.ElementDirectEditManager;
-import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
-import org.jboss.tools.flow.common.policy.LabelGraphicalNodeEditPolicy;
-import org.jboss.tools.flow.common.wrapper.LabelWrapper;
-import org.jboss.tools.flow.common.wrapper.ModelEvent;
-import org.jboss.tools.flow.common.wrapper.ModelListener;
-import org.jboss.tools.flow.common.wrapper.Wrapper;
-
-public class LabelEditPart extends AbstractGraphicalEditPart implements ModelListener {
-
- private DirectEditManager manager;
-
- @Override
- protected IFigure createFigure() {
- return new Label();
- }
-
- @Override
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new LabelGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
- }
-
- protected void refreshVisuals() {
- String text = getLabelWrapper().getText();
- Polyline polyline = (Polyline)((ConnectionEditPart)getParent()).getConnectionFigure();
- Point location = ((LabelWrapper)getModel()).getLocation();
- if (location == null) {
- location = calculateInitialLocation(polyline, text);
- ((LabelWrapper)getModel()).setLocation(location);
- }
- Label label = (Label)getFigure();
- label.setText(text);
- LabelConstraint constraint = new LabelConstraint(text, location, polyline);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), constraint);
- }
-
- private Point calculateInitialLocation(Polyline polyline, String text) {
- Dimension textDimension = FigureUtilities.getTextExtents(text, figure.getFont());
- return new Point(- (textDimension.width +5) , -(textDimension.height + 5));
- }
-
- public void performRequest(Request request) {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
- performDirectEdit();
- } else {
- super.performRequest(request);
- }
- }
-
- protected void performDirectEdit() {
- Label label = (Label) getFigure();
- if (label == null) {
- return;
- }
- if (manager == null) {
- manager = new ElementDirectEditManager(this, new CellEditorLocator(label));
- }
- manager.show();
- }
-
- public LabelWrapper getLabelWrapper() {
- return (LabelWrapper)getModel();
- }
-
- public DragTracker getDragTracker(Request request) {
- return new DragEditPartsTracker(this) {
- protected EditPart getTargetEditPart() {
- return getParent();
- }
- };
- }
-
- public void activate() {
- super.activate();
- getLabelWrapper().addListener(this);
- if (getParent().getModel() instanceof Wrapper) {
- ((Wrapper)getParent().getModel()).addListener(this);
- }
- }
-
- public void deactivate() {
- if (getParent().getModel() instanceof Wrapper) {
- ((Wrapper)getParent().getModel()).removeListener(this);
- }
- getLabelWrapper().removeListener(this);
- super.deactivate();
- }
-
- public void modelChanged(ModelEvent event) {
- if (event.getChange() == Wrapper.CHANGE_PROPERTY || event.getChange() ==
Wrapper.CHANGE_VISUAL) {
- refreshVisuals();
- }
- }
-
- private class LabelConstraint implements Locator {
- String text;
- Point relativeLocation;
- Polyline polyline;
- public LabelConstraint(String text, Point location, Polyline polyline) {
- this.text = text;
- this.relativeLocation = location;
- this.polyline = polyline;
- }
- public void relocate(IFigure figure) {
- Dimension minimum = FigureUtilities.getTextExtents(text, figure.getFont());
- figure.setSize(minimum);
- Point midPoint = polyline.getPoints().getMidpoint();
- Point newLocation = relativeLocation.getCopy();
- newLocation.translate(midPoint);
- figure.setLocation(newLocation);
- }
- }
-
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,134 @@
+package org.jboss.tools.flow.common.editpart;
+
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.Locator;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gef.tools.DragEditPartsTracker;
+import org.jboss.tools.flow.common.policy.ElementDirectEditManager;
+import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
+import org.jboss.tools.flow.common.policy.LabelGraphicalNodeEditPolicy;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class LabelEditPart extends AbstractGraphicalEditPart implements ModelListener {
+
+ private DirectEditManager manager;
+
+ @Override
+ protected IFigure createFigure() {
+ return new Label();
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new LabelGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
+ }
+
+ protected void refreshVisuals() {
+ String text = getLabelWrapper().getText();
+ Polyline polyline = (Polyline)((ConnectionEditPart)getParent()).getConnectionFigure();
+ Point location = ((LabelWrapper)getModel()).getLocation();
+ if (location == null) {
+ location = calculateInitialLocation(polyline, text);
+ ((LabelWrapper)getModel()).setLocation(location);
+ }
+ Label label = (Label)getFigure();
+ label.setText(text);
+ LabelConstraint constraint = new LabelConstraint(text, location, polyline);
+ ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), constraint);
+ }
+
+ private Point calculateInitialLocation(Polyline polyline, String text) {
+ Dimension textDimension = FigureUtilities.getTextExtents(text, figure.getFont());
+ return new Point(- (textDimension.width +5) , -(textDimension.height + 5));
+ }
+
+ public void performRequest(Request request) {
+ if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ performDirectEdit();
+ } else {
+ super.performRequest(request);
+ }
+ }
+
+ protected void performDirectEdit() {
+ Label label = (Label) getFigure();
+ if (label == null) {
+ return;
+ }
+ if (manager == null) {
+ manager = new ElementDirectEditManager(this, new CellEditorLocator(label));
+ }
+ manager.show();
+ }
+
+ public LabelWrapper getLabelWrapper() {
+ return (LabelWrapper)getModel();
+ }
+
+ public DragTracker getDragTracker(Request request) {
+ return new DragEditPartsTracker(this) {
+ protected EditPart getTargetEditPart() {
+ return getParent();
+ }
+ };
+ }
+
+ public void activate() {
+ super.activate();
+ getLabelWrapper().addListener(this);
+ if (getParent().getModel() instanceof Wrapper) {
+ ((Wrapper)getParent().getModel()).addListener(this);
+ }
+ }
+
+ public void deactivate() {
+ if (getParent().getModel() instanceof Wrapper) {
+ ((Wrapper)getParent().getModel()).removeListener(this);
+ }
+ getLabelWrapper().removeListener(this);
+ super.deactivate();
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == Wrapper.CHANGE_PROPERTY || event.getChangeType() ==
Wrapper.CHANGE_VISUAL) {
+ refreshVisuals();
+ }
+ }
+
+ private class LabelConstraint implements Locator {
+ String text;
+ Point relativeLocation;
+ Polyline polyline;
+ public LabelConstraint(String text, Point location, Polyline polyline) {
+ this.text = text;
+ this.relativeLocation = location;
+ this.polyline = polyline;
+ }
+ public void relocate(IFigure figure) {
+ Dimension minimum = FigureUtilities.getTextExtents(text, figure.getFont());
+ figure.setSize(minimum);
+ Point midPoint = polyline.getPoints().getMidpoint();
+ Point newLocation = relativeLocation.getCopy();
+ newLocation.translate(midPoint);
+ figure.setLocation(newLocation);
+ }
+ }
+
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,124 +0,0 @@
-package org.jboss.tools.flow.common.editpart;
-
-/*
- * 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.List;
-
-import org.eclipse.draw2d.Animation;
-import org.eclipse.draw2d.AutomaticRouter;
-import org.eclipse.draw2d.BendpointConnectionRouter;
-import org.eclipse.draw2d.ConnectionLayer;
-import org.eclipse.draw2d.FanRouter;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
-import org.eclipse.draw2d.ShortestPathConnectionRouter;
-import org.eclipse.draw2d.XYLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.SnapToGrid;
-import org.eclipse.gef.SnapToHelper;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
-import org.eclipse.swt.SWT;
-import org.jboss.tools.flow.common.policy.ElementContainerLayoutEditPolicy;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.FlowWrapper;
-import org.jboss.tools.flow.common.wrapper.ModelEvent;
-import org.jboss.tools.flow.common.wrapper.ModelListener;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * Default implementation of a process EditPart.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class RootEditPart extends AbstractGraphicalEditPart implements ModelListener {
-
- private FlowWrapper getWrapper() {
- return (FlowWrapper) getModel();
- }
-
- protected IFigure createFigure() {
- Figure f = new Figure();
- f.setLayoutManager(new XYLayout());
- return f;
- }
-
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.NODE_ROLE, null);
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new
ElementContainerLayoutEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
- }
-
- protected List<NodeWrapper> getModelChildren() {
- return getWrapper().getElements();
- }
-
- public void activate() {
- super.activate();
- getWrapper().addListener(this);
- }
-
- public void deactivate() {
- getWrapper().removeListener(this);
- super.deactivate();
- }
-
- public void modelChanged(ModelEvent event) {
- if (event.getChange() == ContainerWrapper.ADD_ELEMENT) {
- refreshChildren();
- } else if (event.getChange() == ContainerWrapper.REMOVE_ELEMENT) {
- refreshChildren();
- } else if (event.getChange() == FlowWrapper.CHANGE_VISUAL) {
- refreshVisuals();
- }
- }
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- if (adapter == SnapToHelper.class) {
- Boolean val = (Boolean) getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
- if (val != null && val.booleanValue()) {
- return new SnapToGrid(this);
- }
- }
- return super.getAdapter(adapter);
- }
-
- protected void refreshVisuals() {
- Animation.markBegin();
- ConnectionLayer layer = (ConnectionLayer)
getLayer(LayerConstants.CONNECTION_LAYER);
- if ((getViewer().getControl().getStyle() & SWT.MIRRORED ) == 0) {
- layer.setAntialias(SWT.ON);
- }
-
- if (getWrapper().getRouterLayout().equals(FlowWrapper.ROUTER_LAYOUT_MANUAL)) {
- AutomaticRouter router = new FanRouter();
- router.setNextRouter(new BendpointConnectionRouter());
- layer.setConnectionRouter(router);
- } else if
(getWrapper().getRouterLayout().equals(FlowWrapper.ROUTER_LAYOUT_MANHATTAN)) {
- layer.setConnectionRouter(new ManhattanConnectionRouter());
- } else {
- layer.setConnectionRouter(new ShortestPathConnectionRouter(getFigure()));
- }
- Animation.run(400);
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,124 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * 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.List;
+
+import org.eclipse.draw2d.Animation;
+import org.eclipse.draw2d.AutomaticRouter;
+import org.eclipse.draw2d.BendpointConnectionRouter;
+import org.eclipse.draw2d.ConnectionLayer;
+import org.eclipse.draw2d.FanRouter;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ManhattanConnectionRouter;
+import org.eclipse.draw2d.ShortestPathConnectionRouter;
+import org.eclipse.draw2d.XYLayout;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.SnapToGrid;
+import org.eclipse.gef.SnapToHelper;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
+import org.eclipse.swt.SWT;
+import org.jboss.tools.flow.common.policy.ElementContainerLayoutEditPolicy;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Default implementation of a process EditPart.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class RootEditPart extends AbstractGraphicalEditPart implements ModelListener {
+
+ private FlowWrapper getWrapper() {
+ return (FlowWrapper) getModel();
+ }
+
+ protected IFigure createFigure() {
+ Figure f = new Figure();
+ f.setLayoutManager(new XYLayout());
+ return f;
+ }
+
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.NODE_ROLE, null);
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new
ElementContainerLayoutEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
+ }
+
+ protected List<NodeWrapper> getModelChildren() {
+ return getWrapper().getNodeWrappers();
+ }
+
+ public void activate() {
+ super.activate();
+ getWrapper().addListener(this);
+ }
+
+ public void deactivate() {
+ getWrapper().removeListener(this);
+ super.deactivate();
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == ContainerWrapper.ADD_ELEMENT) {
+ refreshChildren();
+ } else if (event.getChangeType() == ContainerWrapper.REMOVE_ELEMENT) {
+ refreshChildren();
+ } else if (event.getChangeType() == FlowWrapper.CHANGE_VISUAL) {
+ refreshVisuals();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == SnapToHelper.class) {
+ Boolean val = (Boolean) getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
+ if (val != null && val.booleanValue()) {
+ return new SnapToGrid(this);
+ }
+ }
+ return super.getAdapter(adapter);
+ }
+
+ protected void refreshVisuals() {
+ Animation.markBegin();
+ ConnectionLayer layer = (ConnectionLayer)
getLayer(LayerConstants.CONNECTION_LAYER);
+ if ((getViewer().getControl().getStyle() & SWT.MIRRORED ) == 0) {
+ layer.setAntialias(SWT.ON);
+ }
+
+ if (getWrapper().getRouterLayout().equals(FlowWrapper.ROUTER_LAYOUT_MANUAL)) {
+ AutomaticRouter router = new FanRouter();
+ router.setNextRouter(new BendpointConnectionRouter());
+ layer.setConnectionRouter(router);
+ } else if
(getWrapper().getRouterLayout().equals(FlowWrapper.ROUTER_LAYOUT_MANHATTAN)) {
+ layer.setConnectionRouter(new ManhattanConnectionRouter());
+ } else {
+ layer.setConnectionRouter(new ShortestPathConnectionRouter(getFigure()));
+ }
+ Animation.run(400);
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,63 +0,0 @@
-package org.jboss.tools.flow.common.model;
-
-import java.util.HashMap;
-
-public class DefaultConnection implements Connection {
-
- private HashMap<String, Object> metaData = new HashMap<String, Object>();
- private Node from, to;
-
- public DefaultConnection() {
- this(null, null);
- }
-
- public DefaultConnection(Node from, Node to) {
- setFrom(from);
- setTo(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 void setFrom(Node node) {
- if (from != null) {
- from.removeOutgoingConnection(null, this);
- }
- from = node;
- if (from != null) {
- from.addOutgoingConnection(null, this);
- }
- }
-
- public Node getTo() {
- return to;
- }
-
- public void setTo(Node node) {
- if (to != null) {
- to.removeIncomingConnection(null, this);
- }
- to = node;
- if (to != null) {
- to.addIncomingConnection(null, this);
- }
- }
-
- public String getFromType() {
- return null;
- }
-
- public String getToType() {
- return null;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
(from rev 14855,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,53 @@
+package org.jboss.tools.flow.common.model;
+
+
+public class DefaultConnection extends DefaultElement implements Connection {
+
+ private Node from, to;
+
+ public DefaultConnection() {
+ this(null, null);
+ }
+
+ public DefaultConnection(Node from, Node to) {
+ setFrom(from);
+ setTo(to);
+ }
+
+ public Node getFrom() {
+ return from;
+ }
+
+ public void setFrom(Node node) {
+ if (from != null) {
+ from.removeOutgoingConnection(null, this);
+ }
+ from = node;
+ if (from != null) {
+ from.addOutgoingConnection(null, this);
+ }
+ }
+
+ public Node getTo() {
+ return to;
+ }
+
+ public void setTo(Node node) {
+ if (to != null) {
+ to.removeIncomingConnection(null, this);
+ }
+ to = node;
+ if (to != null) {
+ to.addIncomingConnection(null, this);
+ }
+ }
+
+ public String getFromType() {
+ return null;
+ }
+
+ public String getToType() {
+ return null;
+ }
+
+}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
(from rev 14855,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.HashMap;
+
+public class DefaultElement implements Element {
+
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,88 +0,0 @@
-package org.jboss.tools.flow.common.model;
-
-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;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
(from rev 14855,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,88 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class DefaultFlow extends DefaultElement 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:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,87 +0,0 @@
-package org.jboss.tools.flow.common.model;
-
-import java.util.ArrayList;
-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>();
-
- private List<Connection> incomingConnections = new ArrayList<Connection>();
- private List<Connection> outgoingConnections = new ArrayList<Connection>();
-
- 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) {
- incomingConnections.add(connection);
- }
-
- public void addOutgoingConnection(String type, Connection connection) {
- outgoingConnections.add(connection);
- }
-
- public Map<String, List<Connection>> getIncomingConnections() {
- HashMap<String, List<Connection>> result = new HashMap<String,
List<Connection>>();
- result.put(null, getIncomingConnections(null));
- return result;
- }
-
- public List<Connection> getIncomingConnections(String type) {
- return new ArrayList<Connection>(incomingConnections);
- }
-
- public Map<String, List<Connection>> getOutgoingConnections() {
- HashMap<String, List<Connection>> result = new HashMap<String,
List<Connection>>();
- result.put(null, getOutgoingConnections(null));
- return result;
- }
-
- public List<Connection> getOutgoingConnections(String type) {
- return new ArrayList<Connection>(outgoingConnections);
- }
-
- public void removeIncomingConnection(String type, Connection connection) {
- incomingConnections.remove(connection);
- }
-
- public void removeOutgoingConnection(String type, Connection connection) {
- outgoingConnections.remove(connection);
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
(from rev 14855,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,77 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class DefaultNode extends DefaultElement implements Node {
+
+ private long id;
+ private String name;
+ private Container container;
+
+ private List<Connection> incomingConnections = new ArrayList<Connection>();
+ private List<Connection> outgoingConnections = new ArrayList<Connection>();
+
+ 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 Container getNodeContainer() {
+ return container;
+ }
+
+ public void setNodeContainer(Container container) {
+ this.container = container;
+ }
+
+ public void addIncomingConnection(String type, Connection connection) {
+ incomingConnections.add(connection);
+ }
+
+ public void addOutgoingConnection(String type, Connection connection) {
+ outgoingConnections.add(connection);
+ }
+
+ public Map<String, List<Connection>> getIncomingConnections() {
+ HashMap<String, List<Connection>> result = new HashMap<String,
List<Connection>>();
+ result.put(null, getIncomingConnections(null));
+ return result;
+ }
+
+ public List<Connection> getIncomingConnections(String type) {
+ return new ArrayList<Connection>(incomingConnections);
+ }
+
+ public Map<String, List<Connection>> getOutgoingConnections() {
+ HashMap<String, List<Connection>> result = new HashMap<String,
List<Connection>>();
+ result.put(null, getOutgoingConnections(null));
+ return result;
+ }
+
+ public List<Connection> getOutgoingConnections(String type) {
+ return new ArrayList<Connection>(outgoingConnections);
+ }
+
+ public void removeIncomingConnection(String type, Connection connection) {
+ incomingConnections.remove(connection);
+ }
+
+ public void removeOutgoingConnection(String type, Connection connection) {
+ outgoingConnections.remove(connection);
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,61 +0,0 @@
-package org.jboss.tools.flow.common.policy;
-
-/*
- * 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 org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.jboss.tools.flow.common.command.AddElementCommand;
-import org.jboss.tools.flow.common.command.ChangeConstraintCommand;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * Policy for performing layout of a process.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class ElementContainerLayoutEditPolicy extends XYLayoutEditPolicy {
-
- protected Command getCreateCommand(CreateRequest request) {
- AddElementCommand command = new AddElementCommand();
- command.setParent((ContainerWrapper) getHost().getModel());
- NodeWrapper element = (NodeWrapper) request.getNewObject();
- element.setConstraint((Rectangle) getConstraintFor(request));
- command.setChild(element);
- return command;
- }
-
- protected Command getDeleteDependantCommand(Request request) {
- return null;
- }
-
- protected Command createAddCommand(EditPart child, Object constraint) {
- // TODO this is needed to allow dragging of elements from one container to
another
- return null;
- }
-
- protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
- ChangeConstraintCommand command = new ChangeConstraintCommand();
- command.setElement((NodeWrapper) child.getModel());
- command.setConstraint((Rectangle)constraint);
- return command;
- }
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
(from rev 14940,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,61 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * 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 org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.jboss.tools.flow.common.command.AddNodeCommand;
+import org.jboss.tools.flow.common.command.ChangeConstraintCommand;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Policy for performing layout of a process.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class ElementContainerLayoutEditPolicy extends XYLayoutEditPolicy {
+
+ protected Command getCreateCommand(CreateRequest request) {
+ AddNodeCommand command = new AddNodeCommand();
+ command.setParent((ContainerWrapper) getHost().getModel());
+ NodeWrapper element = (NodeWrapper) request.getNewObject();
+ element.setConstraint((Rectangle) getConstraintFor(request));
+ command.setChild(element);
+ return command;
+ }
+
+ protected Command getDeleteDependantCommand(Request request) {
+ return null;
+ }
+
+ protected Command createAddCommand(EditPart child, Object constraint) {
+ // TODO this is needed to allow dragging of elements from one container to
another
+ return null;
+ }
+
+ protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
+ ChangeConstraintCommand command = new ChangeConstraintCommand();
+ command.setElement((NodeWrapper) child.getModel());
+ command.setConstraint((Rectangle)constraint);
+ return command;
+ }
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,41 +0,0 @@
-package org.jboss.tools.flow.common.policy;
-
-/*
- * 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 org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.ComponentEditPolicy;
-import org.eclipse.gef.requests.GroupRequest;
-import org.jboss.tools.flow.common.command.DeleteElementCommand;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * Policy for editing elements.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class ElementEditPolicy extends ComponentEditPolicy {
-
- protected Command createDeleteCommand(GroupRequest deleteRequest) {
- ContainerWrapper parent = (ContainerWrapper) getHost().getParent().getModel();
- DeleteElementCommand deleteCmd = new DeleteElementCommand();
- deleteCmd.setParent(parent);
- deleteCmd.setChild((NodeWrapper) (getHost().getModel()));
- return deleteCmd;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
(from rev 14940,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,41 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * 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 org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.ComponentEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+import org.jboss.tools.flow.common.command.DeleteNodeCommand;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Policy for editing elements.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class ElementEditPolicy extends ComponentEditPolicy {
+
+ protected Command createDeleteCommand(GroupRequest deleteRequest) {
+ ContainerWrapper parent = (ContainerWrapper) getHost().getParent().getModel();
+ DeleteNodeCommand deleteCmd = new DeleteNodeCommand();
+ deleteCmd.setParent(parent);
+ deleteCmd.setChild((NodeWrapper) (getHost().getModel()));
+ return deleteCmd;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,78 +0,0 @@
-package org.jboss.tools.flow.common.properties;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.flow.common.wrapper.Wrapper;
-
-public class WrapperPropertySource implements IPropertySource {
-
- private Wrapper wrapper;
- private IPropertySource elementPropertySource;
-
- public WrapperPropertySource(Wrapper wrapper) {
- this.wrapper = wrapper;
- if (wrapper != null && wrapper.getElement() != null) {
- Object object = wrapper.getElement().getMetaData("propertySource");
- if (object != null && object instanceof IPropertySource) {
- elementPropertySource = (IPropertySource)object;
- }
- }
- }
-
- public Object getEditableValue() {
- if (elementPropertySource != null) {
- return elementPropertySource.getEditableValue();
- }
- return null;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (elementPropertySource != null) {
- return elementPropertySource.getPropertyDescriptors();
- }
- return new IPropertyDescriptor[0];
- }
-
- public Object getPropertyValue(Object id) {
- if (elementPropertySource != null) {
- return elementPropertySource.getPropertyValue(id);
- }
- return null;
- }
-
- public boolean isPropertySet(Object id) {
- if (elementPropertySource != null) {
- return elementPropertySource.isPropertySet(id);
- }
- return false;
- }
-
- public void resetPropertyValue(Object id) {
- if (elementPropertySource != null) {
- elementPropertySource.resetPropertyValue(id);
- }
- }
-
- public void setPropertyValue(Object id, Object value) {
- if (elementPropertySource != null) {
- elementPropertySource.setPropertyValue(id, value);
- wrapper.notifyListeners(Wrapper.CHANGE_PROPERTY, id);
- }
- }
-
- protected Wrapper getWrapper() {
- return wrapper;
- }
-
- protected IPropertyDescriptor[] merge(IPropertyDescriptor[] first, IPropertyDescriptor[]
second) {
- IPropertyDescriptor[] result = new IPropertyDescriptor[first.length + second.length];
- for (int i = 0; i < first.length; i++) {
- result[i] = first[i];
- }
- for (int i = first.length; i < result.length; i++) {
- result[i] = second[i - first.length];
- }
- return result;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,79 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class WrapperPropertySource implements IPropertySource {
+
+ private Wrapper wrapper;
+ private IPropertySource elementPropertySource;
+
+ public WrapperPropertySource(Wrapper wrapper) {
+ this.wrapper = wrapper;
+ if (wrapper != null && wrapper.getElement() != null) {
+ Object object = wrapper.getElement().getMetaData("propertySource");
+ if (object != null && object instanceof IPropertySource) {
+ elementPropertySource = (IPropertySource)object;
+ }
+ }
+ }
+
+ public Object getEditableValue() {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getEditableValue();
+ }
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getPropertyDescriptors();
+ }
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getPropertyValue(id);
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (elementPropertySource != null) {
+ return elementPropertySource.isPropertySet(id);
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ if (elementPropertySource != null) {
+ elementPropertySource.resetPropertyValue(id);
+ }
+ }
+
+ public void setPropertyValue(Object id, Object newValue) {
+ if (elementPropertySource != null) {
+ Object oldValue = elementPropertySource.getPropertyValue(id);
+ elementPropertySource.setPropertyValue(id, newValue);
+ wrapper.notifyListeners(Wrapper.CHANGE_PROPERTY, id, wrapper, oldValue, newValue);
+ }
+ }
+
+ protected Wrapper getWrapper() {
+ return wrapper;
+ }
+
+ protected IPropertyDescriptor[] merge(IPropertyDescriptor[] first, IPropertyDescriptor[]
second) {
+ IPropertyDescriptor[] result = new IPropertyDescriptor[first.length + second.length];
+ for (int i = 0; i < first.length; i++) {
+ result[i] = first[i];
+ }
+ for (int i = first.length; i < result.length; i++) {
+ result[i] = second[i - first.length];
+ }
+ return result;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,322 +0,0 @@
-package org.jboss.tools.flow.common.registry;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gef.requests.CreationFactory;
-import org.jboss.tools.flow.common.Logger;
-import org.jboss.tools.flow.common.model.Connection;
-import org.jboss.tools.flow.common.model.Container;
-import org.jboss.tools.flow.common.model.Element;
-import org.jboss.tools.flow.common.model.Flow;
-import org.jboss.tools.flow.common.model.Node;
-import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
-import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
-import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
-import org.jboss.tools.flow.common.wrapper.DefaultLabelWrapper;
-import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
-import org.jboss.tools.flow.common.wrapper.Wrapper;
-
-public class ElementRegistry {
-
- private static final String elementsExtensionPointId =
"org.jboss.tools.flow.common.elements";
- private static HashMap<String, IConfigurationElement> elementMap = null;
-
-
- private static void initializeRegistry() {
- elementMap = new HashMap<String, IConfigurationElement>();
- IConfigurationElement[] configurationElements =
- Platform.getExtensionRegistry().getConfigurationElementsFor(elementsExtensionPointId);
- for (IConfigurationElement configurationElement: configurationElements) {
- elementMap.put(configurationElement.getAttribute("id"),
configurationElement);
- }
- }
-
- private static Wrapper createWrapper(IConfigurationElement configurationElement)
- throws CoreException {
- IConfigurationElement[] children = configurationElement.getChildren();
- if (children.length != 1) return null;
- String type = children[0].getName();
- if ("flow".equals(type)) {
- return createFlow(configurationElement);
- } else if ("container".equals(type)) {
- return createContainer(configurationElement);
- } else if ("node".equals(type)) {
- return createNode(configurationElement);
- } else if ("connection".equals(type)) {
- return createConnection(configurationElement);
- } else {
- return null;
- }
- }
-
- private static Wrapper createConnection(IConfigurationElement configurationElement)
- throws CoreException {
- Object element = configurationElement.createExecutableExtension("class");
- if (!(element instanceof Connection)) {
- String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Connection instance.";
- Logger.logError(message, new RuntimeException(message));
- return null;
- }
- ((Element)element).setMetaData("configurationElement",
configurationElement);
- ConnectionWrapper result = new DefaultConnectionWrapper();
- result.setElement((Element)element);
- result.setLabel(new DefaultLabelWrapper(result));
- return result;
- }
-
- private static Wrapper createNode(IConfigurationElement configurationElement)
- throws CoreException {
- Object element = configurationElement.createExecutableExtension("class");
- if (!(element instanceof Node)) {
- String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Node instance.";
- Logger.logError(message, new RuntimeException(message));
- return null;
- }
- ((Node)element).setMetaData("configurationElement", configurationElement);
- DefaultNodeWrapper result = new DefaultNodeWrapper();
- result.setElement((Element)element);
- AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy =
createAcceptsIncomingConnectionStrategy(configurationElement);
- if (acceptsIncomingConnectionStrategy != null) {
- acceptsIncomingConnectionStrategy.setNode((Node)element);
- result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
- }
- AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy =
createAcceptsOutgoingConnectionStrategy(configurationElement);
- if (acceptsOutgoingConnectionStrategy != null) {
- acceptsOutgoingConnectionStrategy.setNode((Node)element);
- result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
- }
- ((Node)element).setName(configurationElement.getAttribute("name"));
- return result;
- }
-
- private static Wrapper createContainer(IConfigurationElement configurationElement)
- throws CoreException {
- Object element = configurationElement.createExecutableExtension("class");
- if (!(element instanceof Container)) {
- String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Container instance.";
- Logger.logError(message, new RuntimeException(message));
- return null;
- }
- ((Element) element).setMetaData("configurationElement",
configurationElement);
- DefaultContainerWrapper result = new DefaultContainerWrapper();
- result.setElement((Element)element);
- AcceptsElementStrategy acceptsElementStrategy =
createAcceptsElementStrategy(configurationElement);
- if (acceptsElementStrategy != null) {
- acceptsElementStrategy.setContainer((Container)element);
- result.setAcceptsElementStrategy(acceptsElementStrategy);
- }
- AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy =
createAcceptsIncomingConnectionStrategy(configurationElement);
- if (acceptsIncomingConnectionStrategy != null) {
- acceptsIncomingConnectionStrategy.setNode((Node)element);
- result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
- }
- AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy =
createAcceptsOutgoingConnectionStrategy(configurationElement);
- if (acceptsOutgoingConnectionStrategy != null) {
- acceptsOutgoingConnectionStrategy.setNode((Node)element);
- result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
- }
- if (element instanceof Node) {
- ((Node)element).setName(configurationElement.getAttribute("name"));
- }
- return result;
- }
-
- private static AcceptsIncomingConnectionStrategy
createAcceptsIncomingConnectionStrategy(IConfigurationElement configurationElement)
- throws CoreException {
- Object result = null;
- IConfigurationElement[] children = configurationElement.getChildren();
- if (children[0].getAttribute("acceptsIncomingConnectionStrategy") != null) {
- result =
children[0].createExecutableExtension("acceptsIncomingConnectionStrategy");
- }
- return (AcceptsIncomingConnectionStrategy)result;
- }
-
- private static AcceptsOutgoingConnectionStrategy
createAcceptsOutgoingConnectionStrategy(IConfigurationElement configurationElement)
- throws CoreException {
- Object result = null;
- IConfigurationElement[] children = configurationElement.getChildren();
- if (children[0].getAttribute("acceptsOutgoingConnectionStrategy") != null) {
- result =
children[0].createExecutableExtension("acceptsOutgoingConnectionStrategy");
- }
- return (AcceptsOutgoingConnectionStrategy)result;
- }
-
- private static AcceptsElementStrategy createAcceptsElementStrategy(IConfigurationElement
configurationElement)
- throws CoreException {
- Object result = null;
- IConfigurationElement[] children = configurationElement.getChildren();
- if (children[0].getAttribute("acceptsElementStrategy") != null) {
- result = children[0].createExecutableExtension("acceptsElementStrategy");
- }
- return (AcceptsElementStrategy)result;
- }
-
- private static Wrapper createFlow(IConfigurationElement configurationElement)
- throws CoreException {
- Object element = configurationElement.createExecutableExtension("class");
- if (!(element instanceof Container)) {
- String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Container instance.";
- Logger.logError(message, new RuntimeException(message));
- return null;
- }
- ((Element) element).setMetaData("configurationElement",
configurationElement);
- DefaultFlowWrapper result = new DefaultFlowWrapper();
- result.setElement((Element)element);
- AcceptsElementStrategy acceptsElementStrategy =
createAcceptsElementStrategy(configurationElement);
- if (acceptsElementStrategy != null) {
- acceptsElementStrategy.setContainer((Container)result.getElement());
- result.setAcceptsElementStrategy(acceptsElementStrategy);
- }
- if (element instanceof Flow) {
- ((Flow)element).setName(configurationElement.getAttribute("name"));
- }
- return result;
- }
-
-// private static EditPart createConnectionEditPart(final IConfigurationElement
configurationElement) {
-// return new ConnectionEditPart() {
-// };
-// }
-//
-// private static EditPart createNodeEditPart(final IConfigurationElement
configurationElement) {
-// return new ElementEditPart() {
-// protected IFigure createFigure() {
-// ElementFigure result = null;
-// IConfigurationElement figureElement = null;
-// IConfigurationElement[] children =
configurationElement.getChildren("node");
-// if (children.length == 1) {
-// children = children[0].getChildren("figure");
-// if (children.length == 1) {
-// figureElement = children[0];
-// }
-// }
-// if (figureElement == null) {
-// return new RectangleElementFigure();
-// }
-// if (figureElement.getAttribute("class") != null) {
-// try {
-// return (IFigure)figureElement.createExecutableExtension("class");
-// }
-// catch (CoreException e) {
-// return null;
-// }
-// }
-// children = figureElement.getChildren();
-// if (children.length < 1) {
-// result = new RectangleElementFigure();
-// } else if ("ellipse".equals(children[0].getName())){
-// result = new EllipseElementFigure();
-// } else if ("rounded-rectangle".equals(children[0].getName())) {
-// result = new RoundedRectangleElementFigure();
-// } else {
-// result = new RectangleElementFigure();
-// }
-// if (figureElement.getAttribute("icon") != null) {
-// String iconPath = figureElement.getAttribute("icon");
-// URL url =
Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
-// Image icon = null;
-// if (imageMap.containsKey(url.getPath())) {
-// icon = imageMap.get(url.getPath());
-// } else {
-// icon = ImageDescriptor.createFromURL(url).createImage();
-// imageMap.put(url.getPath(), icon);
-// }
-// result.setIcon(icon);
-// } else if (configurationElement.getAttribute("figure") != null) {
-// String iconPath = configurationElement.getAttribute("figure");
-// URL url =
Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
-// Image icon = null;
-// if (imageMap.containsKey(url.getPath())) {
-// icon = imageMap.get(url.getPath());
-// } else {
-// icon = ImageDescriptor.createFromURL(url).createImage();
-// imageMap.put(url.getPath(), icon);
-// }
-// result.setIcon(icon);
-// }
-// if (figureElement.getAttribute("color") != null) {
-// String colorString = figureElement.getAttribute("color");
-// Color color = null;
-// if (colorMap.containsKey(colorString)) {
-// color = colorMap.get(colorString);
-// } else {
-// try {
-// StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
-// int[] rgb = new int[3];
-// int i = 0;
-// while (tokenizer.hasMoreTokens()) {
-// rgb[i++] = Integer.parseInt(tokenizer.nextToken());
-// }
-// color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
-// colorMap.put(colorString, color);
-// } catch (NumberFormatException e) {}
-// }
-// result.setColor(color);
-// }
-// Dimension size = new Dimension(result.getSize());
-// if (figureElement.getAttribute("width") != null) {
-// try {
-// size.width = Integer.parseInt(figureElement.getAttribute("width"));
-// } catch (NumberFormatException e) {}
-// }
-// if (figureElement.getAttribute("height") != null) {
-// try {
-// size.height = Integer.parseInt(figureElement.getAttribute("height"));
-// } catch (NumberFormatException e) {}
-// }
-// result.setSize(size);
-// return result;
-// }
-// };
-// }
-
- public static Wrapper createWrapper(String elementId) {
- if (elementMap == null) {
- initializeRegistry();
- }
- IConfigurationElement configurationElement = elementMap.get(elementId);
- if (configurationElement != null) {
- try {
- return createWrapper(configurationElement);
- } catch (CoreException e) {
- Logger.logError("Creating a wrapper for " + elementId + "
failed.", e);
- return null;
- }
- } else {
- return null;
- }
- }
-
- public static IConfigurationElement getConfigurationElement(String elementId) {
- return elementMap.get(elementId);
- }
-
- public static CreationFactory getCreationFactory(final String elementId) {
- return new CreationFactory() {
- public Object getNewObject() {
- return createWrapper(elementId);
- }
- public Object getObjectType() {
- return elementId;
- }
- };
- }
-
- public static CreationFactory getCreationFactory(Element element) {
- String id = null;
- IConfigurationElement configurationElement =
- (IConfigurationElement)element.getMetaData("configurationElement");
- if (configurationElement != null) {
- id = configurationElement.getAttribute("id");
- }
- return id == null ? null : getCreationFactory(id);
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
(from rev 14968,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,340 @@
+package org.jboss.tools.flow.common.registry;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.flow.common.Logger;
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.Container;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.model.Flow;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultLabelWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class ElementRegistry {
+
+ private static final String elementsExtensionPointId =
"org.jboss.tools.flow.common.elements";
+ private static HashMap<String, IConfigurationElement> elementMap = null;
+
+
+ private static void initializeRegistry() {
+ elementMap = new HashMap<String, IConfigurationElement>();
+ IConfigurationElement[] configurationElements =
+ Platform.getExtensionRegistry().getConfigurationElementsFor(elementsExtensionPointId);
+ for (IConfigurationElement configurationElement: configurationElements) {
+ elementMap.put(configurationElement.getAttribute("id"),
configurationElement);
+ }
+ }
+
+ private static Wrapper createWrapper(IConfigurationElement configurationElement)
+ throws CoreException {
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children.length > 1) return null;
+ if (children.length == 0) {
+ return createDefault(configurationElement);
+ }
+ String type = children[0].getName();
+ if ("flow".equals(type)) {
+ return createFlow(configurationElement);
+ } else if ("container".equals(type)) {
+ return createContainer(configurationElement);
+ } else if ("node".equals(type)) {
+ return createNode(configurationElement);
+ } else if ("connection".equals(type)) {
+ return createConnection(configurationElement);
+ } else {
+ return null;
+ }
+ }
+
+ private static Wrapper createDefault(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Element)) {
+ String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Element instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element)element).setMetaData("configurationElement",
configurationElement);
+ DefaultWrapper result = new DefaultWrapper();
+ result.setElement((Element)element);
+ return result;
+ }
+
+ private static Wrapper createConnection(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Connection)) {
+ String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Connection instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element)element).setMetaData("configurationElement",
configurationElement);
+ ConnectionWrapper result = new DefaultConnectionWrapper();
+ result.setElement((Element)element);
+ result.setLabel(new DefaultLabelWrapper(result));
+ return result;
+ }
+
+ private static Wrapper createNode(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Node)) {
+ String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Node instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Node)element).setMetaData("configurationElement", configurationElement);
+ DefaultNodeWrapper result = new DefaultNodeWrapper();
+ result.setElement((Element)element);
+ AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy =
createAcceptsIncomingConnectionStrategy(configurationElement);
+ if (acceptsIncomingConnectionStrategy != null) {
+ acceptsIncomingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
+ }
+ AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy =
createAcceptsOutgoingConnectionStrategy(configurationElement);
+ if (acceptsOutgoingConnectionStrategy != null) {
+ acceptsOutgoingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
+ }
+ ((Node)element).setName(configurationElement.getAttribute("name"));
+ return result;
+ }
+
+ private static Wrapper createContainer(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Container)) {
+ String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Container instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element) element).setMetaData("configurationElement",
configurationElement);
+ DefaultContainerWrapper result = new DefaultContainerWrapper();
+ result.setElement((Element)element);
+ AcceptsElementStrategy acceptsElementStrategy =
createAcceptsElementStrategy(configurationElement);
+ if (acceptsElementStrategy != null) {
+ acceptsElementStrategy.setContainer((Container)element);
+ result.setAcceptsElementStrategy(acceptsElementStrategy);
+ }
+ AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy =
createAcceptsIncomingConnectionStrategy(configurationElement);
+ if (acceptsIncomingConnectionStrategy != null) {
+ acceptsIncomingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
+ }
+ AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy =
createAcceptsOutgoingConnectionStrategy(configurationElement);
+ if (acceptsOutgoingConnectionStrategy != null) {
+ acceptsOutgoingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
+ }
+ if (element instanceof Node) {
+ ((Node)element).setName(configurationElement.getAttribute("name"));
+ }
+ return result;
+ }
+
+ private static AcceptsIncomingConnectionStrategy
createAcceptsIncomingConnectionStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsIncomingConnectionStrategy") != null) {
+ result =
children[0].createExecutableExtension("acceptsIncomingConnectionStrategy");
+ }
+ return (AcceptsIncomingConnectionStrategy)result;
+ }
+
+ private static AcceptsOutgoingConnectionStrategy
createAcceptsOutgoingConnectionStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsOutgoingConnectionStrategy") != null) {
+ result =
children[0].createExecutableExtension("acceptsOutgoingConnectionStrategy");
+ }
+ return (AcceptsOutgoingConnectionStrategy)result;
+ }
+
+ private static AcceptsElementStrategy createAcceptsElementStrategy(IConfigurationElement
configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsElementStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsElementStrategy");
+ }
+ return (AcceptsElementStrategy)result;
+ }
+
+ private static Wrapper createFlow(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Container)) {
+ String message = "Expecting to instantiate a
org.jboss.tools.flow.common.model.Container instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element) element).setMetaData("configurationElement",
configurationElement);
+ DefaultFlowWrapper result = new DefaultFlowWrapper();
+ result.setElement((Element)element);
+ AcceptsElementStrategy acceptsElementStrategy =
createAcceptsElementStrategy(configurationElement);
+ if (acceptsElementStrategy != null) {
+ acceptsElementStrategy.setContainer((Container)result.getElement());
+ result.setAcceptsElementStrategy(acceptsElementStrategy);
+ }
+ if (element instanceof Flow) {
+ ((Flow)element).setName(configurationElement.getAttribute("name"));
+ }
+ return result;
+ }
+
+// private static EditPart createConnectionEditPart(final IConfigurationElement
configurationElement) {
+// return new ConnectionEditPart() {
+// };
+// }
+//
+// private static EditPart createNodeEditPart(final IConfigurationElement
configurationElement) {
+// return new ElementEditPart() {
+// protected IFigure createFigure() {
+// ElementFigure result = null;
+// IConfigurationElement figureElement = null;
+// IConfigurationElement[] children =
configurationElement.getChildren("node");
+// if (children.length == 1) {
+// children = children[0].getChildren("figure");
+// if (children.length == 1) {
+// figureElement = children[0];
+// }
+// }
+// if (figureElement == null) {
+// return new RectangleElementFigure();
+// }
+// if (figureElement.getAttribute("class") != null) {
+// try {
+// return (IFigure)figureElement.createExecutableExtension("class");
+// }
+// catch (CoreException e) {
+// return null;
+// }
+// }
+// children = figureElement.getChildren();
+// if (children.length < 1) {
+// result = new RectangleElementFigure();
+// } else if ("ellipse".equals(children[0].getName())){
+// result = new EllipseElementFigure();
+// } else if ("rounded-rectangle".equals(children[0].getName())) {
+// result = new RoundedRectangleElementFigure();
+// } else {
+// result = new RectangleElementFigure();
+// }
+// if (figureElement.getAttribute("icon") != null) {
+// String iconPath = figureElement.getAttribute("icon");
+// URL url =
Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
+// Image icon = null;
+// if (imageMap.containsKey(url.getPath())) {
+// icon = imageMap.get(url.getPath());
+// } else {
+// icon = ImageDescriptor.createFromURL(url).createImage();
+// imageMap.put(url.getPath(), icon);
+// }
+// result.setIcon(icon);
+// } else if (configurationElement.getAttribute("figure") != null) {
+// String iconPath = configurationElement.getAttribute("figure");
+// URL url =
Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
+// Image icon = null;
+// if (imageMap.containsKey(url.getPath())) {
+// icon = imageMap.get(url.getPath());
+// } else {
+// icon = ImageDescriptor.createFromURL(url).createImage();
+// imageMap.put(url.getPath(), icon);
+// }
+// result.setIcon(icon);
+// }
+// if (figureElement.getAttribute("color") != null) {
+// String colorString = figureElement.getAttribute("color");
+// Color color = null;
+// if (colorMap.containsKey(colorString)) {
+// color = colorMap.get(colorString);
+// } else {
+// try {
+// StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
+// int[] rgb = new int[3];
+// int i = 0;
+// while (tokenizer.hasMoreTokens()) {
+// rgb[i++] = Integer.parseInt(tokenizer.nextToken());
+// }
+// color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
+// colorMap.put(colorString, color);
+// } catch (NumberFormatException e) {}
+// }
+// result.setColor(color);
+// }
+// Dimension size = new Dimension(result.getSize());
+// if (figureElement.getAttribute("width") != null) {
+// try {
+// size.width = Integer.parseInt(figureElement.getAttribute("width"));
+// } catch (NumberFormatException e) {}
+// }
+// if (figureElement.getAttribute("height") != null) {
+// try {
+// size.height = Integer.parseInt(figureElement.getAttribute("height"));
+// } catch (NumberFormatException e) {}
+// }
+// result.setSize(size);
+// return result;
+// }
+// };
+// }
+
+ public static Wrapper createWrapper(String elementId) {
+ if (elementMap == null) {
+ initializeRegistry();
+ }
+ IConfigurationElement configurationElement = elementMap.get(elementId);
+ if (configurationElement != null) {
+ try {
+ return createWrapper(configurationElement);
+ } catch (CoreException e) {
+ Logger.logError("Creating a wrapper for " + elementId + "
failed.", e);
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public static IConfigurationElement getConfigurationElement(String elementId) {
+ return elementMap.get(elementId);
+ }
+
+ public static CreationFactory getCreationFactory(final String elementId) {
+ return new CreationFactory() {
+ public Object getNewObject() {
+ return createWrapper(elementId);
+ }
+ public Object getObjectType() {
+ return elementId;
+ }
+ };
+ }
+
+ public static CreationFactory getCreationFactory(Element element) {
+ String id = null;
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement != null) {
+ id = configurationElement.getAttribute("id");
+ }
+ return id == null ? null : getCreationFactory(id);
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,70 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-/*
- * 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.List;
-
-public abstract class AbstractContainerWrapper extends AbstractNodeWrapper implements
ContainerWrapper {
-
- List<NodeWrapper> elements = new ArrayList<NodeWrapper>();
-
- public void addElement(NodeWrapper element) {
- internalAddElement(element);
- localAddElement(element);
- notifyListeners(ADD_ELEMENT, element);
- }
-
- public void localAddElement(NodeWrapper element) {
- elements.add(element);
- element.setParent(this);
- }
-
- protected abstract void internalAddElement(NodeWrapper element);
-
- public void removeElement(NodeWrapper element) {
- internalRemoveElement(element);
- elements.remove(element);
- element.setParent(null);
- notifyListeners(REMOVE_ELEMENT, element);
- }
-
- protected abstract void internalRemoveElement(NodeWrapper element);
-
- public List<NodeWrapper> getElements() {
- return elements;
- }
-
- public FlowWrapper getFlowWrapper() {
- return getParent().getFlowWrapper();
- }
-
- public boolean acceptsElement(NodeWrapper element) {
- return true;
- }
-
- public boolean acceptsIncomingConnection(
- ConnectionWrapper connection, NodeWrapper source) {
- return true;
- }
-
- public boolean acceptsOutgoingConnection(
- ConnectionWrapper connection, NodeWrapper target) {
- return true;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,70 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * 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.List;
+
+public abstract class AbstractContainerWrapper extends AbstractNodeWrapper implements
ContainerWrapper {
+
+ List<NodeWrapper> elements = new ArrayList<NodeWrapper>();
+
+ public void addElement(NodeWrapper element) {
+ internalAddElement(element);
+ localAddElement(element);
+ notifyListeners(ADD_ELEMENT, "node", this, null, element);
+ }
+
+ public void localAddElement(NodeWrapper element) {
+ elements.add(element);
+ element.setParent(this);
+ }
+
+ protected abstract void internalAddElement(NodeWrapper element);
+
+ public void removeElement(NodeWrapper element) {
+ internalRemoveElement(element);
+ elements.remove(element);
+ element.setParent(null);
+ notifyListeners(REMOVE_ELEMENT, "node", this, element, null);
+ }
+
+ protected abstract void internalRemoveElement(NodeWrapper element);
+
+ public List<NodeWrapper> getNodeWrappers() {
+ return elements;
+ }
+
+ public FlowWrapper getFlowWrapper() {
+ return getParent().getFlowWrapper();
+ }
+
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
+ public boolean acceptsIncomingConnection(
+ ConnectionWrapper connection, NodeWrapper source) {
+ return true;
+ }
+
+ public boolean acceptsOutgoingConnection(
+ ConnectionWrapper connection, NodeWrapper target) {
+ return true;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,106 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-/*
- * 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 FlowWrapper
{
-
- private Map<String, NodeWrapper> elementMap = new HashMap<String,
NodeWrapper>();
- private List<NodeWrapper> elementList = new ArrayList<NodeWrapper>();
- private transient List<ModelListener> listeners = new
ArrayList<ModelListener>();
-
- public abstract Integer getRouterLayout();
-
- public void setRouterLayout(Integer routerLayout) {
- internalSetRouterLayout(routerLayout);
- notifyListeners(CHANGE_VISUAL, null);
- }
-
- protected void internalSetRouterLayout(Integer routerLayout) {
- }
-
- public List<NodeWrapper> getElements() {
- return Collections.unmodifiableList(
- new ArrayList<NodeWrapper>(elementList));
- }
-
- public NodeWrapper getElement(String id) {
- return (NodeWrapper) elementMap.get(id);
- }
-
- public void addElement(NodeWrapper element) {
- if (!acceptsElement(element)) return;
- internalAddElement(element);
- localAddElement(element);
- notifyListeners(ADD_ELEMENT, element);
- }
-
- public void localAddElement(NodeWrapper element) {
- elementMap.put(element.getId(), element);
- elementList.add(element);
- element.setParent(this);
- }
-
- public boolean acceptsElement(NodeWrapper element) {
- return true;
- }
-
- protected abstract void internalAddElement(NodeWrapper element);
-
- public void localRemoveElement(NodeWrapper element) {
- elementMap.remove(element.getId());
- elementList.remove(element);
- }
-
- public void removeElement(NodeWrapper element) {
- localRemoveElement(element);
- internalRemoveElement(element);
- notifyListeners(REMOVE_ELEMENT, element);
- }
-
- protected abstract void internalRemoveElement(NodeWrapper element);
-
- public FlowWrapper getFlowWrapper() {
- return this;
- }
-
- public void addListener(ModelListener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(ModelListener listener) {
- listeners.remove(listener);
- }
-
- protected void notifyListeners(int change, NodeWrapper wrapper) {
- ModelEvent event = new ModelEvent(change, wrapper);
- for (ModelListener listener: listeners) {
- listener.modelChanged(event);
- }
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,91 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * 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 FlowWrapper
{
+
+ private Map<String, NodeWrapper> nodeWrapperMap = new HashMap<String,
NodeWrapper>();
+ private List<NodeWrapper> nodeWrapperList = new
ArrayList<NodeWrapper>();
+
+ public abstract Integer getRouterLayout();
+
+ public void setRouterLayout(Integer newLayout) {
+ Integer oldLayout = getRouterLayout();
+ internalSetRouterLayout(newLayout);
+ notifyListeners(CHANGE_VISUAL, "routerLayout", this, oldLayout,
newLayout);
+ }
+
+ protected void internalSetRouterLayout(Integer routerLayout) {
+ }
+
+ public List<NodeWrapper> getNodeWrappers() {
+ return Collections.unmodifiableList(
+ new ArrayList<NodeWrapper>(nodeWrapperList));
+ }
+
+ public NodeWrapper getNodeWrapper(String id) {
+ return (NodeWrapper) nodeWrapperMap.get(id);
+ }
+
+ public void addElement(NodeWrapper nodeWrapper) {
+ if (!acceptsElement(nodeWrapper)) return;
+ internalAddElement(nodeWrapper);
+ localAddElement(nodeWrapper);
+ notifyListeners(ADD_ELEMENT, "node", this, null, nodeWrapper);
+ }
+
+ public void localAddElement(NodeWrapper element) {
+ nodeWrapperMap.put(element.getId(), element);
+ nodeWrapperList.add(element);
+ element.setParent(this);
+ }
+
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
+ protected abstract void internalAddElement(NodeWrapper element);
+
+ public void localRemoveElement(NodeWrapper element) {
+ nodeWrapperMap.remove(element.getId());
+ nodeWrapperList.remove(element);
+ }
+
+ public void removeElement(NodeWrapper element) {
+ localRemoveElement(element);
+ internalRemoveElement(element);
+ notifyListeners(REMOVE_ELEMENT, "node", this, element, null);
+ }
+
+ protected abstract void internalRemoveElement(NodeWrapper element);
+
+ public FlowWrapper getFlowWrapper() {
+ return this;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,29 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-import org.eclipse.draw2d.geometry.Point;
-
-public abstract class AbstractLabelWrapper extends AbstractWrapper implements
- LabelWrapper {
-
- private Point location = null;
-
- public Point getLocation() {
- return location;
- }
-
- public String getText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void setLocation(Point location) {
- this.location = location;
- notifyListeners(CHANGE_VISUAL, this);
- }
-
- public void setText(String text) {
- // TODO Auto-generated method stub
-
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,30 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.draw2d.geometry.Point;
+
+public abstract class AbstractLabelWrapper extends AbstractWrapper implements
+ LabelWrapper {
+
+ private Point location = null;
+
+ public Point getLocation() {
+ return location;
+ }
+
+ public String getText() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setLocation(Point newLocation) {
+ Point oldLocation = this.location;
+ this.location = newLocation;
+ notifyListeners(CHANGE_VISUAL, "location", this, oldLocation, newLocation);
+ }
+
+ public void setText(String text) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,142 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-/*
- * 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.List;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-/**
- * Default wrapper of a model element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public abstract class AbstractNodeWrapper extends AbstractWrapper implements NodeWrapper
{
-
- protected static IPropertyDescriptor[] descriptors;
-
- public static final String NAME = "Name";
- static {
- descriptors = new IPropertyDescriptor[] {
- new TextPropertyDescriptor(NAME, "Name"),
- };
- }
-
- private ContainerWrapper parent;
- private LabelWrapper label;
- private transient Rectangle constraint;
- private List<ConnectionWrapper> incomingConnections = new
ArrayList<ConnectionWrapper>();
- private List<ConnectionWrapper> outgoingConnections = new
ArrayList<ConnectionWrapper>();
-
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
- internalSetConstraint(constraint);
- notifyListeners(CHANGE_VISUAL, this);
- }
-
- protected abstract void internalSetConstraint(Rectangle constraint);
-
- public Rectangle getConstraint() {
- if (constraint == null) {
- constraint = internalGetConstraint();
- }
- return constraint;
- }
-
- protected abstract Rectangle internalGetConstraint();
-
- public void setParent(ContainerWrapper parent) {
- this.parent = parent;
- }
-
- public ContainerWrapper getParent() {
- return parent;
- }
-
- public void setLabel(LabelWrapper label) {
- this.label = label;
- }
-
- public LabelWrapper getLabel() {
- return label;
- }
-
- public List<ConnectionWrapper> getOutgoingConnections() {
- return Collections.unmodifiableList(outgoingConnections);
- }
-
- public List<ConnectionWrapper> getIncomingConnections() {
- return Collections.unmodifiableList(incomingConnections);
- }
-
- public void addIncomingConnection(ConnectionWrapper connection) {
- localAddIncomingConnection(connection);
- internalAddIncomingConnection(connection);
- notifyListeners(ADD_INCOMING_CONNECTION, connection);
- }
-
- public void localAddIncomingConnection(ConnectionWrapper connection) {
- incomingConnections.add(connection);
- }
-
- protected void internalAddIncomingConnection(ConnectionWrapper connection) {
- }
-
- public void removeIncomingConnection(ConnectionWrapper connection) {
- incomingConnections.remove(connection);
- internalRemoveIncomingConnection(connection);
- notifyListeners(REMOVE_INCOMING_CONNECTION, connection);
- }
-
- protected void internalRemoveIncomingConnection(ConnectionWrapper connection) {
- }
-
- public void addOutgoingConnection(ConnectionWrapper connection) {
- localAddOutgoingConnection(connection);
- internalAddOutgoingConnection(connection);
- notifyListeners(ADD_OUTGOING_CONNECTION, connection);
- }
-
- public void localAddOutgoingConnection(ConnectionWrapper connection) {
- outgoingConnections.add(connection);
- }
-
- protected void internalAddOutgoingConnection(ConnectionWrapper connection) {
- }
-
- public void removeOutgoingConnection(ConnectionWrapper connection) {
- outgoingConnections.remove(connection);
- internalRemoveOutgoingConnection(connection);
- notifyListeners(REMOVE_OUTGOING_CONNECTION, connection);
- }
-
- protected void internalRemoveOutgoingConnection(ConnectionWrapper connection) {
- }
-
- public void setName(String name) {
- internalSetName(name);
- notifyListeners(CHANGE_VISUAL, this);
- }
-
- protected void internalSetName(String name) {
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,144 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * 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.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+/**
+ * Default wrapper of a model element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public abstract class AbstractNodeWrapper extends AbstractWrapper implements NodeWrapper
{
+
+ protected static IPropertyDescriptor[] descriptors;
+
+ public static final String NAME = "Name";
+ static {
+ descriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name"),
+ };
+ }
+
+ private ContainerWrapper parent;
+ private LabelWrapper label;
+ private transient Rectangle constraint;
+ private List<ConnectionWrapper> incomingConnections = new
ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new
ArrayList<ConnectionWrapper>();
+
+ public void setConstraint(Rectangle constraint) {
+ Rectangle oldConstraint = this.constraint;
+ this.constraint = constraint;
+ internalSetConstraint(constraint);
+ notifyListeners(CHANGE_VISUAL, "constraint", this, oldConstraint,
constraint);
+ }
+
+ protected abstract void internalSetConstraint(Rectangle constraint);
+
+ public Rectangle getConstraint() {
+ if (constraint == null) {
+ constraint = internalGetConstraint();
+ }
+ return constraint;
+ }
+
+ protected abstract Rectangle internalGetConstraint();
+
+ public void setParent(ContainerWrapper parent) {
+ this.parent = parent;
+ }
+
+ public ContainerWrapper getParent() {
+ return parent;
+ }
+
+ public void setLabel(LabelWrapper label) {
+ this.label = label;
+ }
+
+ public LabelWrapper getLabel() {
+ return label;
+ }
+
+ public List<ConnectionWrapper> getOutgoingConnections() {
+ return Collections.unmodifiableList(outgoingConnections);
+ }
+
+ public List<ConnectionWrapper> getIncomingConnections() {
+ return Collections.unmodifiableList(incomingConnections);
+ }
+
+ public void addIncomingConnection(ConnectionWrapper connection) {
+ localAddIncomingConnection(connection);
+ internalAddIncomingConnection(connection);
+ notifyListeners(ADD_ELEMENT, "incomingConnection", this, null, connection);
+ }
+
+ public void localAddIncomingConnection(ConnectionWrapper connection) {
+ incomingConnections.add(connection);
+ }
+
+ protected void internalAddIncomingConnection(ConnectionWrapper connection) {
+ }
+
+ public void removeIncomingConnection(ConnectionWrapper connection) {
+ incomingConnections.remove(connection);
+ internalRemoveIncomingConnection(connection);
+ notifyListeners(REMOVE_ELEMENT, "incomingConnection", this, connection,
null);
+ }
+
+ protected void internalRemoveIncomingConnection(ConnectionWrapper connection) {
+ }
+
+ public void addOutgoingConnection(ConnectionWrapper connection) {
+ localAddOutgoingConnection(connection);
+ internalAddOutgoingConnection(connection);
+ notifyListeners(ADD_ELEMENT, "outgoingConnection", this, null, connection);
+ }
+
+ public void localAddOutgoingConnection(ConnectionWrapper connection) {
+ outgoingConnections.add(connection);
+ }
+
+ protected void internalAddOutgoingConnection(ConnectionWrapper connection) {
+ }
+
+ public void removeOutgoingConnection(ConnectionWrapper connection) {
+ outgoingConnections.remove(connection);
+ internalRemoveOutgoingConnection(connection);
+ notifyListeners(REMOVE_ELEMENT, "outgoingConnection", this, connection,
null);
+ }
+
+ protected void internalRemoveOutgoingConnection(ConnectionWrapper connection) {
+ }
+
+ public void setName(String newLocation) {
+ String oldName = getName();
+ internalSetName(newLocation);
+ notifyListeners(CHANGE_VISUAL, "name", this, oldName, newLocation);
+ }
+
+ protected void internalSetName(String name) {
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,93 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.flow.common.model.Element;
-
-public abstract class AbstractWrapper implements Wrapper {
-
- private Element element;
- private transient List<ModelListener> listeners = new
ArrayList<ModelListener>();
-
- public void setElement(Element element) {
- this.element = element;
- }
-
- public Element getElement() {
- return element;
- }
-
- public void addListener(ModelListener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(ModelListener listener) {
- listeners.remove(listener);
- }
-
- public void notifyListeners(int change, Object object) {
- ModelEvent event = new ModelEvent(change, object);
- for (ModelListener listener: listeners) {
- listener.modelChanged(event);
- }
- }
-
- public void notifyListeners(int change) {
- notifyListeners(change, null);
- }
-
- public Object getEditableValue() {
- if (getPropertySource() != null) {
- getPropertySource().getEditableValue();
- }
- return null;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (getPropertySource() != null) {
- return getPropertySource().getPropertyDescriptors();
- }
- return null;
- }
-
- public Object getPropertyValue(Object id) {
- if (getPropertySource() != null) {
- return getPropertySource().getPropertyValue(id);
- }
- return null;
- }
-
- public boolean isPropertySet(Object id) {
- if (getPropertySource() != null) {
- return getPropertySource().isPropertySet(id);
- }
- return false;
- }
-
- public void resetPropertyValue(Object id) {
- if (getPropertySource() != null) {
- getPropertySource().resetPropertyValue(id);
- }
- }
-
- public void setPropertyValue(Object id, Object value) {
- if (getPropertySource() != null) {
- getPropertySource().setPropertyValue(id, value);
- notifyListeners(CHANGE_PROPERTY, id);
- }
- }
-
- protected abstract IPropertySource getPropertySource();
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- if (adapter == Element.class) {
- return element;
- }
- return null;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
(from rev 14950,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,163 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Element;
+
+public abstract class AbstractWrapper implements Wrapper {
+
+ private Element element;
+ private transient List<ModelListener> listeners = new
ArrayList<ModelListener>();
+ private Map<Object, List<Element>> children = new HashMap<Object,
List<Element>>();
+
+ public void setElement(Element element) {
+ this.element = element;
+ }
+
+ public Element getElement() {
+ return element;
+ }
+
+ public void addChild(Object type, Element element) {
+ localAddChild(type, element);
+ internalAddChild(type, element);
+ notifyListeners(ADD_ELEMENT, type, this, null, element);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void internalAddChild(Object type, Element element) {
+ Object childList = getPropertyValue(type);
+ if (childList == null || !(childList instanceof List)) return;
+ ((List)childList).add(element);
+ }
+
+ public void localAddChild(Object type, Element element) {
+ List<Element> childList = children.get(type);
+ if (childList == null) {
+ childList = new ArrayList<Element>();
+ children.put(type, childList);
+ }
+ childList.add(element);
+ }
+
+ public void removeChild(Object type, Element element) {
+ localRemoveChild(type, element);
+ internalRemoveChild(type, element);
+ notifyListeners(REMOVE_ELEMENT, type, this, element, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void internalRemoveChild(Object type, Element element) {
+ Object childList = getPropertyValue(type);
+ if (childList == null || !(childList instanceof List)) return;
+ ((List)childList).remove(element);
+ }
+
+ public void localRemoveChild(Object type, Element element) {
+ List<Element> childList = children.get(type);
+ if (childList == null) return;
+ childList.remove(element);
+ if (childList.isEmpty()) {
+ children.remove(type);
+ }
+ }
+
+ public List<Element> getChildren(Object type) {
+ return children.get(type);
+ }
+
+ public void setMetaData(String name, Object value) {
+ if (element != null) {
+ element.setMetaData(name, value);
+ }
+ }
+
+ public Object getMetaData(String name) {
+ if (element != null) {
+ return element.getMetaData(name);
+ }
+ return null;
+ }
+
+ public void addListener(ModelListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(ModelListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void notifyListeners(int type, Object discriminator, Object object, Object
oldValue, Object newValue) {
+ notifyListeners(new ModelEvent(type, discriminator, object, oldValue, newValue));
+ }
+
+ public void notifyListeners(ModelEvent event) {
+ for (ModelListener listener: listeners) {
+ listener.modelChanged(event);
+ }
+ }
+
+ public void notifyListeners(int change) {
+ notifyListeners(change, null, null, null, null);
+ }
+
+ public Object getEditableValue() {
+ if (getPropertySource() != null) {
+ getPropertySource().getEditableValue();
+ }
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (getPropertySource() != null) {
+ return getPropertySource().getPropertyDescriptors();
+ }
+ return null;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (getPropertySource() != null) {
+ return getPropertySource().getPropertyValue(id);
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (getPropertySource() != null) {
+ return getPropertySource().isPropertySet(id);
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ if (getPropertySource() != null) {
+ getPropertySource().resetPropertyValue(id);
+ }
+ }
+
+ public void setPropertyValue(Object id, Object newValue) {
+ if (getPropertySource() != null) {
+ Object oldValue = getPropertySource().getPropertyValue(id);
+ getPropertySource().setPropertyValue(id, newValue);
+ notifyListeners(CHANGE_PROPERTY, id, this, oldValue, newValue);
+ }
+ }
+
+ protected abstract IPropertySource getPropertySource();
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == Element.class) {
+ return element;
+ } else if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return null;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,35 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-/*
- * 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.List;
-
-public interface ContainerWrapper extends Wrapper {
-
- void addElement(NodeWrapper element);
-
- void localAddElement(NodeWrapper element);
-
- void removeElement(NodeWrapper element);
-
- List<NodeWrapper> getElements();
-
- FlowWrapper getFlowWrapper();
-
- boolean acceptsElement(NodeWrapper element);
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,35 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * 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.List;
+
+public interface ContainerWrapper extends Wrapper {
+
+ void addElement(NodeWrapper element);
+
+ void localAddElement(NodeWrapper element);
+
+ void removeElement(NodeWrapper element);
+
+ List<NodeWrapper> getNodeWrappers();
+
+ FlowWrapper getFlowWrapper();
+
+ boolean acceptsElement(NodeWrapper element);
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,44 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.flow.common.properties.IPropertyId;
-import org.jboss.tools.flow.common.properties.WrapperPropertySource;
-
-public class DefaultLabelWrapper extends AbstractLabelWrapper implements ModelListener {
-
- private IPropertySource propertySource;
-
- public DefaultLabelWrapper(Wrapper owner) {
- if (owner != null) {
- setElement(owner.getElement());
- }
- }
-
- public void setText(String text) {
- getPropertySource().setPropertyValue(IPropertyId.LABEL, text);
- }
-
- public String getText() {
- return (String)getPropertySource().getPropertyValue(IPropertyId.LABEL);
- }
-
- public void modelChanged(ModelEvent event) {
- notifyListeners(event.getChange(), event.getChangedObject());
- }
-
- protected IPropertySource getPropertySource() {
- if (propertySource == null) {
- propertySource = new WrapperPropertySource(this);
- }
- return propertySource;
- }
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- if (adapter == IPropertySource.class) {
- return this;
- }
- return super.getAdapter(adapter);
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,44 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+import org.jboss.tools.flow.common.properties.WrapperPropertySource;
+
+public class DefaultLabelWrapper extends AbstractLabelWrapper implements ModelListener {
+
+ private IPropertySource propertySource;
+
+ public DefaultLabelWrapper(Wrapper owner) {
+ if (owner != null) {
+ setElement(owner.getElement());
+ }
+ }
+
+ public void setText(String text) {
+ getPropertySource().setPropertyValue(IPropertyId.LABEL, text);
+ }
+
+ public String getText() {
+ return (String)getPropertySource().getPropertyValue(IPropertyId.LABEL);
+ }
+
+ public void modelChanged(ModelEvent event) {
+ notifyListeners(event);
+ }
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new WrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java
(from rev 14858,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.properties.WrapperPropertySource;
+
+public class DefaultWrapper extends AbstractWrapper {
+
+ private WrapperPropertySource propertySource;
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new WrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,14 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-public interface FlowWrapper extends ContainerWrapper {
-
- Integer ROUTER_LAYOUT_MANUAL = new Integer(0);
- Integer ROUTER_LAYOUT_MANHATTAN = new Integer(1);
- Integer ROUTER_LAYOUT_SHORTEST_PATH = new Integer(2);
-
-
- NodeWrapper getElement(String id);
-
- Object getRouterLayout();
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,14 @@
+package org.jboss.tools.flow.common.wrapper;
+
+public interface FlowWrapper extends ContainerWrapper {
+
+ Integer ROUTER_LAYOUT_MANUAL = new Integer(0);
+ Integer ROUTER_LAYOUT_MANHATTAN = new Integer(1);
+ Integer ROUTER_LAYOUT_SHORTEST_PATH = new Integer(2);
+
+
+ NodeWrapper getNodeWrapper(String id);
+
+ Object getRouterLayout();
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,46 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-/*
- * 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.
- */
-
-/**
- * Event notifying a change in a model element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
- */
-public class ModelEvent {
-
- private int change;
- private Object changedObject;
-
- public ModelEvent(int change) {
- this.change = change;
- }
-
- public ModelEvent(int change, Object changedObject) {
- this.change = change;
- this.changedObject = changedObject;
- }
-
- public int getChange() {
- return change;
- }
-
- public Object getChangedObject() {
- return changedObject;
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
(from rev 14839,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,69 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * 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.
+ */
+
+/**
+ * Event notifying a change in a model element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris
Verlaenen</a>
+ */
+public class ModelEvent {
+
+ private int changeType;
+ private Object changeDiscriminator;
+ private Object changedObject;
+ private Object oldValue;
+ private Object newValue;
+
+// public ModelEvent(int changeType) {
+// this.changeType = changeType;
+// }
+
+// public ModelEvent(int changeType, Object changedObject) {
+// this.changeType = changeType;
+// this.changedObject = changedObject;
+// }
+
+ public ModelEvent(int changeType, Object changeDiscriminator, Object changedObject,
Object oldValue, Object newValue) {
+ this.changeType = changeType;
+ this.changeDiscriminator = changeDiscriminator;
+ this.changedObject = changedObject;
+ this.oldValue = oldValue;
+ this.newValue = newValue;
+ }
+
+ public int getChangeType() {
+ return changeType;
+ }
+
+ public Object getChangeDiscriminator() {
+ return changeDiscriminator;
+ }
+
+ public Object getChangedObject() {
+ return changedObject;
+ }
+
+ public Object getOldValue() {
+ return oldValue;
+ }
+
+ public Object getNewValue() {
+ return newValue;
+ }
+
+}
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -1,28 +0,0 @@
-package org.jboss.tools.flow.common.wrapper;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.flow.common.model.Element;
-
-
-public interface Wrapper extends IAdaptable, IPropertySource {
-
- int ADD_INCOMING_CONNECTION = 1;
- int REMOVE_INCOMING_CONNECTION = 2;
- int ADD_OUTGOING_CONNECTION = 3;
- int REMOVE_OUTGOING_CONNECTION = 4;
- int CHANGE_VISUAL = 5;
- int ADD_ELEMENT = 6;
- int REMOVE_ELEMENT = 7;
- int CHANGE_PROPERTY = 8;
-
-
-
- void setElement(Element element);
- Element getElement();
-
- void addListener(ModelListener listener);
- void removeListener(ModelListener listener);
- void notifyListeners(int changeId, Object changedObject);
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
(from rev 14856,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2009-05-11
15:55:21 UTC (rev 15174)
@@ -0,0 +1,34 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Element;
+
+
+public interface Wrapper extends IAdaptable, IPropertySource, Element {
+
+// int ADD_INCOMING_CONNECTION = 1;
+// int REMOVE_INCOMING_CONNECTION = 2;
+// int ADD_OUTGOING_CONNECTION = 3;
+// int REMOVE_OUTGOING_CONNECTION = 4;
+ int CHANGE_VISUAL = 5;
+ int ADD_ELEMENT = 6;
+ int REMOVE_ELEMENT = 7;
+ int CHANGE_PROPERTY = 8;
+
+
+
+ void setElement(Element element);
+ Element getElement();
+
+ void addChild(Object type, Element element);
+ void removeChild(Object type, Element element);
+ List<Element> getChildren(Object type);
+
+ void addListener(ModelListener listener);
+ void removeListener(ModelListener listener);
+ void notifyListeners(int changeId, Object changeDiscriminator, Object changedObject,
Object oldValue, Object newValue);
+
+}