svn commit: r17440 - 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-11-01 11:31:35-0700
New Revision: 17440

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java
   trunk/src/argouml-core-model/src/org/argouml/model/AbstractExtensionMechanismsHelperDecorator.java
   trunk/src/argouml-core-model/src/org/argouml/model/ExtensionMechanismsHelper.java

Log:
adding methods to apply/unapply a profile to a model

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=17440&r1=17439&r2=17440
==============================================================================
--- 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-01 11:31:35-0700
@@ -93,6 +93,16 @@
 
     }
 
+    public void applyProfile(Object handle, Object profile) {
+        if (profile instanceof Profile) {
+            if (handle instanceof Package) {
+                ((Model) handle).applyProfile((Profile) profile);
+            } else if (handle instanceof Profile) {
+                ((Profile) handle).applyProfile((Profile) profile);
+            }
+        }
+    }
+
     public Collection getAllPossibleStereotypes(Collection models,
             Object modelElement) {
         List<Stereotype> ret = new ArrayList<Stereotype>();
@@ -226,6 +236,16 @@
         // TODO: Auto-generated method stub
     }
 
+    public void unapplyProfile(Object handle, Object profile) {
+        if (profile instanceof Profile) {
+            if (handle instanceof Package) {
+                ((Model) handle).unapplyProfile((Profile) profile);
+            } else if (handle instanceof Profile) {
+                ((Profile) handle).unapplyProfile((Profile) profile);
+            }
+        }
+    }
+
     public Object makeProfileApplicable(Object handle) {
         Object result = null;
         if (handle instanceof Profile) {

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java?view=diff&pathrev=17440&r1=17439&r2=17440
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java	2009-11-01 11:31:35-0700
@@ -356,6 +356,9 @@
                 + " or baseClass: " + baseClass);
     }
 
+    public void applyProfile(Object handle, Object profile) {
+        // do nothing
+    }
 
     public void removeBaseClass(Object handle, Object baseClass) {
         try {
@@ -469,6 +472,9 @@
                 + type);
     }
 
+    public void unapplyProfile(Object handle, Object profile) {
+        // do nothing
+    }
 
     public boolean hasStereotype(Object handle, String name) {
         if (name == null || !(handle instanceof ModelElement)) {

Modified: trunk/src/argouml-core-model/src/org/argouml/model/AbstractExtensionMechanismsHelperDecorator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/AbstractExtensionMechanismsHelperDecorator.java?view=diff&pathrev=17440&r1=17439&r2=17440
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/AbstractExtensionMechanismsHelperDecorator.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/AbstractExtensionMechanismsHelperDecorator.java	2009-11-01 11:31:35-0700
@@ -154,4 +154,12 @@
     public Object makeProfileApplicable(Object handle) {
         return impl.makeProfileApplicable(handle);
     }
+
+    public void applyProfile(Object handle, Object profile) {
+        impl.applyProfile(handle, profile);
+    }
+
+    public void unapplyProfile(Object handle, Object profile) {
+        impl.unapplyProfile(handle, profile);
+    }
 }

Modified: trunk/src/argouml-core-model/src/org/argouml/model/ExtensionMechanismsHelper.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/ExtensionMechanismsHelper.java?view=diff&pathrev=17440&r1=17439&r2=17440
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/ExtensionMechanismsHelper.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/ExtensionMechanismsHelper.java	2009-11-01 11:31:35-0700
@@ -247,6 +247,14 @@
     void addTaggedValue(Object handle, Object taggedValue);
 
     /**
+     * Apply a profile to a model or another profile.
+     * 
+     * @param handle The model or profile.
+     * @param profile The to be applied profile.
+     */
+    public void applyProfile(Object handle, Object profile);
+
+    /**
      * Remove a tagged value.
      *
      * @param handle The model element to remove from.
@@ -263,6 +271,14 @@
     void setTaggedValue(Object handle, Collection taggedValues);
 
     /**
+     * Unapply a profile to a model or another profile.
+     * 
+     * @param handle The model or profile.
+     * @param profile The to be unapplied profile.
+     */
+    public void unapplyProfile(Object handle, Object profile);
+
+    /**
      * Returns <code>true</code> if the given ModelElement has a Stereotype
      * with the given name.
      *

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

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.