svn commit: r17702 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-12-23 08:15:04-0800
New Revision: 17702

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java

Log:
Show move buttons on model elements lists with items that can be moved.

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java?view=diff&pathrev=17702&r1=17701&r2=17702
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java	2009-12-23 08:15:04-0800
@@ -25,10 +25,17 @@
 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 package org.argouml.model.euml;
 
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
 
 import org.argouml.model.UmlHelper;
+import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Extend;
+import org.eclipse.uml2.uml.ExtensionPoint;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Parameter;
 import org.eclipse.uml2.uml.Property;
 import org.eclipse.uml2.uml.Relationship;
 import org.eclipse.uml2.uml.Transition;
@@ -101,6 +108,21 @@
         }
         throw new IllegalArgumentException();
     }
+    
+    /*
+     * @see org.argouml.model.UmlHelper#move(java.lang.Object, org.argouml.model.UmlHelper.Direction)
+     */
+    public boolean isMovable(Object metaType) {
+        final Class<?>[] movableMetaType = {
+            Action.class, 
+            EnumerationLiteral.class,
+            Extend.class,
+            ExtensionPoint.class,
+            Operation.class,
+            Parameter.class,
+            Property.class};
+        return Arrays.asList(movableMetaType).contains(metaType);
+    }
 
     /*
      * @see org.argouml.model.UmlHelper#move(java.lang.Object, org.argouml.model.UmlHelper.Direction)

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

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.