svn commit: r18511 - trunk/src/argouml-core-model-euml: . src/org/argouml/model/euml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-07-14 07:34:10-0700
New Revision: 18511

Modified:
   trunk/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java

Log:
Mkae factory for ActivityGraph give as an Activity in UML2

Modified: trunk/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/ArgoUML%20UML2-EUML%20debug.launch?view=diff&pathrev=18511&r1=18510&r2=18511
==============================================================================
--- trunk/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch	(original)
+++ trunk/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch	2010-07-14 07:34:10-0700
@@ -47,6 +47,7 @@
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model-euml&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/toolbar-1.4.1-20071227.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/toolbar/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-infra&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-diagrams-activity2&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-infra/lib/log4j-1.2.6.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-diagrams-sequence2&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-umlpropertypanels&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>
@@ -55,5 +56,5 @@
 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.application.Main"/>
 <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nouml2warning"/>
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="argouml-app"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx400M -ea -Dargouml.modules=org.argouml.sequence2.SequenceDiagramModule;org.argouml.core.propertypanels.module.XmlPropertyPanelsModule -Dlog4j.configuration=org/argouml/resource/full_console.lcf  -DeUML.resources=../argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar -Dargouml.model.implementation=org.argouml.model.euml.EUMLModelImplementation"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx400M -ea -Dargouml.modules=org.argouml.activity2.ActivityDiagramModule;org.argouml.sequence2.SequenceDiagramModule;org.argouml.core.propertypanels.module.XmlPropertyPanelsModule -Dlog4j.configuration=org/argouml/resource/full_console.lcf  -DeUML.resources=../argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar -Dargouml.model.implementation=org.argouml.model.euml.EUMLModelImplementation"/>
 </launchConfiguration>

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java?view=diff&pathrev=18511&r1=18510&r2=18511
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java	2010-07-14 07:34:10-0700
@@ -16,6 +16,11 @@
 
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.ActivityGraphsFactory;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.Include;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UseCase;
 
 /**
  * The implementation of the ActivityGraphsFactory for EUML2.
@@ -38,9 +43,24 @@
         modelImpl = implementation;
     }
 
-    public Object buildActivityGraph(Object theContext) {
-        // TODO: Auto-generated method stub
-        throw new NotYetImplementedException();
+    public Object buildActivityGraph(final Object theContext) {
+        if (!(theContext instanceof Namespace)) {
+            throw new IllegalArgumentException("Didn't expect a " + theContext);
+        }
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                Activity activity = UMLFactory.eINSTANCE.createActivity();
+                activity.setPackage((org.eclipse.uml2.uml.Package)theContext);
+                getParams().add(activity);
+            }
+        };
+        ChangeCommand cmd = new ChangeCommand(
+                modelImpl, run,
+                "Create the activity # in the package #");
+        modelImpl.getEditingDomain().getCommandStack().execute(cmd);
+        cmd.setObjects(run.getParams().get(0), theContext);
+
+        return (Activity) run.getParams().get(0);
     }
 
     public Object buildClassifierInState(Object classifier, Collection state) {

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java?view=diff&pathrev=18511&r1=18510&r2=18511
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java	2010-07-14 07:34:10-0700
@@ -61,8 +61,7 @@
     }
 
     public boolean isAddingActivityGraphAllowed(Object context) {
-        // TODO Auto-generated method stub
-        return false;
+        return (context instanceof org.eclipse.uml2.uml.Package);
     }
 
     public void removeContent(Object partition, Object modeElement) {

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

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.