You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gu...@apache.org on 2010/06/09 18:29:16 UTC
svn commit: r953075 [5/17] - in
/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram:
edit/policies/ navigator/ providers/ sheet/ view/factories/
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ExtenExecContent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExitOnExitCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnExit2ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyChildNodesCommand(cc);
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
+ View view = (View) getHost().getModel();
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if (annotation != null) {
+ return;
+ }
+ for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ switch (ModelingVisualIDRegistry.getVisualID(node)) {
+ case OnExitOnExitCompartment2EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+ case If2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Assign2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Raise2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Log2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Validate2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Cancel2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Send2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Script3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case ExtenExecContent2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ExtenExecContent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExitOnExitCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnExit3ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyChildNodesCommand(cc);
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
+ View view = (View) getHost().getModel();
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if (annotation != null) {
+ return;
+ }
+ for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ switch (ModelingVisualIDRegistry.getVisualID(node)) {
+ case OnExitOnExitCompartment3EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+ case If2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Assign2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Raise2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Log2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Validate2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Cancel2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Send2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Script3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case ExtenExecContent2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ExtenExecContent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExitOnExitCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnExitItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyChildNodesCommand(cc);
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
+ View view = (View) getHost().getModel();
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if (annotation != null) {
+ return;
+ }
+ for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ switch (ModelingVisualIDRegistry.getVisualID(node)) {
+ case OnExitOnExitCompartmentEditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+ case If2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Assign2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Raise2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Log2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Validate2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Cancel2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Send2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Script3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case ExtenExecContent2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2CanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2CanonicalEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2CanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2CanonicalEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ExtenExecContent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramUpdater;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingNodeDescriptor;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnExitOnExitCompartment2CanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ModelingDiagramUpdater
+ .getOnExitOnExitCompartment_7015SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ModelingNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ModelingVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case If2EditPart.VISUAL_ID:
+ case Assign2EditPart.VISUAL_ID:
+ case Raise2EditPart.VISUAL_ID:
+ case Log2EditPart.VISUAL_ID:
+ case Validate2EditPart.VISUAL_ID:
+ case Cancel2EditPart.VISUAL_ID:
+ case Param3EditPart.VISUAL_ID:
+ case Send2EditPart.VISUAL_ID:
+ case Script3EditPart.VISUAL_ID:
+ case ExtenExecContent2EditPart.VISUAL_ID:
+ if (!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if (myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getOnExit_Script());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2CanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Assign2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Cancel2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.ExtenExecContent2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.If2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Log2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Param3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Raise2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Script3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Send2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Validate2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class OnExitOnExitCompartment2ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ModelingElementTypes.If_3017 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new If2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Assign_3018 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Assign2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Raise_3019 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Raise2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Log_3020 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Log2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Validate_3021 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Validate2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Cancel_3022 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Cancel2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Param_3023 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Param3CreateCommand(req));
+ }
+ if (ModelingElementTypes.Send_3024 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Send2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Script_3025 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_Script());
+ }
+ return getGEFWrapper(new Script3CreateCommand(req));
+ }
+ if (ModelingElementTypes.ExtenExecContent_3050 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new ExtenExecContent2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3CanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3CanonicalEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3CanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3CanonicalEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ExtenExecContent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramUpdater;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingNodeDescriptor;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnExitOnExitCompartment3CanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ModelingDiagramUpdater
+ .getOnExitOnExitCompartment_7021SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ModelingNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ModelingVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case If2EditPart.VISUAL_ID:
+ case Assign2EditPart.VISUAL_ID:
+ case Raise2EditPart.VISUAL_ID:
+ case Log2EditPart.VISUAL_ID:
+ case Validate2EditPart.VISUAL_ID:
+ case Cancel2EditPart.VISUAL_ID:
+ case Param3EditPart.VISUAL_ID:
+ case Send2EditPart.VISUAL_ID:
+ case Script3EditPart.VISUAL_ID:
+ case ExtenExecContent2EditPart.VISUAL_ID:
+ if (!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if (myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getOnExit_Script());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3CanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Assign2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Cancel2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.ExtenExecContent2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.If2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Log2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Param3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Raise2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Script3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Send2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Validate2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class OnExitOnExitCompartment3ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ModelingElementTypes.If_3017 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new If2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Assign_3018 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Assign2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Raise_3019 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Raise2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Log_3020 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Log2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Validate_3021 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Validate2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Cancel_3022 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Cancel2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Param_3023 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Param3CreateCommand(req));
+ }
+ if (ModelingElementTypes.Send_3024 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Send2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Script_3025 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_Script());
+ }
+ return getGEFWrapper(new Script3CreateCommand(req));
+ }
+ if (ModelingElementTypes.ExtenExecContent_3050 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new ExtenExecContent2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartment3ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentCanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentCanonicalEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentCanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentCanonicalEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ExtenExecContent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramUpdater;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingNodeDescriptor;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnExitOnExitCompartmentCanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ModelingDiagramUpdater
+ .getOnExitOnExitCompartment_7007SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ModelingNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ModelingVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case If2EditPart.VISUAL_ID:
+ case Assign2EditPart.VISUAL_ID:
+ case Raise2EditPart.VISUAL_ID:
+ case Log2EditPart.VISUAL_ID:
+ case Validate2EditPart.VISUAL_ID:
+ case Cancel2EditPart.VISUAL_ID:
+ case Param3EditPart.VISUAL_ID:
+ case Send2EditPart.VISUAL_ID:
+ case Script3EditPart.VISUAL_ID:
+ case ExtenExecContent2EditPart.VISUAL_ID:
+ if (!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if (myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getOnExit_Script());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentCanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Assign2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Cancel2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.ExtenExecContent2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.If2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Log2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Param3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Raise2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Script3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Send2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Validate2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class OnExitOnExitCompartmentItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ModelingElementTypes.If_3017 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new If2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Assign_3018 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Assign2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Raise_3019 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Raise2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Log_3020 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Log2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Validate_3021 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Validate2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Cancel_3022 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Cancel2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Param_3023 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Param3CreateCommand(req));
+ }
+ if (ModelingElementTypes.Send_3024 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new Send2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Script_3025 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_Script());
+ }
+ return getGEFWrapper(new Script3CreateCommand(req));
+ }
+ if (ModelingElementTypes.ExtenExecContent_3050 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getOnExit_ExecutableContext());
+ }
+ return getGEFWrapper(new ExtenExecContent2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/OnExitOnExitCompartmentItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel2ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel2ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.commands.TransitionCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.TransitionReorientCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryState2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Parallel3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelParallelCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.State2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.TransitionEditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class Parallel2ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyChildNodesCommand(cc);
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
+ View view = (View) getHost().getModel();
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if (annotation != null) {
+ return;
+ }
+ for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ switch (ModelingVisualIDRegistry.getVisualID(node)) {
+ case ParallelParallelCompartmentEditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+ case HistoryState2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case AnchorEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Parallel3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case OnEntry2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case OnExit2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case State2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req)
+ : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super
+ .getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ModelingElementTypes.Transition_4001 == req.getElementType()) {
+ return getGEFWrapper(new TransitionCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ModelingElementTypes.Transition_4001 == req.getElementType()) {
+ return getGEFWrapper(new TransitionCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(
+ ReorientRelationshipRequest req) {
+ switch (getVisualID(req)) {
+ case TransitionEditPart.VISUAL_ID:
+ return getGEFWrapper(new TransitionReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel3ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel3ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel3ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel3ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.commands.TransitionCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.TransitionReorientCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryState2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Parallel3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelParallelCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.State2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.TransitionEditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class Parallel3ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyChildNodesCommand(cc);
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
+ View view = (View) getHost().getModel();
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if (annotation != null) {
+ return;
+ }
+ for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ switch (ModelingVisualIDRegistry.getVisualID(node)) {
+ case ParallelParallelCompartment2EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+ case HistoryState2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case AnchorEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Parallel3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case OnEntry2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case OnExit2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case State2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req)
+ : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super
+ .getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ModelingElementTypes.Transition_4001 == req.getElementType()) {
+ return getGEFWrapper(new TransitionCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ModelingElementTypes.Transition_4001 == req.getElementType()) {
+ return getGEFWrapper(new TransitionCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(
+ ReorientRelationshipRequest req) {
+ switch (getVisualID(req)) {
+ case TransitionEditPart.VISUAL_ID:
+ return getGEFWrapper(new TransitionReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/Parallel3ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.commands.TransitionCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.TransitionReorientCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryState2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Parallel3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelParallelCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.State2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.TransitionEditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ParallelItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyChildNodesCommand(cc);
+ addDestroyShortcutsCommand(cc);
+ View view = (View) getHost().getModel();
+ if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
+ req.setElementToDestroy(view);
+ }
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @generated
+ */
+ protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
+ View view = (View) getHost().getModel();
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if (annotation != null) {
+ return;
+ }
+ for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ switch (ModelingVisualIDRegistry.getVisualID(node)) {
+ case ParallelParallelCompartment3EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+ case HistoryState2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case AnchorEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Parallel3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case OnEntry2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case OnExit2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case State2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req)
+ : getCompleteCreateRelationshipCommand(req);
+ return command != null ? command : super
+ .getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getStartCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ModelingElementTypes.Transition_4001 == req.getElementType()) {
+ return getGEFWrapper(new TransitionCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ModelingElementTypes.Transition_4001 == req.getElementType()) {
+ return getGEFWrapper(new TransitionCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * Returns command to reorient EClass based link. New link target or source
+ * should be the domain model element associated with this node.
+ *
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(
+ ReorientRelationshipRequest req) {
+ switch (getVisualID(req)) {
+ case TransitionEditPart.VISUAL_ID:
+ return getGEFWrapper(new TransitionReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2CanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2CanonicalEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2CanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2CanonicalEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryState2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Parallel3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.State2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramUpdater;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingNodeDescriptor;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ParallelParallelCompartment2CanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ModelingDiagramUpdater
+ .getParallelParallelCompartment_7013SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ModelingNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ModelingVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case HistoryState2EditPart.VISUAL_ID:
+ case AnchorEditPart.VISUAL_ID:
+ case Parallel3EditPart.VISUAL_ID:
+ case OnEntry2EditPart.VISUAL_ID:
+ case OnExit2EditPart.VISUAL_ID:
+ case State2EditPart.VISUAL_ID:
+ if (!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if (myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_HistoryState());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_Anchor());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_Parallel());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_OnEntry());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_OnExit());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_State());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2CanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2ItemSemanticEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2ItemSemanticEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.AnchorCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.HistoryState2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.OnEntry2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.OnExit2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Parallel3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.State2CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class ParallelParallelCompartment2ItemSemanticEditPolicy extends
+ ModelingBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ModelingElementTypes.HistoryState_3033 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getParallel_HistoryState());
+ }
+ return getGEFWrapper(new HistoryState2CreateCommand(req));
+ }
+ if (ModelingElementTypes.Anchor_3034 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getParallel_Anchor());
+ }
+ return getGEFWrapper(new AnchorCreateCommand(req));
+ }
+ if (ModelingElementTypes.Parallel_3035 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getParallel_Parallel());
+ }
+ return getGEFWrapper(new Parallel3CreateCommand(req));
+ }
+ if (ModelingElementTypes.OnEntry_3036 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getParallel_OnEntry());
+ }
+ return getGEFWrapper(new OnEntry2CreateCommand(req));
+ }
+ if (ModelingElementTypes.OnExit_3037 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getParallel_OnExit());
+ }
+ return getGEFWrapper(new OnExit2CreateCommand(req));
+ }
+ if (ModelingElementTypes.State_3038 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ModelingPackage.eINSTANCE
+ .getParallel_State());
+ }
+ return getGEFWrapper(new State2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment3CanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment3CanonicalEditPolicy.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment3CanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment3CanonicalEditPolicy.java Wed Jun 9 16:29:10 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.commons.scxml.modeling.diagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryState2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Parallel3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.State2EditPart;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramUpdater;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingNodeDescriptor;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ParallelParallelCompartment3CanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ModelingDiagramUpdater
+ .getParallelParallelCompartment_7023SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ModelingNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ModelingVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case HistoryState2EditPart.VISUAL_ID:
+ case AnchorEditPart.VISUAL_ID:
+ case Parallel3EditPart.VISUAL_ID:
+ case OnEntry2EditPart.VISUAL_ID:
+ case OnExit2EditPart.VISUAL_ID:
+ case State2EditPart.VISUAL_ID:
+ if (!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if (myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_HistoryState());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_Anchor());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_Parallel());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_OnEntry());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_OnExit());
+ myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+ .getParallel_State());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ParallelParallelCompartment3CanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native