svn commit: r18120 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-03-21 13:44:07-0700
New Revision: 18120

Modified:
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java

Log:
Allow a Method to be added to an Operation in UML1.4

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java?view=diff&pathrev=18120&r1=18119&r2=18120
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java	2010-03-21 13:44:07-0700
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -423,7 +423,8 @@
         validContainmentMap.put(Operation.class, 
                 new Class<?>[] { 
                     Parameter.class,
-                    Signal.class
+                    Signal.class,
+                    Method.class
                 });
         
         // specifies valid elements for an Event to contain
@@ -593,6 +594,8 @@
             return getCommonBehavior().createException();
         } else if (elementType == metaTypes.getTransition()) {
             return getStateMachines().createTransition();
+        } else if (elementType == metaTypes.getTransition()) {
+            return getStateMachines().createTransition();
         }
             
         throw new IllegalArgumentException(
@@ -609,6 +612,7 @@
         // cause unexpected behaviour.
         if (this.modelImpl.getFacade().isAFeature(container)
                 && elementType != metaTypes.getParameter()
+                && elementType != metaTypes.getMethod()
                 && elementType != metaTypes.getSignal()) {
             container = this.modelImpl.getFacade().getOwner(container);
         }
@@ -641,6 +645,12 @@
             element = getCore().buildParameter(container, null);
         } else if (elementType == metaTypes.getSignal()) {
             element = modelImpl.getCommonBehaviorFactory().buildSignal(container);
+        } else if (elementType == metaTypes.getMethod()) {
+            final Operation op = (Operation) container;
+            element = getCore().buildMethod(op.getName());
+            modelImpl.getCoreHelper().addMethod(op, element);
+            modelImpl.getCoreHelper().addFeature(
+                    modelImpl.getFacade().getOwner(op), element);
         } else {
             // build all other elements using existing buildNode
             element = buildNode(elementType);

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

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.