Author: guixl
Date: Wed Jun  9 16:01:56 2010
New Revision: 953060

URL: http://svn.apache.org/viewvc?rev=953060&view=rev
Log:
change data model - remove initial state in service template, only state has 
initial state node

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/commands/Script3CreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/ScriptCreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/Send2CreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/SendCreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/State2CreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/State3CreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/StateCreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/TransitionCreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/TransitionReorientCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/Validate2CreateCommand.java
   (with props)
    
commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/edit/commands/ValidateCreateCommand.java
   (with props)

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/commands/Script3CreateCommand.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/commands/Script3CreateCommand.java?rev=953060&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/commands/Script3CreateCommand.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/commands/Script3CreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,69 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.OnExit;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class Script3CreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public Script3CreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       public boolean canExecute() {
+               OnExit container = (OnExit) getElementToEdit();
+               if (container.getScript() != null) {
+                       return false;
+               }
+               return true;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getOnExit();
+       }
+
+}

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/commands/Script3CreateCommand.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/commands/ScriptCreateCommand.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/commands/ScriptCreateCommand.java?rev=953060&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/commands/ScriptCreateCommand.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/commands/ScriptCreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,69 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.ServiceTemplate;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ScriptCreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public ScriptCreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       public boolean canExecute() {
+               ServiceTemplate container = (ServiceTemplate) 
getElementToEdit();
+               if (container.getScript() != null) {
+                       return false;
+               }
+               return true;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getServiceTemplate();
+       }
+
+}

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/commands/ScriptCreateCommand.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/commands/Send2CreateCommand.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/commands/Send2CreateCommand.java?rev=953060&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/commands/Send2CreateCommand.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/commands/Send2CreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class Send2CreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public Send2CreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getOnExit();
+       }
+
+}

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/commands/Send2CreateCommand.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/commands/SendCreateCommand.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/commands/SendCreateCommand.java?rev=953060&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/commands/SendCreateCommand.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/commands/SendCreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class SendCreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public SendCreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getOnEntry();
+       }
+
+}

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/commands/SendCreateCommand.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/commands/State2CreateCommand.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/commands/State2CreateCommand.java?rev=953060&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/commands/State2CreateCommand.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/commands/State2CreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class State2CreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public State2CreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getParallel();
+       }
+
+}

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/commands/State2CreateCommand.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/commands/State3CreateCommand.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/commands/State3CreateCommand.java?rev=953060&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/commands/State3CreateCommand.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/commands/State3CreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class State3CreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public State3CreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getState();
+       }
+
+}

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/commands/State3CreateCommand.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/commands/StateCreateCommand.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/commands/StateCreateCommand.java?rev=953060&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/commands/StateCreateCommand.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/commands/StateCreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class StateCreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public StateCreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getServiceTemplate();
+       }
+
+}

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/commands/StateCreateCommand.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/commands/TransitionCreateCommand.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/commands/TransitionCreateCommand.java?rev=953060&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/commands/TransitionCreateCommand.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/commands/TransitionCreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,145 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingFactory;
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.NamedElement;
+import org.apache.commons.scxml.modeling.Transition;
+import 
org.apache.commons.scxml.modeling.diagram.edit.policies.ModelingBaseItemSemanticEditPolicy;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import 
org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class TransitionCreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       private final EObject source;
+
+       /**
+        * @generated
+        */
+       private final EObject target;
+
+       /**
+        * @generated
+        */
+       public TransitionCreateCommand(CreateRelationshipRequest request,
+                       EObject source, EObject target) {
+               super(request);
+               this.source = source;
+               this.target = target;
+               if (request.getContainmentFeature() == null) {
+                       setContainmentFeature(ModelingPackage.eINSTANCE
+                                       .getNamedElement_TargetConnection());
+               }
+
+               super.setElementToEdit(source);
+       }
+
+       /**
+        * @generated
+        */
+       public boolean canExecute() {
+               if (source == null && target == null) {
+                       return false;
+               }
+               if (source != null && false == source instanceof NamedElement) {
+                       return false;
+               }
+               if (target != null && false == target instanceof NamedElement) {
+                       return false;
+               }
+               if (getSource() == null) {
+                       return true; // link creation is in progress; source is 
not defined yet
+               }
+               // target may be null here but it's possible to check constraint
+               return ModelingBaseItemSemanticEditPolicy.LinkConstraints
+                               .canCreateTransition_4001(getSource(), 
getTarget());
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject doDefaultElementCreation() {
+               Transition newElement = 
ModelingFactory.eINSTANCE.createTransition();
+               getSource().getTargetConnection().add(newElement);
+               newElement.setTargetStatus(getTarget());
+               return newElement;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getNamedElement();
+       }
+
+       /**
+        * @generated
+        */
+       protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
+                       IAdaptable info) throws ExecutionException {
+               if (!canExecute()) {
+                       throw new ExecutionException(
+                                       "Invalid arguments in create link 
command"); //$NON-NLS-1$
+               }
+               return super.doExecuteWithResult(monitor, info);
+       }
+
+       /**
+        * @generated
+        */
+       protected ConfigureRequest createConfigureRequest() {
+               ConfigureRequest request = super.createConfigureRequest();
+               request.setParameter(CreateRelationshipRequest.SOURCE, 
getSource());
+               request.setParameter(CreateRelationshipRequest.TARGET, 
getTarget());
+               return request;
+       }
+
+       /**
+        * @generated
+        */
+       protected void setElementToEdit(EObject element) {
+               throw new UnsupportedOperationException();
+       }
+
+       /**
+        * @generated
+        */
+       protected NamedElement getSource() {
+               return (NamedElement) source;
+       }
+
+       /**
+        * @generated
+        */
+       protected NamedElement getTarget() {
+               return (NamedElement) target;
+       }
+}

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/commands/TransitionCreateCommand.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/commands/TransitionReorientCommand.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/commands/TransitionReorientCommand.java?rev=953060&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/commands/TransitionReorientCommand.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/commands/TransitionReorientCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,172 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.NamedElement;
+import org.apache.commons.scxml.modeling.Transition;
+import 
org.apache.commons.scxml.modeling.diagram.edit.policies.ModelingBaseItemSemanticEditPolicy;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import 
org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class TransitionReorientCommand extends EditElementCommand {
+
+       /**
+        * @generated
+        */
+       private final int reorientDirection;
+
+       /**
+        * @generated
+        */
+       private final EObject oldEnd;
+
+       /**
+        * @generated
+        */
+       private final EObject newEnd;
+
+       /**
+        * @generated
+        */
+       public TransitionReorientCommand(ReorientRelationshipRequest request) {
+               super(request.getLabel(), request.getRelationship(), request);
+               reorientDirection = request.getDirection();
+               oldEnd = request.getOldRelationshipEnd();
+               newEnd = request.getNewRelationshipEnd();
+       }
+
+       /**
+        * @generated
+        */
+       public boolean canExecute() {
+               if (false == getElementToEdit() instanceof Transition) {
+                       return false;
+               }
+               if (reorientDirection == 
ReorientRelationshipRequest.REORIENT_SOURCE) {
+                       return canReorientSource();
+               }
+               if (reorientDirection == 
ReorientRelationshipRequest.REORIENT_TARGET) {
+                       return canReorientTarget();
+               }
+               return false;
+       }
+
+       /**
+        * @generated
+        */
+       protected boolean canReorientSource() {
+               if (!(oldEnd instanceof NamedElement && newEnd instanceof 
NamedElement)) {
+                       return false;
+               }
+               NamedElement target = getLink().getTargetStatus();
+               return ModelingBaseItemSemanticEditPolicy.LinkConstraints
+                               .canExistTransition_4001(getNewSource(), 
target);
+       }
+
+       /**
+        * @generated
+        */
+       protected boolean canReorientTarget() {
+               if (!(oldEnd instanceof NamedElement && newEnd instanceof 
NamedElement)) {
+                       return false;
+               }
+               if (!(getLink().eContainer() instanceof NamedElement)) {
+                       return false;
+               }
+               NamedElement source = (NamedElement) getLink().eContainer();
+               return ModelingBaseItemSemanticEditPolicy.LinkConstraints
+                               .canExistTransition_4001(source, 
getNewTarget());
+       }
+
+       /**
+        * @generated
+        */
+       protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
+                       IAdaptable info) throws ExecutionException {
+               if (!canExecute()) {
+                       throw new ExecutionException(
+                                       "Invalid arguments in reorient link 
command"); //$NON-NLS-1$
+               }
+               if (reorientDirection == 
ReorientRelationshipRequest.REORIENT_SOURCE) {
+                       return reorientSource();
+               }
+               if (reorientDirection == 
ReorientRelationshipRequest.REORIENT_TARGET) {
+                       return reorientTarget();
+               }
+               throw new IllegalStateException();
+       }
+
+       /**
+        * @generated
+        */
+       protected CommandResult reorientSource() throws ExecutionException {
+               getOldSource().getTargetConnection().remove(getLink());
+               getNewSource().getTargetConnection().add(getLink());
+               return CommandResult.newOKCommandResult(getLink());
+       }
+
+       /**
+        * @generated
+        */
+       protected CommandResult reorientTarget() throws ExecutionException {
+               getLink().setTargetStatus(getNewTarget());
+               return CommandResult.newOKCommandResult(getLink());
+       }
+
+       /**
+        * @generated
+        */
+       protected Transition getLink() {
+               return (Transition) getElementToEdit();
+       }
+
+       /**
+        * @generated
+        */
+       protected NamedElement getOldSource() {
+               return (NamedElement) oldEnd;
+       }
+
+       /**
+        * @generated
+        */
+       protected NamedElement getNewSource() {
+               return (NamedElement) newEnd;
+       }
+
+       /**
+        * @generated
+        */
+       protected NamedElement getOldTarget() {
+               return (NamedElement) oldEnd;
+       }
+
+       /**
+        * @generated
+        */
+       protected NamedElement getNewTarget() {
+               return (NamedElement) newEnd;
+       }
+}

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/commands/TransitionReorientCommand.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/commands/Validate2CreateCommand.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/commands/Validate2CreateCommand.java?rev=953060&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/commands/Validate2CreateCommand.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/commands/Validate2CreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class Validate2CreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public Validate2CreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getOnExit();
+       }
+
+}

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/commands/Validate2CreateCommand.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/commands/ValidateCreateCommand.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/commands/ValidateCreateCommand.java?rev=953060&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/commands/ValidateCreateCommand.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/commands/ValidateCreateCommand.java
 Wed Jun  9 16:01:56 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.commands;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ValidateCreateCommand extends CreateElementCommand {
+
+       /**
+        * @generated
+        */
+       public ValidateCreateCommand(CreateElementRequest req) {
+               super(req);
+       }
+
+       /**
+        * @generated
+        */
+       protected EObject getElementToEdit() {
+               EObject container = ((CreateElementRequest) getRequest())
+                               .getContainer();
+               if (container instanceof View) {
+                       container = ((View) container).getElement();
+               }
+               return container;
+       }
+
+       /**
+        * @generated
+        */
+       protected EClass getEClassToEdit() {
+               return ModelingPackage.eINSTANCE.getOnEntry();
+       }
+
+}

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/commands/ValidateCreateCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to