svn commit: r19378 - trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-05-08 02:40:25-0700
New Revision: 19378

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java

Log:
Start work on composite state

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java?view=diff&pathrev=19378&r1=19377&r2=19378
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	2011-05-08 02:40:25-0700
@@ -42,6 +42,7 @@
 import java.awt.Rectangle;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyVetoException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 
@@ -398,51 +399,34 @@
      * @see org.argouml.uml.diagram.ui.UMLDiagram#getUmlActions()
      */
     protected Object[] getUmlActions() {
+        
+        ArrayList actions = new ArrayList();
+        
+        actions.add(getActionState());
+        actions.add(getActionCompositeState());
+        actions.add(getActionTransition());
+        
         if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
-            Object[] actions =
-            {
-                getActionState(),
-                getActionCompositeState(),
-                getActionTransition(),
-                getActionSynchState(),
-                getActionSubmachineState(),
-                getActionStubState(),
-                null,
-                getActionStartPseudoState(),
-                getActionFinalPseudoState(),
-                getActionJunctionPseudoState(),
-                getActionChoicePseudoState(),
-                getActionForkPseudoState(),
-                getActionJoinPseudoState(),
-                getActionShallowHistoryPseudoState(),
-                getActionDeepHistoryPseudoState(),
-                null,
-                getTriggerActions(),
-                getActionGuard(),
-                getEffectActions(),
-            };
-            return actions;
-        } else {
-            Object[] actions =
-            {
-                getActionState(),
-                getActionTransition(),
-                null,
-                getActionStartPseudoState(),
-                getActionFinalPseudoState(),
-                getActionJunctionPseudoState(),
-                getActionChoicePseudoState(),
-                getActionForkPseudoState(),
-                getActionJoinPseudoState(),
-                getActionShallowHistoryPseudoState(),
-                getActionDeepHistoryPseudoState(),
-                null,
-                getTriggerActions(),
-                getActionGuard(),
-                getEffectActions(),
-            };
-            return actions;
+            actions.add(getActionSynchState());
+            actions.add(getActionSubmachineState());
+            actions.add(getActionStubState());
         }
+        
+        actions.add(null);
+        actions.add(getActionStartPseudoState());
+        actions.add(getActionFinalPseudoState());
+        actions.add(getActionJunctionPseudoState());
+        actions.add(getActionChoicePseudoState());
+        actions.add(getActionForkPseudoState());
+        actions.add(getActionJoinPseudoState());
+        actions.add(getActionShallowHistoryPseudoState());
+        actions.add(getActionDeepHistoryPseudoState());
+        actions.add(null);
+        actions.add(getTriggerActions());
+        actions.add(getActionGuard());
+        actions.add(getEffectActions());
+        
+        return actions.toArray();
     }
 
     protected Object[] getTriggerActions() {
@@ -495,10 +479,19 @@
      */
     protected Action getActionCompositeState() {
         if (actionCompositeState == null) {
-            actionCompositeState =
-                new RadioAction(new CmdCreateNode(
-                        Model.getMetaTypes().getCompositeState(),
-                        "button.new-compositestate"));
+            if (Model.getFacade().getUmlVersion().startsWith("1")) {
+                actionCompositeState =
+                    new RadioAction(new CmdCreateNode(
+                            Model.getMetaTypes().getCompositeState(),
+                            "button.new-compositestate"));
+            } else {
+                // TODO: We need a specialist action here to set the composite flag]
+                // on the state after its created.
+                actionCompositeState =
+                    new RadioAction(new CmdCreateNode(
+                            Model.getMetaTypes().getState(),
+                            "button.new-compositestate"));
+            }
         }
         return actionCompositeState;
     }

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

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.