svn commit: r19448 - 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: 2011-05-17 02:26:04-0700
New Revision: 19448

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java

Log:
Allow get/set classifiers of InstanceSpecification

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java?view=diff&pathrev=19448&r1=19447&r2=19448
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java	2011-05-17 02:26:04-0700
@@ -15,6 +15,7 @@
 import java.util.List;
 
 import org.argouml.model.CommonBehaviorHelper;
+import org.eclipse.uml2.uml.InstanceSpecification;
 
 /**
  * Eclipse UML2 implementation of CommonBehaviorHelper.
@@ -122,7 +123,9 @@
 
 
     public void setClassifiers(Object handle, Collection classifiers) {
-        // TODO: Auto-generated method stub
+        ((InstanceSpecification) handle).getClassifiers().retainAll(classifiers);
+        classifiers.removeAll(((InstanceSpecification) handle).getClassifiers());
+        ((InstanceSpecification) handle).getClassifiers().addAll(classifiers);
     }
     
     public void setCommunicationLink(Object handle, Object c) {

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&pathrev=19448&r1=19447&r2=19448
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2011-05-17 02:26:04-0700
@@ -404,7 +404,12 @@
     }
 
     public Collection getClassifiers(Object handle) {
-        throw new NotYetImplementedException();
+        if (handle instanceof InstanceSpecification) {
+            return ((InstanceSpecification) handle).getClassifiers();
+        }
+        throw new IllegalArgumentException(
+                "Expected an InstanceSpecification. Got a " //$NON-NLS-1$
+                + handle);
     }
 
     public Collection getClassifiersInState(Object handle) {
@@ -477,7 +482,8 @@
     }
 
     public Object getComponentInstance(Object handle) {
-        throw new NotYetImplementedException();
+        throw new IllegalArgumentException(
+                "ComponentInstance is not available in UML2"); //$NON-NLS-1$
     }
 
     public Object getConcurrency(Object handle) {
@@ -1330,7 +1336,8 @@
     }
 
     public Collection getReceivedStimuli(Object handle) {
-        throw new NotYetImplementedException();
+        throw new NotImplementedException(
+                "Not available in UML2"); //$NON-NLS-1$
     }
 
     public Object getReceiver(Object handle) {

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java?view=diff&pathrev=19448&r1=19447&r2=19448
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	2011-05-17 02:26:04-0700
@@ -384,6 +384,8 @@
             o = modelImpl.getStateMachinesFactory().createCompositeState();
         } else if (elementType == metaTypes.getSynchState()) {
             o = modelImpl.getStateMachinesFactory().createSynchState();
+        } else if (elementType == metaTypes.getInstanceSpecification()) {
+            o = UMLFactory.eINSTANCE.createInstanceSpecification();
         } else if (elementType == metaTypes.getState()) {
             throw new IllegalArgumentException(
                     "Attempt to instantiate abstract type"); //$NON-NLS-1$

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

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.