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

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-11-04 11:39:25-0800
New Revision: 17450

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Log:
fixing: (un)apply profile, (un)apply stereotype --> works now for the first time!

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&pathrev=17450&r1=17449&r2=17450
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	2009-11-04 11:39:25-0800
@@ -1153,7 +1153,15 @@
     }
 
     public void removeStereotype(Object handle, Object stereo) {
-        throw new NotYetImplementedException();
+        if (!(handle instanceof Element)) {
+            throw new IllegalArgumentException(
+                    "handle must be instance of Element"); //$NON-NLS-1$
+        }
+        if (!(stereo instanceof Stereotype)) {
+            throw new IllegalArgumentException(
+                    "stereo must be instance of Stereotype"); //$NON-NLS-1$
+        }
+        ((Element) handle).unapplyStereotype((Stereotype) stereo);
     }
 
     public void removeSupplierDependency(final Object supplier,

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java?view=diff&pathrev=17450&r1=17449&r2=17450
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	2009-11-04 11:39:25-0800
@@ -95,7 +95,7 @@
 
     public void applyProfile(Object handle, Object profile) {
         if (profile instanceof Profile) {
-            if (handle instanceof Package) {
+            if (handle instanceof Model) {
                 ((Model) handle).applyProfile((Profile) profile);
             } else if (handle instanceof Profile) {
                 ((Profile) handle).applyProfile((Profile) profile);

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=17450&r1=17449&r2=17450
==============================================================================
--- 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	2009-11-04 11:39:25-0800
@@ -1268,8 +1268,10 @@
     }
 
     public Collection getStereotypes(Object handle) {
-        // TODO: Changed to Profiles::Class::extension in UML 2.x?
-        return Collections.EMPTY_SET;
+        if (!(handle instanceof Element)) {
+            throw new IllegalArgumentException();
+        }
+        return ((Element) handle).getAppliedStereotypes();
     }
 
     public Collection getStimuli(Object handle) {

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

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.