svn commit: r17402 - trunk/src/argouml-app/src/org/argouml/ui

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-10-18 18:21:28-0700
New Revision: 17402

Added:
   trunk/src/argouml-app/src/org/argouml/ui/MenuBar14.java
   trunk/src/argouml-app/src/org/argouml/ui/MenuBar2.java
   trunk/src/argouml-app/src/org/argouml/ui/MenuBarFactory.java

Log:
Remove option to create collaboration diagram in UML2 (that diagram type no longer exists)

Added: trunk/src/argouml-app/src/org/argouml/ui/MenuBar14.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/MenuBar14.java?view=markup&pathrev=17402
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/ui/MenuBar14.java	2009-10-18 18:21:28-0700
@@ -0,0 +1,107 @@
+// $Id:GenericArgoMenuBar.java 13104 2007-07-21 18:29:31Z mvw $
+// Copyright (c) 1996,2009 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.ui;
+
+import javax.swing.JMenuItem;
+
+import org.argouml.ui.cmd.GenericArgoMenuBar;
+import org.argouml.ui.cmd.ShortcutMgr;
+import org.argouml.uml.ui.ActionActivityDiagram;
+import org.argouml.uml.ui.ActionClassDiagram;
+import org.argouml.uml.ui.ActionCollaborationDiagram;
+import org.argouml.uml.ui.ActionDeploymentDiagram;
+import org.argouml.uml.ui.ActionSequenceDiagram;
+import org.argouml.uml.ui.ActionStateDiagram;
+import org.argouml.uml.ui.ActionUseCaseDiagram;
+
+/**
+ * The Menu and Toolbar for UML1.4
+ */
+public class MenuBar14 extends GenericArgoMenuBar {
+    
+    /**
+     * Build the menu "Create" and the toolbar for diagram creation. These are
+     * build together to guarantee that the same items are present in both, and
+     * in the same sequence.
+     * <p>
+     * 
+     * The sequence of these items was determined by issue 1821.
+     */
+    protected void initMenuCreate() {
+        super.initMenuCreate();
+        getCreateDiagramMenu().removeAll();
+        getCreateDiagramToolbar().removeAll();
+        JMenuItem usecaseDiagram = getCreateDiagramMenu()
+                .add(new ActionUseCaseDiagram());
+        setMnemonic(usecaseDiagram, "Usecase Diagram");
+        getCreateDiagramToolbar().add((new ActionUseCaseDiagram()));
+        ShortcutMgr.assignAccelerator(usecaseDiagram,
+                ShortcutMgr.ACTION_USE_CASE_DIAGRAM);
+
+        JMenuItem classDiagram =
+            getCreateDiagramMenu().add(new ActionClassDiagram());
+        setMnemonic(classDiagram, "Class Diagram");
+        getCreateDiagramToolbar().add((new ActionClassDiagram()));
+        ShortcutMgr.assignAccelerator(classDiagram,
+                ShortcutMgr.ACTION_CLASS_DIAGRAM);
+
+        JMenuItem sequenzDiagram =
+            getCreateDiagramMenu().add(new ActionSequenceDiagram());
+        setMnemonic(sequenzDiagram, "Sequenz Diagram");
+        getCreateDiagramToolbar().add((new ActionSequenceDiagram()));
+        ShortcutMgr.assignAccelerator(sequenzDiagram,
+                ShortcutMgr.ACTION_SEQUENCE_DIAGRAM);
+        
+        JMenuItem collaborationDiagram =
+            getCreateDiagramMenu().add(new ActionCollaborationDiagram());
+        setMnemonic(collaborationDiagram, "Collaboration Diagram");
+        getCreateDiagramToolbar().add((new ActionCollaborationDiagram()));
+        ShortcutMgr.assignAccelerator(collaborationDiagram,
+                ShortcutMgr.ACTION_COLLABORATION_DIAGRAM);
+
+        JMenuItem stateDiagram =
+            getCreateDiagramMenu().add(new ActionStateDiagram());
+        setMnemonic(stateDiagram, "Statechart Diagram");
+        getCreateDiagramToolbar().add((new ActionStateDiagram()));
+        ShortcutMgr.assignAccelerator(stateDiagram,
+                ShortcutMgr.ACTION_STATE_DIAGRAM);
+
+        JMenuItem activityDiagram =
+            getCreateDiagramMenu().add(new ActionActivityDiagram());
+        setMnemonic(activityDiagram, "Activity Diagram");
+        getCreateDiagramToolbar().add((new ActionActivityDiagram()));
+        ShortcutMgr.assignAccelerator(activityDiagram,
+                ShortcutMgr.ACTION_ACTIVITY_DIAGRAM);
+
+        JMenuItem deploymentDiagram =
+            getCreateDiagramMenu().add(new ActionDeploymentDiagram());
+        setMnemonic(deploymentDiagram, "Deployment Diagram");
+        getCreateDiagramToolbar().add((new ActionDeploymentDiagram()));
+        ShortcutMgr.assignAccelerator(deploymentDiagram,
+                ShortcutMgr.ACTION_DEPLOYMENT_DIAGRAM);
+
+        getCreateDiagramToolbar().setFloatable(true);
+    }
+}

Added: trunk/src/argouml-app/src/org/argouml/ui/MenuBar2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/MenuBar2.java?view=markup&pathrev=17402
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/ui/MenuBar2.java	2009-10-18 18:21:28-0700
@@ -0,0 +1,99 @@
+// $Id:GenericArgoMenuBar.java 13104 2007-07-21 18:29:31Z mvw $
+// Copyright (c) 1996,2009 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.ui;
+
+import javax.swing.JMenuItem;
+
+import org.argouml.ui.cmd.GenericArgoMenuBar;
+import org.argouml.ui.cmd.ShortcutMgr;
+import org.argouml.uml.ui.ActionActivityDiagram;
+import org.argouml.uml.ui.ActionClassDiagram;
+import org.argouml.uml.ui.ActionDeploymentDiagram;
+import org.argouml.uml.ui.ActionSequenceDiagram;
+import org.argouml.uml.ui.ActionStateDiagram;
+import org.argouml.uml.ui.ActionUseCaseDiagram;
+
+/**
+ * The Menu and Toolbar for UML2.x
+ */
+public class MenuBar2 extends GenericArgoMenuBar {
+    
+    /**
+     * Build the menu "Create" and the toolbar for diagram creation. These are
+     * build together to guarantee that the same items are present in both, and
+     * in the same sequence.
+     * <p>
+     * 
+     * The sequence of these items was determined by issue 1821.
+     */
+    protected void initMenuCreate() {
+        super.initMenuCreate();
+        getCreateDiagramMenu().removeAll();
+        getCreateDiagramToolbar().removeAll();
+        JMenuItem usecaseDiagram = getCreateDiagramMenu()
+                .add(new ActionUseCaseDiagram());
+        setMnemonic(usecaseDiagram, "Usecase Diagram");
+        getCreateDiagramToolbar().add((new ActionUseCaseDiagram()));
+        ShortcutMgr.assignAccelerator(usecaseDiagram,
+                ShortcutMgr.ACTION_USE_CASE_DIAGRAM);
+
+        JMenuItem classDiagram =
+            getCreateDiagramMenu().add(new ActionClassDiagram());
+        setMnemonic(classDiagram, "Class Diagram");
+        getCreateDiagramToolbar().add((new ActionClassDiagram()));
+        ShortcutMgr.assignAccelerator(classDiagram,
+                ShortcutMgr.ACTION_CLASS_DIAGRAM);
+
+        JMenuItem sequenzDiagram =
+            getCreateDiagramMenu().add(new ActionSequenceDiagram());
+        setMnemonic(sequenzDiagram, "Sequenz Diagram");
+        getCreateDiagramToolbar().add((new ActionSequenceDiagram()));
+        ShortcutMgr.assignAccelerator(sequenzDiagram,
+                ShortcutMgr.ACTION_SEQUENCE_DIAGRAM);
+        
+        JMenuItem stateDiagram =
+            getCreateDiagramMenu().add(new ActionStateDiagram());
+        setMnemonic(stateDiagram, "Statechart Diagram");
+        getCreateDiagramToolbar().add((new ActionStateDiagram()));
+        ShortcutMgr.assignAccelerator(stateDiagram,
+                ShortcutMgr.ACTION_STATE_DIAGRAM);
+
+        JMenuItem activityDiagram =
+            getCreateDiagramMenu().add(new ActionActivityDiagram());
+        setMnemonic(activityDiagram, "Activity Diagram");
+        getCreateDiagramToolbar().add((new ActionActivityDiagram()));
+        ShortcutMgr.assignAccelerator(activityDiagram,
+                ShortcutMgr.ACTION_ACTIVITY_DIAGRAM);
+
+        JMenuItem deploymentDiagram =
+            getCreateDiagramMenu().add(new ActionDeploymentDiagram());
+        setMnemonic(deploymentDiagram, "Deployment Diagram");
+        getCreateDiagramToolbar().add((new ActionDeploymentDiagram()));
+        ShortcutMgr.assignAccelerator(deploymentDiagram,
+                ShortcutMgr.ACTION_DEPLOYMENT_DIAGRAM);
+
+        getCreateDiagramToolbar().setFloatable(true);
+    }
+}

Added: trunk/src/argouml-app/src/org/argouml/ui/MenuBarFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/MenuBarFactory.java?view=markup&pathrev=17402
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/ui/MenuBarFactory.java	2009-10-18 18:21:28-0700
@@ -0,0 +1,51 @@
+// $Id:GenericArgoMenuBar.java 13104 2007-07-21 18:29:31Z mvw $
+// Copyright (c) 1996,2009 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.ui;
+
+import org.argouml.model.Model;
+import org.argouml.ui.cmd.GenericArgoMenuBar;
+
+/**
+ * A factory to create the menu bar for the application
+ * @since 0.29.2
+ */
+class MenuBarFactory {
+    
+    /**
+     * Build the menu "Create" and the toolbar for diagram creation. These are
+     * build together to guarantee that the same items are present in both, and
+     * in the same sequence.
+     * <p>
+     * 
+     * The sequence of these items was determined by issue 1821.
+     */
+    static GenericArgoMenuBar createApplicationMenuBar() {
+        if (Model.getFacade().getUmlVersion().charAt(0) == '2') {
+            return new MenuBar2();
+        } else {
+            return new MenuBar14();
+        }
+    }
+}

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

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.