svn commit: r15192 - trunk/src/argouml-app/src/org/argouml/ui/cmd

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-07-07 09:49:55-0700
New Revision: 15192

Added:
   trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionAdjustPageBreaks.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectAll.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectInvert.java   (contents, props changed)
Modified:
   trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
   trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java

Log:
Fix for part 1 of issue 5207: Configure Shortcuts broken.

Added: trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionAdjustPageBreaks.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionAdjustPageBreaks.java?view=auto&rev=15192
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionAdjustPageBreaks.java	2008-07-07 09:49:55-0700
@@ -0,0 +1,53 @@
+// $Id$
+// Copyright (c) 2008 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.cmd;
+
+import org.argouml.i18n.Translator;
+import org.tigris.gef.base.AdjustPageBreaksAction;
+
+/**
+ * This Action toggles the display of the page breaks lines.
+ *
+ * @author Michiel
+ */
+public class ActionAdjustPageBreaks extends AdjustPageBreaksAction {
+
+    /**
+     * The Constructor.
+     */
+    public ActionAdjustPageBreaks() {
+        this(Translator.localize("menu.adjust-pagebreaks"));
+    }
+
+    /**
+     * The Constructor.
+     * 
+     * @param name the name of the action
+     */
+    public ActionAdjustPageBreaks(String name) {
+        super(name);
+    }
+
+}

Added: trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectAll.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectAll.java?view=auto&rev=15192
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectAll.java	2008-07-07 09:49:55-0700
@@ -0,0 +1,53 @@
+// $Id$
+// Copyright (c) 2008 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.cmd;
+
+import org.argouml.cognitive.Translator;
+import org.tigris.gef.base.SelectAllAction;
+
+/**
+ * This action selects all elements on the current drawing.
+ *
+ * @author Michiel
+ */
+public class ActionSelectAll extends SelectAllAction {
+
+    /**
+     * The constructor.
+     */
+    public ActionSelectAll() {
+        this(Translator.localize("menu.item.select-all"));
+    }
+
+    /**
+     * The Constructor.
+     * 
+     * @param name the name of the action
+     */
+    ActionSelectAll(String name) {
+        super(name);
+    }
+
+}

Added: trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectInvert.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectInvert.java?view=auto&rev=15192
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectInvert.java	2008-07-07 09:49:55-0700
@@ -0,0 +1,53 @@
+// $Id$
+// Copyright (c) 2008 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.cmd;
+
+import org.argouml.cognitive.Translator;
+import org.tigris.gef.base.SelectInvertAction;
+
+/**
+ * This Action inverts the current selection.
+ *
+ * @author Michiel
+ */
+public class ActionSelectInvert extends SelectInvertAction {
+
+    /**
+     * The constructor.
+     */
+    public ActionSelectInvert() {
+        this(Translator.localize("menu.item.invert-selection"));
+    }
+
+    /**
+     * The constructor.
+     * 
+     * @param name the name of the action
+     */
+    ActionSelectInvert(String name) {
+        super(name);
+    }
+
+}

Modified: trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java?view=diff&rev=15192&p1=trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java&p2=trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java&r1=15191&r2=15192
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java	2008-07-07 09:49:55-0700
@@ -81,8 +81,6 @@
 import org.tigris.gef.base.AlignAction;
 import org.tigris.gef.base.DistributeAction;
 import org.tigris.gef.base.ReorderAction;
-import org.tigris.gef.base.SelectAllAction;
-import org.tigris.gef.base.SelectInvertAction;
 import org.tigris.toolbar.ToolBarFactory;
 
 /**
@@ -403,8 +401,7 @@
         setMnemonic(select, "Select");
         edit.add(select);
 
-        JMenuItem selectAllItem = select.add(
-                new SelectAllAction(menuItemLocalize("Select All")));
+        JMenuItem selectAllItem = select.add(new ActionSelectAll());
         setMnemonic(selectAllItem, "Select All");
         ShortcutMgr.assignAccelerator(selectAllItem,
                 ShortcutMgr.ACTION_SELECT_ALL);
@@ -419,8 +416,7 @@
                 ShortcutMgr.ACTION_NAVIGATE_FORWARD);
         select.addSeparator();
 
-        JMenuItem selectInvert = select.add(
-                new SelectInvertAction(menuItemLocalize("Invert Selection")));
+        JMenuItem selectInvert = select.add(new ActionSelectInvert());
         setMnemonic(selectInvert, "Invert Selection");
         ShortcutMgr.assignAccelerator(selectInvert,
                 ShortcutMgr.ACTION_SELECT_INVERT);
@@ -535,10 +531,8 @@
                     ShortcutMgr.ACTION_ADJUST_GUIDE + cmdAS.getValue("ID"));
         }
 
-        Action pba  = new AdjustPageBreaksAction();
+        Action pba  = new ActionAdjustPageBreaks();
         JMenuItem adjustPageBreaks = view.add(pba);
-        pba.putValue(Action.NAME, 
-                Translator.localize("menu.adjust-pagebreaks"));
         setMnemonic(adjustPageBreaks, "Adjust Pagebreaks");
         ShortcutMgr.assignAccelerator(adjustPageBreaks,
                 ShortcutMgr.ACTION_ADJUST_PAGE_BREAKS);

Modified: trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java?view=diff&rev=15192&p1=trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java&p2=trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java&r1=15191&r2=15192
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java	2008-07-07 09:49:55-0700
@@ -77,8 +77,6 @@
 import org.tigris.gef.base.AlignAction;
 import org.tigris.gef.base.DistributeAction;
 import org.tigris.gef.base.ReorderAction;
-import org.tigris.gef.base.SelectAllAction;
-import org.tigris.gef.base.SelectInvertAction;
 import org.tigris.gef.base.ZoomAction;
 
 /**
@@ -582,7 +580,8 @@
 
         // edit menu
         putDefaultShortcut(ACTION_SELECT_ALL, KeyStroke.getKeyStroke(
-                KeyEvent.VK_A, DEFAULT_MASK), new SelectAllAction());
+                KeyEvent.VK_A, DEFAULT_MASK), 
+                new ActionSelectAll());
         putDefaultShortcut(ACTION_REDO, KeyStroke.getKeyStroke(KeyEvent.VK_Y,
                 DEFAULT_MASK), ProjectActions.getInstance().getRedoAction());
         putDefaultShortcut(ACTION_UNDO, KeyStroke.getKeyStroke(KeyEvent.VK_Z,
@@ -592,7 +591,7 @@
         putDefaultShortcut(ACTION_NAVIGATE_BACK, null,
                 new NavigateTargetBackAction());
         putDefaultShortcut(ACTION_SELECT_INVERT, null, 
-                new SelectInvertAction());
+                new ActionSelectInvert());
         putDefaultShortcut(ACTION_PERSPECTIVE_CONFIG, null,
                 new ActionPerspectiveConfig());
         putDefaultShortcut(ACTION_SETTINGS, null, new ActionSettings());
@@ -624,7 +623,7 @@
         }
 
         putDefaultShortcut(ACTION_ADJUST_PAGE_BREAKS, null,
-                new AdjustPageBreaksAction());
+                new ActionAdjustPageBreaks());
         putDefaultShortcut(ACTION_SHOW_XML_DUMP, null, new ActionShowXMLDump());
 
         putDefaultShortcut(ACTION_ZOOM_IN, KeyStroke.getKeyStroke(
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.