commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gu...@apache.org
Subject svn commit: r953075 [3/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/
Date Wed, 09 Jun 2010 16:29:16 GMT
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/ExtenExecContentItemSemanticEditPolicy.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/ExtenExecContentItemSemanticEditPolicy.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/ExtenExecContentItemSemanticEditPolicy.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/ExtenExecContentItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,40 @@
+/*
+ * 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.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 ExtenExecContentItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/ExtenExecContentItemSemanticEditPolicy.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/FinalState2ItemSemanticEditPolicy.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/FinalState2ItemSemanticEditPolicy.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/FinalState2ItemSemanticEditPolicy.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/FinalState2ItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,139 @@
+/*
+ * 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.DonedataEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalStateFinalStateCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit3EditPart;
+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 FinalState2ItemSemanticEditPolicy 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 FinalStateFinalStateCompartmentEditPart.VISUAL_ID:
+				for (Iterator cit = node.getChildren().iterator(); cit
+						.hasNext();) {
+					Node cnode = (Node) cit.next();
+					switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+					case DonedataEditPart.VISUAL_ID:
+						cmd.add(getDestroyElementCommand(cnode));
+						break;
+					case OnEntry3EditPart.VISUAL_ID:
+						cmd.add(getDestroyElementCommand(cnode));
+						break;
+					case OnExit3EditPart.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/FinalState2ItemSemanticEditPolicy.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/FinalStateFinalStateCompartment2CanonicalEditPolicy.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/FinalStateFinalStateCompartment2CanonicalEditPolicy.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/FinalStateFinalStateCompartment2CanonicalEditPolicy.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/FinalStateFinalStateCompartment2CanonicalEditPolicy.java Wed Jun  9 16:29:10 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.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.DonedataEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit3EditPart;
+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 FinalStateFinalStateCompartment2CanonicalEditPolicy extends
+		CanonicalEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	Set myFeaturesToSynchronize;
+
+	/**
+	 * @generated
+	 */
+	protected List getSemanticChildrenList() {
+		View viewObject = (View) getHost().getModel();
+		List result = new LinkedList();
+		for (Iterator it = ModelingDiagramUpdater
+				.getFinalStateFinalStateCompartment_7027SemanticChildren(
+						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 DonedataEditPart.VISUAL_ID:
+		case OnEntry3EditPart.VISUAL_ID:
+		case OnExit3EditPart.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
+					.getFinalState_Donedata());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+					.getFinalState_OnEntry());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+					.getFinalState_OnExit());
+		}
+		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/FinalStateFinalStateCompartment2CanonicalEditPolicy.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/FinalStateFinalStateCompartment2ItemSemanticEditPolicy.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/FinalStateFinalStateCompartment2ItemSemanticEditPolicy.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/FinalStateFinalStateCompartment2ItemSemanticEditPolicy.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/FinalStateFinalStateCompartment2ItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.DonedataCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.OnEntry3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.OnExit3CreateCommand;
+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 FinalStateFinalStateCompartment2ItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	protected Command getCreateCommand(CreateElementRequest req) {
+		if (ModelingElementTypes.Donedata_3041 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getFinalState_Donedata());
+			}
+			return getGEFWrapper(new DonedataCreateCommand(req));
+		}
+		if (ModelingElementTypes.OnEntry_3044 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getFinalState_OnEntry());
+			}
+			return getGEFWrapper(new OnEntry3CreateCommand(req));
+		}
+		if (ModelingElementTypes.OnExit_3045 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getFinalState_OnExit());
+			}
+			return getGEFWrapper(new OnExit3CreateCommand(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/FinalStateFinalStateCompartment2ItemSemanticEditPolicy.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/FinalStateFinalStateCompartmentCanonicalEditPolicy.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/FinalStateFinalStateCompartmentCanonicalEditPolicy.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/FinalStateFinalStateCompartmentCanonicalEditPolicy.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/FinalStateFinalStateCompartmentCanonicalEditPolicy.java Wed Jun  9 16:29:10 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.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.DonedataEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit3EditPart;
+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 FinalStateFinalStateCompartmentCanonicalEditPolicy extends
+		CanonicalEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	Set myFeaturesToSynchronize;
+
+	/**
+	 * @generated
+	 */
+	protected List getSemanticChildrenList() {
+		View viewObject = (View) getHost().getModel();
+		List result = new LinkedList();
+		for (Iterator it = ModelingDiagramUpdater
+				.getFinalStateFinalStateCompartment_7017SemanticChildren(
+						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 DonedataEditPart.VISUAL_ID:
+		case OnEntry3EditPart.VISUAL_ID:
+		case OnExit3EditPart.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
+					.getFinalState_Donedata());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+					.getFinalState_OnEntry());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+					.getFinalState_OnExit());
+		}
+		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/FinalStateFinalStateCompartmentCanonicalEditPolicy.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/FinalStateFinalStateCompartmentItemSemanticEditPolicy.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/FinalStateFinalStateCompartmentItemSemanticEditPolicy.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/FinalStateFinalStateCompartmentItemSemanticEditPolicy.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/FinalStateFinalStateCompartmentItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.DonedataCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.OnEntry3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.OnExit3CreateCommand;
+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 FinalStateFinalStateCompartmentItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	protected Command getCreateCommand(CreateElementRequest req) {
+		if (ModelingElementTypes.Donedata_3041 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getFinalState_Donedata());
+			}
+			return getGEFWrapper(new DonedataCreateCommand(req));
+		}
+		if (ModelingElementTypes.OnEntry_3044 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getFinalState_OnEntry());
+			}
+			return getGEFWrapper(new OnEntry3CreateCommand(req));
+		}
+		if (ModelingElementTypes.OnExit_3045 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getFinalState_OnExit());
+			}
+			return getGEFWrapper(new OnExit3CreateCommand(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/FinalStateFinalStateCompartmentItemSemanticEditPolicy.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/FinalStateItemSemanticEditPolicy.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/FinalStateItemSemanticEditPolicy.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/FinalStateItemSemanticEditPolicy.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/FinalStateItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,143 @@
+/*
+ * 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.DonedataEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalStateFinalStateCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntry3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExit3EditPart;
+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 FinalStateItemSemanticEditPolicy 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 FinalStateFinalStateCompartment2EditPart.VISUAL_ID:
+				for (Iterator cit = node.getChildren().iterator(); cit
+						.hasNext();) {
+					Node cnode = (Node) cit.next();
+					switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+					case DonedataEditPart.VISUAL_ID:
+						cmd.add(getDestroyElementCommand(cnode));
+						break;
+					case OnEntry3EditPart.VISUAL_ID:
+						cmd.add(getDestroyElementCommand(cnode));
+						break;
+					case OnExit3EditPart.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/FinalStateItemSemanticEditPolicy.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/FinalizeItemSemanticEditPolicy.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/FinalizeItemSemanticEditPolicy.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/FinalizeItemSemanticEditPolicy.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/FinalizeItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,40 @@
+/*
+ * 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.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 FinalizeItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/FinalizeItemSemanticEditPolicy.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/HistoryState2ItemSemanticEditPolicy.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/HistoryState2ItemSemanticEditPolicy.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/HistoryState2ItemSemanticEditPolicy.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/HistoryState2ItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+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.TransitionEditPart;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+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 HistoryState2ItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @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 (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/HistoryState2ItemSemanticEditPolicy.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/HistoryStateItemSemanticEditPolicy.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/HistoryStateItemSemanticEditPolicy.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/HistoryStateItemSemanticEditPolicy.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/HistoryStateItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+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.TransitionEditPart;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+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 HistoryStateItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @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 (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/HistoryStateItemSemanticEditPolicy.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/If2ItemSemanticEditPolicy.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/If2ItemSemanticEditPolicy.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/If2ItemSemanticEditPolicy.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/If2ItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,80 @@
+/*
+ * 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.ElseEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ElseIfEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.IfIfCompartment2EditPart;
+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 If2ItemSemanticEditPolicy 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 IfIfCompartment2EditPart.VISUAL_ID:
+				for (Iterator cit = node.getChildren().iterator(); cit
+						.hasNext();) {
+					Node cnode = (Node) cit.next();
+					switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+					case ElseIfEditPart.VISUAL_ID:
+						cmd.add(getDestroyElementCommand(cnode));
+						break;
+					case ElseEditPart.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/If2ItemSemanticEditPolicy.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/IfIfCompartment2CanonicalEditPolicy.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/IfIfCompartment2CanonicalEditPolicy.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/IfIfCompartment2CanonicalEditPolicy.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/IfIfCompartment2CanonicalEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,94 @@
+/*
+ * 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.ElseEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ElseIfEditPart;
+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 IfIfCompartment2CanonicalEditPolicy extends CanonicalEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	Set myFeaturesToSynchronize;
+
+	/**
+	 * @generated
+	 */
+	protected List getSemanticChildrenList() {
+		View viewObject = (View) getHost().getModel();
+		List result = new LinkedList();
+		for (Iterator it = ModelingDiagramUpdater
+				.getIfIfCompartment_7008SemanticChildren(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 ElseIfEditPart.VISUAL_ID:
+		case ElseEditPart.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
+					.getIf_Elseif());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE.getIf_Else());
+		}
+		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/IfIfCompartment2CanonicalEditPolicy.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/IfIfCompartment2ItemSemanticEditPolicy.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/IfIfCompartment2ItemSemanticEditPolicy.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/IfIfCompartment2ItemSemanticEditPolicy.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/IfIfCompartment2ItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,53 @@
+/*
+ * 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.ElseCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.ElseIfCreateCommand;
+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 IfIfCompartment2ItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	protected Command getCreateCommand(CreateElementRequest req) {
+		if (ModelingElementTypes.ElseIf_3003 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getIf_Elseif());
+			}
+			return getGEFWrapper(new ElseIfCreateCommand(req));
+		}
+		if (ModelingElementTypes.Else_3004 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getIf_Else());
+			}
+			return getGEFWrapper(new ElseCreateCommand(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/IfIfCompartment2ItemSemanticEditPolicy.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/IfIfCompartmentCanonicalEditPolicy.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/IfIfCompartmentCanonicalEditPolicy.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/IfIfCompartmentCanonicalEditPolicy.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/IfIfCompartmentCanonicalEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,94 @@
+/*
+ * 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.ElseEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ElseIfEditPart;
+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 IfIfCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	Set myFeaturesToSynchronize;
+
+	/**
+	 * @generated
+	 */
+	protected List getSemanticChildrenList() {
+		View viewObject = (View) getHost().getModel();
+		List result = new LinkedList();
+		for (Iterator it = ModelingDiagramUpdater
+				.getIfIfCompartment_7003SemanticChildren(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 ElseIfEditPart.VISUAL_ID:
+		case ElseEditPart.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
+					.getIf_Elseif());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE.getIf_Else());
+		}
+		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/IfIfCompartmentCanonicalEditPolicy.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/IfIfCompartmentItemSemanticEditPolicy.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/IfIfCompartmentItemSemanticEditPolicy.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/IfIfCompartmentItemSemanticEditPolicy.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/IfIfCompartmentItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,53 @@
+/*
+ * 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.ElseCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.ElseIfCreateCommand;
+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 IfIfCompartmentItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	protected Command getCreateCommand(CreateElementRequest req) {
+		if (ModelingElementTypes.ElseIf_3003 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getIf_Elseif());
+			}
+			return getGEFWrapper(new ElseIfCreateCommand(req));
+		}
+		if (ModelingElementTypes.Else_3004 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getIf_Else());
+			}
+			return getGEFWrapper(new ElseCreateCommand(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/IfIfCompartmentItemSemanticEditPolicy.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/IfItemSemanticEditPolicy.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/IfItemSemanticEditPolicy.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/IfItemSemanticEditPolicy.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/IfItemSemanticEditPolicy.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,80 @@
+/*
+ * 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.ElseEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ElseIfEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.IfIfCompartmentEditPart;
+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 IfItemSemanticEditPolicy 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 IfIfCompartmentEditPart.VISUAL_ID:
+				for (Iterator cit = node.getChildren().iterator(); cit
+						.hasNext();) {
+					Node cnode = (Node) cit.next();
+					switch (ModelingVisualIDRegistry.getVisualID(cnode)) {
+					case ElseIfEditPart.VISUAL_ID:
+						cmd.add(getDestroyElementCommand(cnode));
+						break;
+					case ElseEditPart.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/IfItemSemanticEditPolicy.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/InitialState2ItemSemanticEditPolicy.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/InitialState2ItemSemanticEditPolicy.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/InitialState2ItemSemanticEditPolicy.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/InitialState2ItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+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.TransitionEditPart;
+import org.apache.commons.scxml.modeling.diagram.providers.ModelingElementTypes;
+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
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @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 (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/InitialState2ItemSemanticEditPolicy.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/InvokeInvokeCompartmentCanonicalEditPolicy.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/InvokeInvokeCompartmentCanonicalEditPolicy.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/InvokeInvokeCompartmentCanonicalEditPolicy.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/InvokeInvokeCompartmentCanonicalEditPolicy.java Wed Jun  9 16:29:10 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.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.Content3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalizeEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param4EditPart;
+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 InvokeInvokeCompartmentCanonicalEditPolicy extends
+		CanonicalEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	Set myFeaturesToSynchronize;
+
+	/**
+	 * @generated
+	 */
+	protected List getSemanticChildrenList() {
+		View viewObject = (View) getHost().getModel();
+		List result = new LinkedList();
+		for (Iterator it = ModelingDiagramUpdater
+				.getInvokeInvokeCompartment_7010SemanticChildren(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 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(ModelingPackage.eINSTANCE
+					.getInvoke_Finalize());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+					.getInvoke_Param());
+			myFeaturesToSynchronize.add(ModelingPackage.eINSTANCE
+					.getInvoke_Content());
+		}
+		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/InvokeInvokeCompartmentCanonicalEditPolicy.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/InvokeInvokeCompartmentItemSemanticEditPolicy.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/InvokeInvokeCompartmentItemSemanticEditPolicy.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/InvokeInvokeCompartmentItemSemanticEditPolicy.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/InvokeInvokeCompartmentItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Content3CreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.FinalizeCreateCommand;
+import org.apache.commons.scxml.modeling.diagram.edit.commands.Param4CreateCommand;
+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 InvokeInvokeCompartmentItemSemanticEditPolicy extends
+		ModelingBaseItemSemanticEditPolicy {
+
+	/**
+	 * @generated
+	 */
+	protected Command getCreateCommand(CreateElementRequest req) {
+		if (ModelingElementTypes.Finalize_3027 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getInvoke_Finalize());
+			}
+			return getGEFWrapper(new FinalizeCreateCommand(req));
+		}
+		if (ModelingElementTypes.Param_3028 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.eINSTANCE
+						.getInvoke_Param());
+			}
+			return getGEFWrapper(new Param4CreateCommand(req));
+		}
+		if (ModelingElementTypes.Content_3029 == req.getElementType()) {
+			if (req.getContainmentFeature() == null) {
+				req.setContainmentFeature(ModelingPackage.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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/InvokeInvokeCompartmentItemSemanticEditPolicy.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/InvokeItemSemanticEditPolicy.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/InvokeItemSemanticEditPolicy.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/InvokeItemSemanticEditPolicy.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/InvokeItemSemanticEditPolicy.java Wed Jun  9 16:29:10 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.modeling.diagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Content3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalizeEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.InvokeInvokeCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.Param4EditPart;
+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 InvokeItemSemanticEditPolicy 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 InvokeInvokeCompartmentEditPart.VISUAL_ID:
+				for (Iterator cit = node.getChildren().iterator(); cit
+						.hasNext();) {
+					Node cnode = (Node) cit.next();
+					switch (ModelingVisualIDRegistry.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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/policies/InvokeItemSemanticEditPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message