svn commit: r18885 - 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

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2010-12-05 04:20:17-0800
New Revision: 18885

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:
UML2 only: new method isAAppliedProfileElement(...)

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=18885&r1=18884&r2=18885
==============================================================================
--- 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	2010-12-05 04:20:17-0800
@@ -30,8 +30,11 @@
 import org.eclipse.emf.common.util.Enumerator;
 import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.DynamicEObjectImpl;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.uml2.uml.Abstraction;
@@ -1028,6 +1031,30 @@
             }
         } else if (handle instanceof Enumerator) {
             return ((Enumerator) handle).getName();
+        } else if (handle instanceof DynamicEObjectImpl) {
+            StringBuffer name = new StringBuffer();
+            EClass c = ((DynamicEObjectImpl) handle).eClass();
+            if (c != null) {
+                EObject p = c.eContainer();
+                if (p instanceof EPackage) {
+                    name.append(((EPackage)p).getName()).append(':');
+                } else {
+                    name.append("(null):");
+                }
+                name.append('<').append('<').append(c.getName()).append('>').append('>');
+                /*
+                char sep = '<';
+                for (EStructuralFeature o : c.getEAllStructuralFeatures()) {
+                    name.append(sep).append(o.getName());
+                    sep = ',';
+                }
+                if (sep == ',') {
+                    name.append('>');
+                }
+                */
+                return name.toString();
+            }
+            return handle.toString();
         } else {
             // TODO: Some elements such as Generalization are
             // no longer named.  For a transitional period we'll
@@ -1657,6 +1684,10 @@
         return handle instanceof AggregationKind;
     }
 
+    public boolean isAAppliedProfileElement(Object handle) {
+        return handle instanceof DynamicEObjectImpl;
+    }
+
     public boolean isAArgument(Object modelElement) {
         // TODO: Double check - tfm
         return modelElement instanceof InputPin

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=18885&r1=18884&r2=18885
==============================================================================
--- 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	2010-12-05 04:20:17-0800
@@ -273,6 +273,11 @@
         return handle instanceof AggregationKind;
     }
 
+    public boolean isAAppliedProfileElement(Object handle) {
+        // non existent in UML1
+        return false;
+    }
+
     public boolean isAArgument(Object modelElement) {
         return modelElement instanceof Argument;
     }

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=18885&r1=18884&r2=18885
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/Facade.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/Facade.java	2010-12-05 04:20:17-0800
@@ -196,6 +196,13 @@
     boolean isAAggregationKind(Object handle);
 
     /**
+     * Recognizer for an applied profile element. UML2 only.
+     *
+     * @param handle candidate
+     * @return true if handle is an applied profile element
+     */
+    boolean isAAppliedProfileElement(Object handle);
+    /**
      * Recognizer for Artifact.
      *
      * @param handle candidate

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

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.