svn commit: r17704 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlHelperMDRImpl.java

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

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

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

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlHelperMDRImpl.java?view=diff&pathrev=17704&r1=17703&r2=17704
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlHelperMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlHelperMDRImpl.java	2009-12-23 08:15:17-0800
@@ -25,14 +25,13 @@
 package org.argouml.model.mdr;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
 import org.argouml.model.Model;
 import org.argouml.model.UmlHelper;
-import org.argouml.model.UmlHelper.Direction;
 import org.omg.uml.behavioralelements.collaborations.Message;
 import org.omg.uml.behavioralelements.commonbehavior.Action;
 import org.omg.uml.behavioralelements.commonbehavior.ActionSequence;
@@ -51,10 +50,10 @@
 import org.omg.uml.foundation.core.Enumeration;
 import org.omg.uml.foundation.core.EnumerationLiteral;
 import org.omg.uml.foundation.core.Feature;
+import org.omg.uml.foundation.core.Operation;
 import org.omg.uml.foundation.core.Parameter;
 import org.omg.uml.foundation.core.Relationship;
 import org.omg.uml.foundation.core.UmlAssociation;
-import org.omg.uml.foundation.core.UmlClass;
 
 /**
  * Helper class for UML metamodel.
@@ -236,6 +235,26 @@
         }
     }
     
+    /*
+     * @see org.argouml.model.UmlHelper#move(java.lang.Object, org.argouml.model.UmlHelper.Direction)
+     */
+    public boolean isMovable(Object metaType) {
+        final Class<?>[] movableMetaType = new Class<?> [] {
+            Action.class, 
+            Argument.class, 
+            AssociationEnd.class, 
+            Attribute.class, 
+            EnumerationLiteral.class,
+            Extend.class,
+            ExtensionPoint.class,
+            Feature.class, 
+            LinkEnd.class,
+            Operation.class, 
+            Parameter.class};
+        return Arrays.asList(movableMetaType).contains(metaType);
+    }
+    
+    
     private int newPosition(int index, int size, Direction direction) {
         final int posn;
         if (direction == Direction.DOWN) {

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

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.