You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2006/02/22 00:40:29 UTC
svn commit: r379627 [31/34] - in /incubator/servicemix/trunk: ./ etc/
sandbox/servicemix-wsn-1.2/src/sa/META-INF/
sandbox/servicemix-wsn-1.2/src/su/META-INF/ servicemix-assembly/
servicemix-assembly/src/main/assembly/ servicemix-assembly/src/main/relea...
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/AbstractConnectableService.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/AbstractConnectableService.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/AbstractConnectableService.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/AbstractConnectableService.java Tue Feb 21 15:40:05 2006
@@ -1,115 +1,115 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.servicemix.descriptors.packaging.assets.Connection;
-import org.apache.servicemix.packaging.DeployerEditor;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * An abstract connectionable (ie. has a Service Name) service which can be
- * either a BC or an SU
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public abstract class AbstractConnectableService extends AbstractComponent
- implements Connectable {
-
- public static final String SOURCE_CONNECTIONS_PROP = "Component.SourceConn";
-
- public static final String TARGET_CONNECTIONS_PROP = "Component.TargetConn";
-
- protected static Image createImage(String name) {
- InputStream stream = DeployerEditor.class.getResourceAsStream(name);
- Image image = new Image(null, stream);
- try {
- stream.close();
- } catch (IOException ioe) {
- }
- return image;
- }
-
- private ConnectionDecorator connectionDecorator;
-
- protected QName serviceName = null;
-
- List<ComponentConnection> sourceConnections = new ArrayList<ComponentConnection>();
-
- List<ComponentConnection> targetConnections = new ArrayList<ComponentConnection>();
-
- public AbstractConnectableService() {
- connectionDecorator = new ConnectionDecorator(this);
- addPropertyChangeListener(connectionDecorator);
- }
-
- public void addConnection(ComponentConnection conn) {
- if (conn == null || conn.getSource() == conn.getTarget()) {
- throw new IllegalArgumentException();
- }
- if (conn.getSource() == this) {
- sourceConnections.add(conn);
- firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
- } else if (conn.getTarget() == this) {
- targetConnections.add(conn);
- firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
- }
- }
-
- public void refreshConnections() {
- firePropertyChange(SERVICENAME_PROP, null, null);
- }
-
- public QName getServiceName() {
- for (Connection connection : getStoredAssets().getConnection()) {
- System.out.println("got "+connection.getType());
- if ("provides".equals(connection.getType())) {
- System.out.println("Returning "+connection.getQname());
- return connection.getQname();
- }
- }
- return null;
- }
-
- public List<ComponentConnection> getSourceConnections() {
- return new ArrayList<ComponentConnection>(sourceConnections);
- }
-
- public List getTargetConnections() {
- return new ArrayList<ComponentConnection>(targetConnections);
- }
-
- public void removeConnection(ComponentConnection conn) {
- if (conn == null) {
- throw new IllegalArgumentException();
- }
- if (conn.getSource() == this) {
- sourceConnections.remove(conn);
- firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
- } else if (conn.getTarget() == this) {
- targetConnections.remove(conn);
- firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
- }
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.descriptors.packaging.assets.Connection;
+import org.apache.servicemix.packaging.DeployerEditor;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * An abstract connectionable (ie. has a Service Name) service which can be
+ * either a BC or an SU
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public abstract class AbstractConnectableService extends AbstractComponent
+ implements Connectable {
+
+ public static final String SOURCE_CONNECTIONS_PROP = "Component.SourceConn";
+
+ public static final String TARGET_CONNECTIONS_PROP = "Component.TargetConn";
+
+ protected static Image createImage(String name) {
+ InputStream stream = DeployerEditor.class.getResourceAsStream(name);
+ Image image = new Image(null, stream);
+ try {
+ stream.close();
+ } catch (IOException ioe) {
+ }
+ return image;
+ }
+
+ private ConnectionDecorator connectionDecorator;
+
+ protected QName serviceName = null;
+
+ List<ComponentConnection> sourceConnections = new ArrayList<ComponentConnection>();
+
+ List<ComponentConnection> targetConnections = new ArrayList<ComponentConnection>();
+
+ public AbstractConnectableService() {
+ connectionDecorator = new ConnectionDecorator(this);
+ addPropertyChangeListener(connectionDecorator);
+ }
+
+ public void addConnection(ComponentConnection conn) {
+ if (conn == null || conn.getSource() == conn.getTarget()) {
+ throw new IllegalArgumentException();
+ }
+ if (conn.getSource() == this) {
+ sourceConnections.add(conn);
+ firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
+ } else if (conn.getTarget() == this) {
+ targetConnections.add(conn);
+ firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
+ }
+ }
+
+ public void refreshConnections() {
+ firePropertyChange(SERVICENAME_PROP, null, null);
+ }
+
+ public QName getServiceName() {
+ for (Connection connection : getStoredAssets().getConnection()) {
+ System.out.println("got "+connection.getType());
+ if ("provides".equals(connection.getType())) {
+ System.out.println("Returning "+connection.getQname());
+ return connection.getQname();
+ }
+ }
+ return null;
+ }
+
+ public List<ComponentConnection> getSourceConnections() {
+ return new ArrayList<ComponentConnection>(sourceConnections);
+ }
+
+ public List getTargetConnections() {
+ return new ArrayList<ComponentConnection>(targetConnections);
+ }
+
+ public void removeConnection(ComponentConnection conn) {
+ if (conn == null) {
+ throw new IllegalArgumentException();
+ }
+ if (conn.getSource() == this) {
+ sourceConnections.remove(conn);
+ firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
+ } else if (conn.getTarget() == this) {
+ targetConnections.remove(conn);
+ firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
+ }
+ }
+
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/AbstractConnectableService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/BindingComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ComponentBased.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ComponentBased.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ComponentBased.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ComponentBased.java Tue Feb 21 15:40:05 2006
@@ -1,34 +1,34 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model;
-
-import org.apache.servicemix.packaging.ComponentArtifact;
-
-/**
- * The ComponentBased interface can be used to identify whether a model element
- * has an underlying component
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public interface ComponentBased {
-
- public ComponentArtifact getComponentArtifact();
-
- public String getComponentName();
-
- public void setComponentName(String componentName);
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model;
+
+import org.apache.servicemix.packaging.ComponentArtifact;
+
+/**
+ * The ComponentBased interface can be used to identify whether a model element
+ * has an underlying component
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public interface ComponentBased {
+
+ public ComponentArtifact getComponentArtifact();
+
+ public String getComponentName();
+
+ public void setComponentName(String componentName);
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ComponentBased.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ComponentConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/Connectable.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/Connectable.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/Connectable.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/Connectable.java Tue Feb 21 15:40:05 2006
@@ -1,36 +1,36 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model;
-
-import java.util.List;
-
-/**
- * The Connectable interface can be used to determine whether a JBI component or
- * service unit is connectable to another (ie. has a service name)
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public interface Connectable {
-
- public void addConnection(ComponentConnection connection);
-
- public void removeConnection(ComponentConnection connection);
-
- public List<ComponentConnection> getSourceConnections();
-
- public List<ComponentConnection> getTargetConnections();
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model;
+
+import java.util.List;
+
+/**
+ * The Connectable interface can be used to determine whether a JBI component or
+ * service unit is connectable to another (ie. has a service name)
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public interface Connectable {
+
+ public void addConnection(ComponentConnection connection);
+
+ public void removeConnection(ComponentConnection connection);
+
+ public List<ComponentConnection> getSourceConnections();
+
+ public List<ComponentConnection> getTargetConnections();
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/Connectable.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ConnectionDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ConnectionDecorator.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ConnectionDecorator.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ConnectionDecorator.java Tue Feb 21 15:40:05 2006
@@ -1,79 +1,79 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import org.apache.servicemix.descriptors.packaging.assets.Connection;
-import org.apache.servicemix.packaging.parts.descriptors.ServiceNameHelper;
-
-/**
- * A connection decorator handles the construction of connections between
- * connectables based on their stored assets and resource references
- *
- * TODO Should ConnectionDecorator be an interface to allow different types?
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ConnectionDecorator implements PropertyChangeListener {
-
- private AbstractConnectableService component;
-
- public ConnectionDecorator(AbstractConnectableService component) {
- this.component = component;
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if ((!evt.getPropertyName().equals(
- AbstractConnectableService.SOURCE_CONNECTIONS_PROP))
- && (!evt.getPropertyName().equals(
- AbstractConnectableService.TARGET_CONNECTIONS_PROP))) {
- retargetConnections();
- }
-
- }
-
- private void retargetConnections() {
- for (ComponentConnection connection : component.getSourceConnections()) {
- component.removeConnection(connection);
- }
- for (Connection reference : component.getStoredAssets().getConnection()) {
- if ("consumes".equals(reference.getType())) {
- Connectable target = ServiceNameHelper.getConnectableByQName(
- getDeploymentDiagram(component), reference.getQname());
- if ((target != null) && (!target.equals(component))) {
- ComponentConnection connection = new ComponentConnection(
- component, target);
- component.addConnection(connection);
- }
- }
- }
-
- }
-
- private DeploymentDiagram getDeploymentDiagram(
- AbstractConnectableService component2) {
- if (component2.getParentModelElement() instanceof DeploymentDiagram)
- return (DeploymentDiagram) component2.getParentModelElement();
- else if (component2.getParentModelElement() instanceof ServiceAssembly)
- return (DeploymentDiagram) ((ServiceAssembly) component2
- .getParentModelElement()).getParentModelElement();
- return null;
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.apache.servicemix.descriptors.packaging.assets.Connection;
+import org.apache.servicemix.packaging.parts.descriptors.ServiceNameHelper;
+
+/**
+ * A connection decorator handles the construction of connections between
+ * connectables based on their stored assets and resource references
+ *
+ * TODO Should ConnectionDecorator be an interface to allow different types?
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ConnectionDecorator implements PropertyChangeListener {
+
+ private AbstractConnectableService component;
+
+ public ConnectionDecorator(AbstractConnectableService component) {
+ this.component = component;
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if ((!evt.getPropertyName().equals(
+ AbstractConnectableService.SOURCE_CONNECTIONS_PROP))
+ && (!evt.getPropertyName().equals(
+ AbstractConnectableService.TARGET_CONNECTIONS_PROP))) {
+ retargetConnections();
+ }
+
+ }
+
+ private void retargetConnections() {
+ for (ComponentConnection connection : component.getSourceConnections()) {
+ component.removeConnection(connection);
+ }
+ for (Connection reference : component.getStoredAssets().getConnection()) {
+ if ("consumes".equals(reference.getType())) {
+ Connectable target = ServiceNameHelper.getConnectableByQName(
+ getDeploymentDiagram(component), reference.getQname());
+ if ((target != null) && (!target.equals(component))) {
+ ComponentConnection connection = new ComponentConnection(
+ component, target);
+ component.addConnection(connection);
+ }
+ }
+ }
+
+ }
+
+ private DeploymentDiagram getDeploymentDiagram(
+ AbstractConnectableService component2) {
+ if (component2.getParentModelElement() instanceof DeploymentDiagram)
+ return (DeploymentDiagram) component2.getParentModelElement();
+ else if (component2.getParentModelElement() instanceof ServiceAssembly)
+ return (DeploymentDiagram) ((ServiceAssembly) component2
+ .getParentModelElement()).getParentModelElement();
+ return null;
+ }
+
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ConnectionDecorator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/DeploymentDiagram.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/DeploymentDiagram.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/DeploymentDiagram.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/DeploymentDiagram.java Tue Feb 21 15:40:05 2006
@@ -1,93 +1,93 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-/**
- * The base of the deployment diagram model
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-@XmlRootElement
-public class DeploymentDiagram extends ModelElement {
-
- public static final String CHILD_ADDED_PROP = "DeploymentDiagram.ChildAdded";
-
- public static final String CHILD_REMOVED_PROP = "DeploymentDiagram.ChildRemoved";
-
- private static final long serialVersionUID = 1;
-
- private String deployPath = "/apps/servicemix-3.0/deploy";
-
- private String installPath = "/apps/servicemix-3.0/install";
-
- private List<AbstractComponent> services = new ArrayList<AbstractComponent>();
-
- public boolean addChild(AbstractComponent s) {
- s.setParentModelElement(this);
- if (s != null && services.add(s)) {
- firePropertyChange(CHILD_ADDED_PROP, null, s);
- return true;
- }
- return false;
- }
-
- @XmlTransient
- public List<AbstractComponent> getChildren() {
- return services;
- }
-
- public String getDeployPath() {
- return deployPath;
- }
-
- public String getInstallPath() {
- return installPath;
- }
-
- public List<AbstractComponent> getService() {
- return services;
- }
-
- public boolean removeChild(AbstractComponent component) {
- if (component != null && services.remove(component)) {
- firePropertyChange(CHILD_REMOVED_PROP, null, component);
- return true;
- }
- return false;
- }
-
- public void setDeployPath(String deployPath) {
- this.deployPath = deployPath;
- }
-
- public void setInstallPath(String installPath) {
- this.installPath = installPath;
- }
-
- public void setService(List<AbstractComponent> services) {
- for (AbstractComponent component : services) {
- component.setParentModelElement(this);
- }
- this.services = services;
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+/**
+ * The base of the deployment diagram model
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+@XmlRootElement
+public class DeploymentDiagram extends ModelElement {
+
+ public static final String CHILD_ADDED_PROP = "DeploymentDiagram.ChildAdded";
+
+ public static final String CHILD_REMOVED_PROP = "DeploymentDiagram.ChildRemoved";
+
+ private static final long serialVersionUID = 1;
+
+ private String deployPath = "/apps/servicemix-3.0/deploy";
+
+ private String installPath = "/apps/servicemix-3.0/install";
+
+ private List<AbstractComponent> services = new ArrayList<AbstractComponent>();
+
+ public boolean addChild(AbstractComponent s) {
+ s.setParentModelElement(this);
+ if (s != null && services.add(s)) {
+ firePropertyChange(CHILD_ADDED_PROP, null, s);
+ return true;
+ }
+ return false;
+ }
+
+ @XmlTransient
+ public List<AbstractComponent> getChildren() {
+ return services;
+ }
+
+ public String getDeployPath() {
+ return deployPath;
+ }
+
+ public String getInstallPath() {
+ return installPath;
+ }
+
+ public List<AbstractComponent> getService() {
+ return services;
+ }
+
+ public boolean removeChild(AbstractComponent component) {
+ if (component != null && services.remove(component)) {
+ firePropertyChange(CHILD_REMOVED_PROP, null, component);
+ return true;
+ }
+ return false;
+ }
+
+ public void setDeployPath(String deployPath) {
+ this.deployPath = deployPath;
+ }
+
+ public void setInstallPath(String installPath) {
+ this.installPath = installPath;
+ }
+
+ public void setService(List<AbstractComponent> services) {
+ for (AbstractComponent component : services) {
+ component.setParentModelElement(this);
+ }
+ this.services = services;
+ }
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/DeploymentDiagram.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ModelElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ServiceAssembly.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ServiceUnit.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ServiceUnit.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ServiceUnit.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ServiceUnit.java Tue Feb 21 15:40:05 2006
@@ -1,61 +1,61 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.apache.servicemix.packaging.ComponentArtifact;
-
-/**
- * An instance of a Service Unit
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ServiceUnit extends AbstractConnectableService implements
- ComponentBased {
-
- private static final long serialVersionUID = -4682078748821423318L;
-
- public ServiceAssembly parentAssembly;
-
- private String serviceUnitName = "serviceUnit";
-
- public ComponentArtifact getComponentArtifact() {
- return ((ServiceAssembly) getParentModelElement())
- .getComponentArtifact();
- }
-
- @XmlTransient
- public String getComponentName() {
- return ((ServiceAssembly) getParentModelElement()).getComponentName();
- }
-
- @XmlAttribute
- public String getServiceUnitName() {
- return serviceUnitName;
- }
-
- public void setComponentName(String serviceUuid) {
- // ignore?
- }
-
- public void setServiceUnitName(String serviceUnitName) {
- this.serviceUnitName = serviceUnitName;
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.servicemix.packaging.ComponentArtifact;
+
+/**
+ * An instance of a Service Unit
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ServiceUnit extends AbstractConnectableService implements
+ ComponentBased {
+
+ private static final long serialVersionUID = -4682078748821423318L;
+
+ public ServiceAssembly parentAssembly;
+
+ private String serviceUnitName = "serviceUnit";
+
+ public ComponentArtifact getComponentArtifact() {
+ return ((ServiceAssembly) getParentModelElement())
+ .getComponentArtifact();
+ }
+
+ @XmlTransient
+ public String getComponentName() {
+ return ((ServiceAssembly) getParentModelElement()).getComponentName();
+ }
+
+ @XmlAttribute
+ public String getServiceUnitName() {
+ return serviceUnitName;
+ }
+
+ public void setComponentName(String serviceUuid) {
+ // ignore?
+ }
+
+ public void setServiceUnitName(String serviceUnitName) {
+ this.serviceUnitName = serviceUnitName;
+ }
+
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/ServiceUnit.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentCreateCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentCreateCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentCreateCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentCreateCommand.java Tue Feb 21 15:40:05 2006
@@ -1,61 +1,61 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import org.apache.servicemix.packaging.model.AbstractComponent;
-import org.apache.servicemix.packaging.model.DeploymentDiagram;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.commands.Command;
-
-/**
- * The GEF command for creating a component
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ComponentCreateCommand extends Command {
-
- private DeploymentDiagram parent;
-
- private Rectangle bounds;
-
- private AbstractComponent component;
-
- public ComponentCreateCommand(AbstractComponent component,
- DeploymentDiagram parent, Rectangle bounds) {
- this.component = component;
- this.parent = parent;
- this.bounds = bounds;
- setLabel("create");
- }
-
- public boolean canExecute() {
- return component != null && parent != null && bounds != null;
- }
-
- public void execute() {
- component.setLocation(bounds.getLocation());
- redo();
- }
-
- public void redo() {
- parent.addChild(component);
- }
-
- public void undo() {
- parent.removeChild(component);
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import org.apache.servicemix.packaging.model.AbstractComponent;
+import org.apache.servicemix.packaging.model.DeploymentDiagram;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.commands.Command;
+
+/**
+ * The GEF command for creating a component
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ComponentCreateCommand extends Command {
+
+ private DeploymentDiagram parent;
+
+ private Rectangle bounds;
+
+ private AbstractComponent component;
+
+ public ComponentCreateCommand(AbstractComponent component,
+ DeploymentDiagram parent, Rectangle bounds) {
+ this.component = component;
+ this.parent = parent;
+ this.bounds = bounds;
+ setLabel("create");
+ }
+
+ public boolean canExecute() {
+ return component != null && parent != null && bounds != null;
+ }
+
+ public void execute() {
+ component.setLocation(bounds.getLocation());
+ redo();
+ }
+
+ public void redo() {
+ parent.addChild(component);
+ }
+
+ public void undo() {
+ parent.removeChild(component);
+ }
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentCreateCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentDeleteCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentDeleteCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentDeleteCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentDeleteCommand.java Tue Feb 21 15:40:05 2006
@@ -1,61 +1,61 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import org.apache.servicemix.packaging.model.AbstractComponent;
-import org.apache.servicemix.packaging.model.DeploymentDiagram;
-import org.eclipse.gef.commands.Command;
-
-/**
- * The GEF command for deleting a component
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ComponentDeleteCommand extends Command {
-
- private final AbstractComponent child;
-
- private final DeploymentDiagram parent;
-
- private boolean wasRemoved;
-
- public ComponentDeleteCommand(DeploymentDiagram parent,
- AbstractComponent component) {
- if (parent == null || component == null) {
- throw new IllegalArgumentException();
- }
- setLabel("component deletion");
- this.parent = parent;
- this.child = component;
- }
-
- public boolean canUndo() {
- return wasRemoved;
- }
-
- public void execute() {
- redo();
- }
-
- public void redo() {
- parent.removeChild(child);
- }
-
- public void undo() {
- parent.addChild(child);
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import org.apache.servicemix.packaging.model.AbstractComponent;
+import org.apache.servicemix.packaging.model.DeploymentDiagram;
+import org.eclipse.gef.commands.Command;
+
+/**
+ * The GEF command for deleting a component
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ComponentDeleteCommand extends Command {
+
+ private final AbstractComponent child;
+
+ private final DeploymentDiagram parent;
+
+ private boolean wasRemoved;
+
+ public ComponentDeleteCommand(DeploymentDiagram parent,
+ AbstractComponent component) {
+ if (parent == null || component == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("component deletion");
+ this.parent = parent;
+ this.child = component;
+ }
+
+ public boolean canUndo() {
+ return wasRemoved;
+ }
+
+ public void execute() {
+ redo();
+ }
+
+ public void redo() {
+ parent.removeChild(child);
+ }
+
+ public void undo() {
+ parent.addChild(child);
+ }
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentDeleteCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentSetConstraintCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentSetConstraintCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentSetConstraintCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentSetConstraintCommand.java Tue Feb 21 15:40:05 2006
@@ -1,70 +1,70 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import org.apache.servicemix.packaging.model.AbstractComponent;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-
-public class ComponentSetConstraintCommand extends Command {
-
- private final Rectangle newBounds;
-
- private Rectangle oldBounds;
-
- private final ChangeBoundsRequest request;
-
- private AbstractComponent component;
-
- public ComponentSetConstraintCommand(AbstractComponent component,
- ChangeBoundsRequest req, Rectangle newBounds) {
- if (component == null || req == null || newBounds == null) {
- throw new IllegalArgumentException();
- }
- this.component = component;
- this.request = req;
- this.newBounds = newBounds.getCopy();
- setLabel("move");
- }
-
- public boolean canExecute() {
- Object type = request.getType();
- return (RequestConstants.REQ_MOVE.equals(type)
- || RequestConstants.REQ_MOVE_CHILDREN.equals(type)
- || RequestConstants.REQ_RESIZE.equals(type) || RequestConstants.REQ_RESIZE_CHILDREN
- .equals(type));
- }
-
- public void execute() {
- try {
- oldBounds = new Rectangle(component.getLocation(), component
- .getLocation());
- redo();
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- public void redo() {
- component.setLocation(newBounds.getLocation());
- }
-
- public void undo() {
- component.setLocation(oldBounds.getLocation());
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import org.apache.servicemix.packaging.model.AbstractComponent;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+
+public class ComponentSetConstraintCommand extends Command {
+
+ private final Rectangle newBounds;
+
+ private Rectangle oldBounds;
+
+ private final ChangeBoundsRequest request;
+
+ private AbstractComponent component;
+
+ public ComponentSetConstraintCommand(AbstractComponent component,
+ ChangeBoundsRequest req, Rectangle newBounds) {
+ if (component == null || req == null || newBounds == null) {
+ throw new IllegalArgumentException();
+ }
+ this.component = component;
+ this.request = req;
+ this.newBounds = newBounds.getCopy();
+ setLabel("move");
+ }
+
+ public boolean canExecute() {
+ Object type = request.getType();
+ return (RequestConstants.REQ_MOVE.equals(type)
+ || RequestConstants.REQ_MOVE_CHILDREN.equals(type)
+ || RequestConstants.REQ_RESIZE.equals(type) || RequestConstants.REQ_RESIZE_CHILDREN
+ .equals(type));
+ }
+
+ public void execute() {
+ try {
+ oldBounds = new Rectangle(component.getLocation(), component
+ .getLocation());
+ redo();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ public void redo() {
+ component.setLocation(newBounds.getLocation());
+ }
+
+ public void undo() {
+ component.setLocation(oldBounds.getLocation());
+ }
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ComponentSetConstraintCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionCreateCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionCreateCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionCreateCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionCreateCommand.java Tue Feb 21 15:40:05 2006
@@ -1,78 +1,78 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import java.util.Iterator;
-
-import org.apache.servicemix.packaging.model.AbstractConnectableService;
-import org.apache.servicemix.packaging.model.BindingComponent;
-import org.apache.servicemix.packaging.model.ComponentConnection;
-import org.eclipse.gef.commands.Command;
-
-
-public class ConnectionCreateCommand extends Command {
-
- private ComponentConnection connection;
-
- private final int lineStyle;
-
- private final AbstractConnectableService source;
-
- private BindingComponent target;
-
- public ConnectionCreateCommand(AbstractConnectableService source, int lineStyle) {
- if (source == null) {
- throw new IllegalArgumentException();
- }
- setLabel("connection creation");
- this.source = source;
- this.lineStyle = lineStyle;
- }
-
- public boolean canExecute() {
- if (source.equals(target)) {
- return false;
- }
- for (Iterator iter = source.getSourceConnections().iterator(); iter
- .hasNext();) {
- ComponentConnection conn = (ComponentConnection) iter.next();
- if (conn.getTarget().equals(target)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- connection = new ComponentConnection(source, target);
- connection.setLineStyle(lineStyle);
- }
-
- public void redo() {
- connection.reconnect();
- }
-
- public void setTarget(BindingComponent target) {
- if (target == null) {
- throw new IllegalArgumentException();
- }
- this.target = target;
- }
-
- public void undo() {
- connection.disconnect();
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import java.util.Iterator;
+
+import org.apache.servicemix.packaging.model.AbstractConnectableService;
+import org.apache.servicemix.packaging.model.BindingComponent;
+import org.apache.servicemix.packaging.model.ComponentConnection;
+import org.eclipse.gef.commands.Command;
+
+
+public class ConnectionCreateCommand extends Command {
+
+ private ComponentConnection connection;
+
+ private final int lineStyle;
+
+ private final AbstractConnectableService source;
+
+ private BindingComponent target;
+
+ public ConnectionCreateCommand(AbstractConnectableService source, int lineStyle) {
+ if (source == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("connection creation");
+ this.source = source;
+ this.lineStyle = lineStyle;
+ }
+
+ public boolean canExecute() {
+ if (source.equals(target)) {
+ return false;
+ }
+ for (Iterator iter = source.getSourceConnections().iterator(); iter
+ .hasNext();) {
+ ComponentConnection conn = (ComponentConnection) iter.next();
+ if (conn.getTarget().equals(target)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public void execute() {
+ connection = new ComponentConnection(source, target);
+ connection.setLineStyle(lineStyle);
+ }
+
+ public void redo() {
+ connection.reconnect();
+ }
+
+ public void setTarget(BindingComponent target) {
+ if (target == null) {
+ throw new IllegalArgumentException();
+ }
+ this.target = target;
+ }
+
+ public void undo() {
+ connection.disconnect();
+ }
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionCreateCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionDeleteCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionDeleteCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionDeleteCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionDeleteCommand.java Tue Feb 21 15:40:05 2006
@@ -1,46 +1,46 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import org.apache.servicemix.packaging.model.ComponentConnection;
-import org.eclipse.gef.commands.Command;
-
-/**
- * The GEF command for deleting a connection
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ConnectionDeleteCommand extends Command {
-
- private final ComponentConnection connection;
-
- public ConnectionDeleteCommand(ComponentConnection conn) {
- if (conn == null) {
- throw new IllegalArgumentException();
- }
- setLabel("connection deletion");
- this.connection = conn;
- }
-
- public void execute() {
- connection.disconnect();
- }
-
- public void undo() {
- connection.reconnect();
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import org.apache.servicemix.packaging.model.ComponentConnection;
+import org.eclipse.gef.commands.Command;
+
+/**
+ * The GEF command for deleting a connection
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ConnectionDeleteCommand extends Command {
+
+ private final ComponentConnection connection;
+
+ public ConnectionDeleteCommand(ComponentConnection conn) {
+ if (conn == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("connection deletion");
+ this.connection = conn;
+ }
+
+ public void execute() {
+ connection.disconnect();
+ }
+
+ public void undo() {
+ connection.reconnect();
+ }
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionDeleteCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionReconnectCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionReconnectCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionReconnectCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionReconnectCommand.java Tue Feb 21 15:40:05 2006
@@ -1,120 +1,120 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import java.util.Iterator;
-
-import org.apache.servicemix.packaging.model.Connectable;
-import org.apache.servicemix.packaging.model.ComponentConnection;
-import org.eclipse.gef.commands.Command;
-
-/**
- * GEF command for connection reconnection
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ConnectionReconnectCommand extends Command {
-
- private ComponentConnection connection;
-
- private Connectable newSource;
-
- private Connectable newTarget;
-
- private final Connectable oldSource;
-
- private final Connectable oldTarget;
-
- public ConnectionReconnectCommand(ComponentConnection conn) {
- if (conn == null) {
- throw new IllegalArgumentException();
- }
- this.connection = conn;
- this.oldSource = conn.getSource();
- this.oldTarget = conn.getTarget();
- }
-
- public boolean canExecute() {
- if (newSource != null) {
- return checkSourceReconnection();
- } else if (newTarget != null) {
- return checkTargetReconnection();
- }
- return false;
- }
-
- private boolean checkSourceReconnection() {
- if (newSource.equals(oldTarget)) {
- return false;
- }
- for (Iterator iter = newSource.getSourceConnections().iterator(); iter
- .hasNext();) {
- ComponentConnection conn = (ComponentConnection) iter.next();
- if (conn.getTarget().equals(oldTarget) && !conn.equals(connection)) {
- return false;
- }
- }
- return true;
- }
-
- private boolean checkTargetReconnection() {
- if (newTarget.equals(oldSource)) {
- return false;
- }
- for (Iterator iter = newTarget.getTargetConnections().iterator(); iter
- .hasNext();) {
- ComponentConnection conn = (ComponentConnection) iter.next();
- if (conn.getSource().equals(oldSource) && !conn.equals(connection)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- if (newSource != null) {
- connection.reconnect(newSource, oldTarget);
- } else if (newTarget != null) {
- connection.reconnect(oldSource, newTarget);
- } else {
- throw new IllegalStateException("Should not happen");
- }
- }
-
- public void setNewSource(Connectable connectionSource) {
- if (connectionSource == null) {
- throw new IllegalArgumentException();
- }
- setLabel("move connection startpoint");
- newSource = connectionSource;
- newTarget = null;
- }
-
- public void setNewTarget(Connectable connectionTarget) {
- if (connectionTarget == null) {
- throw new IllegalArgumentException();
- }
- setLabel("move connection endpoint");
- newSource = null;
- newTarget = connectionTarget;
- }
-
- public void undo() {
- connection.reconnect(oldSource, oldTarget);
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import java.util.Iterator;
+
+import org.apache.servicemix.packaging.model.Connectable;
+import org.apache.servicemix.packaging.model.ComponentConnection;
+import org.eclipse.gef.commands.Command;
+
+/**
+ * GEF command for connection reconnection
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ConnectionReconnectCommand extends Command {
+
+ private ComponentConnection connection;
+
+ private Connectable newSource;
+
+ private Connectable newTarget;
+
+ private final Connectable oldSource;
+
+ private final Connectable oldTarget;
+
+ public ConnectionReconnectCommand(ComponentConnection conn) {
+ if (conn == null) {
+ throw new IllegalArgumentException();
+ }
+ this.connection = conn;
+ this.oldSource = conn.getSource();
+ this.oldTarget = conn.getTarget();
+ }
+
+ public boolean canExecute() {
+ if (newSource != null) {
+ return checkSourceReconnection();
+ } else if (newTarget != null) {
+ return checkTargetReconnection();
+ }
+ return false;
+ }
+
+ private boolean checkSourceReconnection() {
+ if (newSource.equals(oldTarget)) {
+ return false;
+ }
+ for (Iterator iter = newSource.getSourceConnections().iterator(); iter
+ .hasNext();) {
+ ComponentConnection conn = (ComponentConnection) iter.next();
+ if (conn.getTarget().equals(oldTarget) && !conn.equals(connection)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private boolean checkTargetReconnection() {
+ if (newTarget.equals(oldSource)) {
+ return false;
+ }
+ for (Iterator iter = newTarget.getTargetConnections().iterator(); iter
+ .hasNext();) {
+ ComponentConnection conn = (ComponentConnection) iter.next();
+ if (conn.getSource().equals(oldSource) && !conn.equals(connection)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public void execute() {
+ if (newSource != null) {
+ connection.reconnect(newSource, oldTarget);
+ } else if (newTarget != null) {
+ connection.reconnect(oldSource, newTarget);
+ } else {
+ throw new IllegalStateException("Should not happen");
+ }
+ }
+
+ public void setNewSource(Connectable connectionSource) {
+ if (connectionSource == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("move connection startpoint");
+ newSource = connectionSource;
+ newTarget = null;
+ }
+
+ public void setNewTarget(Connectable connectionTarget) {
+ if (connectionTarget == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("move connection endpoint");
+ newSource = null;
+ newTarget = connectionTarget;
+ }
+
+ public void undo() {
+ connection.reconnect(oldSource, oldTarget);
+ }
+
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ConnectionReconnectCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ServiceUnitDeleteCommand.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ServiceUnitDeleteCommand.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ServiceUnitDeleteCommand.java (original)
+++ incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ServiceUnitDeleteCommand.java Tue Feb 21 15:40:05 2006
@@ -1,83 +1,83 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.servicemix.packaging.model.commands;
-
-import org.apache.servicemix.packaging.model.ServiceAssembly;
-import org.apache.servicemix.packaging.model.ServiceUnit;
-import org.eclipse.gef.commands.Command;
-
-/**
- * GEF command for a service unit deletion
- *
- * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
- *
- */
-public class ServiceUnitDeleteCommand extends Command {
-
- private final ServiceUnit child;
-
- private final ServiceAssembly parent;
-
- private boolean wasRemoved;
-
- public ServiceUnitDeleteCommand(ServiceAssembly assembly, ServiceUnit unit) {
- if (assembly == null || unit == null) {
- throw new IllegalArgumentException();
- }
- setLabel("service unit deletion");
- this.parent = assembly;
- this.child = unit;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canUndo()
- */
- public boolean canUndo() {
- return wasRemoved;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- redo();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#redo()
- */
- public void redo() {
- // remove the child and disconnect its connections
- parent.removeServiceUnit(child);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#undo()
- */
- public void undo() {
- // add the child and reconnect its connections
- parent.addServiceUnit(child);
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.servicemix.packaging.model.commands;
+
+import org.apache.servicemix.packaging.model.ServiceAssembly;
+import org.apache.servicemix.packaging.model.ServiceUnit;
+import org.eclipse.gef.commands.Command;
+
+/**
+ * GEF command for a service unit deletion
+ *
+ * @author <a href="mailto:philip.dodds@gmail.com">Philip Dodds </a>
+ *
+ */
+public class ServiceUnitDeleteCommand extends Command {
+
+ private final ServiceUnit child;
+
+ private final ServiceAssembly parent;
+
+ private boolean wasRemoved;
+
+ public ServiceUnitDeleteCommand(ServiceAssembly assembly, ServiceUnit unit) {
+ if (assembly == null || unit == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("service unit deletion");
+ this.parent = assembly;
+ this.child = unit;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.commands.Command#canUndo()
+ */
+ public boolean canUndo() {
+ return wasRemoved;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.commands.Command#execute()
+ */
+ public void execute() {
+ redo();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.commands.Command#redo()
+ */
+ public void redo() {
+ // remove the child and disconnect its connections
+ parent.removeServiceUnit(child);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.commands.Command#undo()
+ */
+ public void undo() {
+ // add the child and reconnect its connections
+ parent.addServiceUnit(child);
+ }
+
+}
Propchange: incubator/servicemix/trunk/tooling/servicemix-packaging-eclipse-plugin/src/main/java/org/apache/servicemix/packaging/model/commands/ServiceUnitDeleteCommand.java
------------------------------------------------------------------------------
svn:eol-style = native