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/05/17 16:38:59 UTC
svn commit: r945185 [25/42] - in
/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram:
./ META-INF/ bin/ icons/ icons/obj16/ icons/wizban/ src/ src/org/
src/org/apache/ src/org/apache/commons/ src/org/apache/com...
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialState2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialState2ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialState2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialState2ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,95 @@
+/*
+ * 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.diagram.edit.policies;
+
+import org.apache.commons.scxml.diagram.edit.commands.TranslationCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.TranslationReorientCommand;
+import org.apache.commons.scxml.diagram.edit.parts.TranslationEditPart;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+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;
+
+/**
+ * @generated
+ */
+public class InitialState2ItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+ /**
+ * @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 (ScxmlElementTypes.Translation_3001 == req.getElementType()) {
+ return getGEFWrapper(new TranslationCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ScxmlElementTypes.Translation_3001 == req.getElementType()) {
+ return getGEFWrapper(new TranslationCreateCommand(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 TranslationEditPart.VISUAL_ID:
+ return getGEFWrapper(new TranslationReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialState2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialStateItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialStateItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialStateItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialStateItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.diagram.edit.policies;
+
+import org.apache.commons.scxml.diagram.edit.commands.TranslationCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.TranslationReorientCommand;
+import org.apache.commons.scxml.diagram.edit.parts.TranslationEditPart;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+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.View;
+
+/**
+ * @generated
+ */
+public class InitialStateItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ 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 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 (ScxmlElementTypes.Translation_3001 == req.getElementType()) {
+ return getGEFWrapper(new TranslationCreateCommand(req, req
+ .getSource(), req.getTarget()));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCompleteCreateRelationshipCommand(
+ CreateRelationshipRequest req) {
+ if (ScxmlElementTypes.Translation_3001 == req.getElementType()) {
+ return getGEFWrapper(new TranslationCreateCommand(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 TranslationEditPart.VISUAL_ID:
+ return getGEFWrapper(new TranslationReorientCommand(req));
+ }
+ return super.getReorientRelationshipCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InitialStateItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentCanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentCanonicalEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentCanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentCanonicalEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.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.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.parts.Content3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalizeEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param4EditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramUpdater;
+import org.apache.commons.scxml.diagram.part.ScxmlNodeDescriptor;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class InvokeInvokeCompartmentCanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ScxmlDiagramUpdater
+ .getInvokeInvokeCompartment_5010SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ScxmlNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ScxmlVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case FinalizeEditPart.VISUAL_ID:
+ case Param4EditPart.VISUAL_ID:
+ case Content3EditPart.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(ScxmlPackage.eINSTANCE
+ .getInvoke_Finalize());
+ myFeaturesToSynchronize.add(ScxmlPackage.eINSTANCE
+ .getInvoke_Param());
+ myFeaturesToSynchronize.add(ScxmlPackage.eINSTANCE
+ .getInvoke_Content());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentCanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,61 @@
+/*
+ * 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.diagram.edit.policies;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.commands.Content3CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.FinalizeCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Param4CreateCommand;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class InvokeInvokeCompartmentItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ScxmlElementTypes.Finalize_2027 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getInvoke_Finalize());
+ }
+ return getGEFWrapper(new FinalizeCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Param_2028 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getInvoke_Param());
+ }
+ return getGEFWrapper(new Param4CreateCommand(req));
+ }
+ if (ScxmlElementTypes.Content_2029 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getInvoke_Content());
+ }
+ return getGEFWrapper(new Content3CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeInvokeCompartmentItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,84 @@
+/*
+ * 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.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.Content3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalizeEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InvokeInvokeCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param4EditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+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 InvokeItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @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 (ScxmlVisualIDRegistry.getVisualID(node)) {
+ case InvokeInvokeCompartmentEditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ScxmlVisualIDRegistry.getVisualID(cnode)) {
+ case FinalizeEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param4EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Content3EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/InvokeItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/Log2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/Log2ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/Log2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/Log2ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.diagram.edit.policies;
+
+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;
+
+/**
+ * @generated
+ */
+public class Log2ItemSemanticEditPolicy extends ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/Log2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/LogItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/LogItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/LogItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/LogItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.diagram.edit.policies;
+
+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;
+
+/**
+ * @generated
+ */
+public class LogItemSemanticEditPolicy extends ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ CompoundCommand cc = getDestroyEdgesCommand();
+ addDestroyShortcutsCommand(cc);
+ cc.add(getGEFWrapper(new DestroyElementCommand(req)));
+ return cc.unwrap();
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/LogItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry2ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry2ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,108 @@
+/*
+ * 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.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+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 OnEntry2ItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @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 (ScxmlVisualIDRegistry.getVisualID(node)) {
+ case OnEntryOnEntryCompartment2EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ScxmlVisualIDRegistry.getVisualID(cnode)) {
+ case IfEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case AssignEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case RaiseEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case LogEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case ValidateEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case CancelEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case SendEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Script2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry3ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry3ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry3ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry3ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,108 @@
+/*
+ * 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.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+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 OnEntry3ItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @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 (ScxmlVisualIDRegistry.getVisualID(node)) {
+ case OnEntryOnEntryCompartment3EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ScxmlVisualIDRegistry.getVisualID(cnode)) {
+ case IfEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case AssignEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case RaiseEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case LogEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case ValidateEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case CancelEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case SendEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Script2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntry3ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,108 @@
+/*
+ * 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.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+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 OnEntryItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @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 (ScxmlVisualIDRegistry.getVisualID(node)) {
+ case OnEntryOnEntryCompartmentEditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ScxmlVisualIDRegistry.getVisualID(cnode)) {
+ case IfEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case AssignEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case RaiseEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case LogEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case ValidateEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case CancelEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case SendEditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Param2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ case Script2EditPart.VISUAL_ID:
+ cmd.add(getDestroyElementCommand(cnode));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2CanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2CanonicalEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2CanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2CanonicalEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,110 @@
+/*
+ * 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.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.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramUpdater;
+import org.apache.commons.scxml.diagram.part.ScxmlNodeDescriptor;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnEntryOnEntryCompartment2CanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ScxmlDiagramUpdater
+ .getOnEntryOnEntryCompartment_5014SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ScxmlNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ScxmlVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case IfEditPart.VISUAL_ID:
+ case AssignEditPart.VISUAL_ID:
+ case RaiseEditPart.VISUAL_ID:
+ case LogEditPart.VISUAL_ID:
+ case ValidateEditPart.VISUAL_ID:
+ case CancelEditPart.VISUAL_ID:
+ case SendEditPart.VISUAL_ID:
+ case Param2EditPart.VISUAL_ID:
+ case Script2EditPart.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(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ myFeaturesToSynchronize.add(ScxmlPackage.eINSTANCE
+ .getOnEntry_Script());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2CanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,109 @@
+/*
+ * 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.diagram.edit.policies;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.commands.AssignCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.CancelCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.IfCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.LogCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Param2CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.RaiseCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Script2CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.SendCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.ValidateCreateCommand;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class OnEntryOnEntryCompartment2ItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ScxmlElementTypes.If_2002 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new IfCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Assign_2005 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new AssignCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Raise_2006 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new RaiseCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Log_2007 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new LogCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Validate_2008 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new ValidateCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Cancel_2009 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new CancelCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Send_2010 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new SendCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Param_2014 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new Param2CreateCommand(req));
+ }
+ if (ScxmlElementTypes.Script_2015 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_Script());
+ }
+ return getGEFWrapper(new Script2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3CanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3CanonicalEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3CanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3CanonicalEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,110 @@
+/*
+ * 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.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.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramUpdater;
+import org.apache.commons.scxml.diagram.part.ScxmlNodeDescriptor;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnEntryOnEntryCompartment3CanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ScxmlDiagramUpdater
+ .getOnEntryOnEntryCompartment_5020SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ScxmlNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ScxmlVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case IfEditPart.VISUAL_ID:
+ case AssignEditPart.VISUAL_ID:
+ case RaiseEditPart.VISUAL_ID:
+ case LogEditPart.VISUAL_ID:
+ case ValidateEditPart.VISUAL_ID:
+ case CancelEditPart.VISUAL_ID:
+ case SendEditPart.VISUAL_ID:
+ case Param2EditPart.VISUAL_ID:
+ case Script2EditPart.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(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ myFeaturesToSynchronize.add(ScxmlPackage.eINSTANCE
+ .getOnEntry_Script());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3CanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3ItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,109 @@
+/*
+ * 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.diagram.edit.policies;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.commands.AssignCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.CancelCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.IfCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.LogCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Param2CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.RaiseCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Script2CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.SendCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.ValidateCreateCommand;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class OnEntryOnEntryCompartment3ItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ScxmlElementTypes.If_2002 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new IfCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Assign_2005 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new AssignCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Raise_2006 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new RaiseCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Log_2007 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new LogCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Validate_2008 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new ValidateCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Cancel_2009 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new CancelCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Send_2010 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new SendCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Param_2014 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new Param2CreateCommand(req));
+ }
+ if (ScxmlElementTypes.Script_2015 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_Script());
+ }
+ return getGEFWrapper(new Script2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartment3ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentCanonicalEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentCanonicalEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentCanonicalEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentCanonicalEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,110 @@
+/*
+ * 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.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.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramUpdater;
+import org.apache.commons.scxml.diagram.part.ScxmlNodeDescriptor;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class OnEntryOnEntryCompartmentCanonicalEditPolicy extends
+ CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View) getHost().getModel();
+ List result = new LinkedList();
+ for (Iterator it = ScxmlDiagramUpdater
+ .getOnEntryOnEntryCompartment_5002SemanticChildren(viewObject)
+ .iterator(); it.hasNext();) {
+ result.add(((ScxmlNodeDescriptor) it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = ScxmlVisualIDRegistry.getVisualID(view);
+ switch (visualID) {
+ case IfEditPart.VISUAL_ID:
+ case AssignEditPart.VISUAL_ID:
+ case RaiseEditPart.VISUAL_ID:
+ case LogEditPart.VISUAL_ID:
+ case ValidateEditPart.VISUAL_ID:
+ case CancelEditPart.VISUAL_ID:
+ case SendEditPart.VISUAL_ID:
+ case Param2EditPart.VISUAL_ID:
+ case Script2EditPart.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(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ myFeaturesToSynchronize.add(ScxmlPackage.eINSTANCE
+ .getOnEntry_Script());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentCanonicalEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentItemSemanticEditPolicy.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,109 @@
+/*
+ * 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.diagram.edit.policies;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.commands.AssignCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.CancelCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.IfCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.LogCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Param2CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.RaiseCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.Script2CreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.SendCreateCommand;
+import org.apache.commons.scxml.diagram.edit.commands.ValidateCreateCommand;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+
+/**
+ * @generated
+ */
+public class OnEntryOnEntryCompartmentItemSemanticEditPolicy extends
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if (ScxmlElementTypes.If_2002 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new IfCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Assign_2005 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new AssignCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Raise_2006 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new RaiseCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Log_2007 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new LogCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Validate_2008 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new ValidateCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Cancel_2009 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new CancelCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Send_2010 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new SendCreateCommand(req));
+ }
+ if (ScxmlElementTypes.Param_2014 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_ExecutableContext());
+ }
+ return getGEFWrapper(new Param2CreateCommand(req));
+ }
+ if (ScxmlElementTypes.Script_2015 == req.getElementType()) {
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(ScxmlPackage.eINSTANCE
+ .getOnEntry_Script());
+ }
+ return getGEFWrapper(new Script2CreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnEntryOnEntryCompartmentItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/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.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,108 @@
+/*
+ * 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.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+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
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @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 (ScxmlVisualIDRegistry.getVisualID(node)) {
+ case OnExitOnExitCompartment2EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ScxmlVisualIDRegistry.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;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit2ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/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.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java Mon May 17 14:38:45 2010
@@ -0,0 +1,108 @@
+/*
+ * 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.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+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
+ ScxmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @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 (ScxmlVisualIDRegistry.getVisualID(node)) {
+ case OnExitOnExitCompartment3EditPart.VISUAL_ID:
+ for (Iterator cit = node.getChildren().iterator(); cit
+ .hasNext();) {
+ Node cnode = (Node) cit.next();
+ switch (ScxmlVisualIDRegistry.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;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/edit/policies/OnExit3ItemSemanticEditPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native