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

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-10-10 06:17:44-0700
New Revision: 17391

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
   trunk/src/argouml-core-model/src/org/argouml/model/Facade.java

Log:
add isAProfile method in the model facade (and MDR&eUML implementations)

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=17391&r1=17390&r2=17391
==============================================================================
--- 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-10-10 06:17:44-0700
@@ -99,6 +99,7 @@
 import org.eclipse.uml2.uml.Parameter;
 import org.eclipse.uml2.uml.ParameterDirectionKind;
 import org.eclipse.uml2.uml.PrimitiveType;
+import org.eclipse.uml2.uml.Profile;
 import org.eclipse.uml2.uml.Property;
 import org.eclipse.uml2.uml.Pseudostate;
 import org.eclipse.uml2.uml.PseudostateKind;
@@ -1854,6 +1855,10 @@
     public boolean isAPrimitiveType(Object handle) {
         return handle instanceof PrimitiveType;
     }
+
+    public boolean isAProfile(Object handle) {
+        return handle instanceof Profile;
+    }
     
     public boolean isAPseudostate(Object handle) {
         return handle instanceof Pseudostate;

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java?view=diff&pathrev=17391&r1=17390&r2=17391
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	2009-10-10 06:17:44-0700
@@ -569,11 +569,24 @@
     public boolean isAPackage(Object handle) {
         return handle instanceof UmlPackage;
     }
-    
+
     public boolean isAPrimitiveType(Object handle) {
         return handle instanceof Primitive;
     }
 
+    public boolean isAProfile(Object handle) {
+        if (handle instanceof Model) {
+            for (Object stereo : getStereotypes(handle)) {
+                if (modelImpl.getExtensionMechanismsHelper()
+                        .isStereotypeInh(stereo, "profile", 
+                                "Package")) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     public boolean isAPseudostate(Object handle) {
         return handle instanceof Pseudostate;
     }

Modified: trunk/src/argouml-core-model/src/org/argouml/model/Facade.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/Facade.java?view=diff&pathrev=17391&r1=17390&r2=17391
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/Facade.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/Facade.java	2009-10-10 06:17:44-0700
@@ -787,6 +787,15 @@
      */
     boolean isAPrimitiveType(Object handle);
     
+    /**
+     * Recognizer for Profile. In UML 2, this is no longer a model, but a
+     * separate meta package instance. In UML 1.4, ArgoUML assumes it to be a
+     * model instance with a <<profile>> stereotype.
+     *
+     * @param handle candidate
+     * @return true if handle is a Model
+     */
+    boolean isAProfile(Object handle);
 
     /**
      * Recognizer for Pseudostate.

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

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.