svn commit: r19361 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-05-07 05:34:54-0700
New Revision: 19361

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java

Log:
Implement buildTransition

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java?view=diff&pathrev=19361&r1=19360&r2=19361
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java	2011-05-07 05:34:54-0700
@@ -14,11 +14,10 @@
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.StateMachinesFactory;
 import org.eclipse.uml2.uml.BehavioredClassifier;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ProtocolStateMachine;
 import org.eclipse.uml2.uml.StateMachine;
+import org.eclipse.uml2.uml.Transition;
 import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.Vertex;
 
 /**
  * The implementation of the StateMachinesFactory for EUML2.
@@ -164,9 +163,13 @@
     }
 
     public Object buildTransition(Object source, Object target) {
-        // TODO: Auto-generated method stub
-        throw new NotYetImplementedException();
-
+        if (source instanceof Vertex && target instanceof Vertex) {
+            Transition trans = createTransition();
+            trans.setSource((Vertex) source);
+            trans.setTarget((Vertex) target);
+            return trans;
+        }
+        throw new IllegalArgumentException();
     }
 
     public Object createCallEvent() {
@@ -235,7 +238,7 @@
         return UMLFactory.eINSTANCE.createTimeEvent();
     }
 
-    public Object createTransition() {
+    public Transition createTransition() {
         return UMLFactory.eINSTANCE.createTransition();
     }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2732334

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.