svn commit: r12959 - trunk/src_new/org/argouml: application ui ui/cmd

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-07-02 10:53:38-0700
New Revision: 12959

Added:
   trunk/src_new/org/argouml/ui/cmd/InitUiCmdSubsystem.java   (contents, props changed)
   trunk/src_new/org/argouml/ui/cmd/SettingsTabShortcuts.java
      - copied, changed from r12883, /trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java
Removed:
   trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java
Modified:
   trunk/src_new/org/argouml/application/Main.java
   trunk/src_new/org/argouml/ui/GUI.java
   trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java
   trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java

Log:
Remove (cyclic) dependency from org.argouml.ui to org.argouml.ui.cmd.

Modified: trunk/src_new/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/Main.java?view=diff&rev=12959&p1=trunk/src_new/org/argouml/application/Main.java&p2=trunk/src_new/org/argouml/application/Main.java&r1=12958&r2=12959
==============================================================================
--- trunk/src_new/org/argouml/application/Main.java	(original)
+++ trunk/src_new/org/argouml/application/Main.java	2007-07-02 10:53:38-0700
@@ -74,9 +74,8 @@
 import org.argouml.ui.LookAndFeelMgr;
 import org.argouml.ui.ProjectBrowser;
 import org.argouml.ui.SplashScreen;
-import org.argouml.ui.cmd.ActionAdjustGrid;
-import org.argouml.ui.cmd.ActionAdjustSnap;
 import org.argouml.ui.cmd.ActionExit;
+import org.argouml.ui.cmd.InitUiCmdSubsystem;
 import org.argouml.ui.cmd.PrintManager;
 import org.argouml.uml.reveng.java.JavaImport;
 import org.argouml.util.logging.SimpleTimer;
@@ -269,6 +268,7 @@
 	st.mark("initialize gui");
         initializeGUI(splash);
         
+        initSubsystem(new InitUiCmdSubsystem());
         initSubsystem(new InitNotationUI());
         initSubsystem(new InitNotation());
 
@@ -396,9 +396,6 @@
         Thread postLoadThead = new Thread(pl);
         postLoadThead.start();
 
-        ActionAdjustSnap.init();
-        ActionAdjustGrid.init();
-
         LOG.info("");
         LOG.info("profile of load time ############");
         for (Enumeration i = st.result(); i.hasMoreElements();) {

Modified: trunk/src_new/org/argouml/ui/GUI.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/GUI.java?view=diff&rev=12959&p1=trunk/src_new/org/argouml/ui/GUI.java&p2=trunk/src_new/org/argouml/ui/GUI.java&r1=12958&r2=12959
==============================================================================
--- trunk/src_new/org/argouml/ui/GUI.java	(original)
+++ trunk/src_new/org/argouml/ui/GUI.java	2007-07-02 10:53:38-0700
@@ -59,7 +59,6 @@
         addSettingsTab(new SettingsTabEnvironment());
         addSettingsTab(new SettingsTabUser());
         addSettingsTab(new SettingsTabAppearance());
-        addSettingsTab(new SettingsTabShortcuts());
 
         addProjectSettingsTab(new ProjectSettingsTabProperties());
     }

Removed: trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java?view=auto&rev=12958

Modified: trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java?view=diff&rev=12959&p1=trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java&p2=trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java&r1=12958&r2=12959
==============================================================================
--- trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java	(original)
+++ trunk/src_new/org/argouml/ui/cmd/ActionAdjustGrid.java	2007-07-02 10:53:38-0700
@@ -1,5 +1,5 @@
 // $Id: eclipse-argo-codetemplates.xml 10612 2006-05-25 12:58:04Z linus $

-// Copyright (c) 2006 The Regents of the University of California. All

+// Copyright (c) 2006-2007 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

@@ -30,7 +30,6 @@
 import java.util.ArrayList;

 import java.util.Enumeration;

 import java.util.HashMap;

-import java.util.Iterator;

 import java.util.List;

 

 import javax.swing.AbstractAction;

@@ -55,7 +54,7 @@
  */

 public class ActionAdjustGrid extends AbstractAction {

 

-    private HashMap myMap;

+    private HashMap<String, Comparable> myMap;

     private static final String DEFAULT_ID = "03";

     private static ButtonGroup myGroup;

 

@@ -67,7 +66,7 @@
      *          the spacing, paintLines and paintDots. 

      * @param name the name for this action

      */

-    private ActionAdjustGrid(HashMap map, String name) {

+    private ActionAdjustGrid(HashMap<String, Comparable> map, String name) {

         super();

         myMap = map;

         putValue(Action.NAME, name);

@@ -97,13 +96,10 @@
      * Additionally, the ButtonGroup is searched for the right Action, 

      * and when found, the button's model initialised.

      */

-    public static void init() {

+    static void init() {

         String id = Configuration.getString(Argo.KEY_GRID, DEFAULT_ID);

-        List actions = createAdjustGridActions(false);

-        Iterator i = actions.iterator();

-        Action a;

-        while (i.hasNext()) {

-            a = (Action) i.next();

+        List<Action> actions = createAdjustGridActions(false);

+        for (Action a : actions) {

             if (a.getValue("ID").equals(id)) {

                 a.actionPerformed(null);

 

@@ -135,15 +131,15 @@
      * @param longStrings

      * @return List of Actions which adjust the grid

      */

-    static List createAdjustGridActions(boolean longStrings) {

-        List result = new ArrayList();

+    static List<Action> createAdjustGridActions(boolean longStrings) {

+        List<Action> result = new ArrayList<Action>();

         Action a;

         String shortname, longname, name;

 

         shortname = "menu.item.lines-16";

         longname = "action.adjust-grid.lines-16";

         name = Translator.localize(longStrings ? longname : shortname);

-        HashMap map1 = new HashMap(4);

+        HashMap<String, Comparable> map1 = new HashMap<String, Comparable>(4);

         map1.put("spacing", new Integer(16));

         map1.put("paintLines", new Boolean(true));

         map1.put("paintDots", new Boolean(true));

@@ -156,7 +152,7 @@
         shortname = "menu.item.lines-8";

         longname = "action.adjust-grid.lines-8";

         name = Translator.localize(longStrings ? longname : shortname);

-        HashMap map2 = new HashMap(4);

+        HashMap<String, Comparable> map2 = new HashMap<String, Comparable>(4);

         map2.put("spacing", new Integer(8));

         map2.put("paintLines", new Boolean(true));

         map2.put("paintDots", new Boolean(true));

@@ -169,7 +165,7 @@
         shortname = "menu.item.dots-16";

         longname = "action.adjust-grid.dots-16";

         name = Translator.localize(longStrings ? longname : shortname);

-        HashMap map3 = new HashMap(4);

+        HashMap<String, Comparable> map3 = new HashMap<String, Comparable>(4);

         map3.put("spacing", new Integer(16));

         map3.put("paintLines", new Boolean(false));

         map3.put("paintDots", new Boolean(true));

@@ -182,7 +178,7 @@
         shortname = "menu.item.dots-32";

         longname = "action.adjust-grid.dots-32";

         name = Translator.localize(longStrings ? longname : shortname);

-        HashMap map4 = new HashMap(4);

+        HashMap<String, Comparable> map4 = new HashMap<String, Comparable>(4);

         map4.put("spacing", new Integer(32));

         map4.put("paintLines", new Boolean(false));

         map4.put("paintDots", new Boolean(true));

@@ -195,7 +191,7 @@
         shortname = "menu.item.none";

         longname = "action.adjust-grid.none";

         name = Translator.localize(longStrings ? longname : shortname);

-        HashMap map5 = new HashMap(4);

+        HashMap<String, Comparable> map5 = new HashMap<String, Comparable>(4);

         map5.put("spacing", new Integer(16));

         map5.put("paintLines", new Boolean(false));

         map5.put("paintDots", new Boolean(false));


Modified: trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java?view=diff&rev=12959&p1=trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java&p2=trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java&r1=12958&r2=12959
==============================================================================
--- trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java	(original)
+++ trunk/src_new/org/argouml/ui/cmd/ActionAdjustSnap.java	2007-07-02 10:53:38-0700
@@ -1,5 +1,5 @@
 // $Id: eclipse-argo-codetemplates.xml 10612 2006-05-25 12:58:04Z linus $

-// Copyright (c) 2006 The Regents of the University of California. All

+// Copyright (c) 2006-2007 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

@@ -29,7 +29,6 @@
 import java.awt.event.KeyEvent;

 import java.util.ArrayList;

 import java.util.Enumeration;

-import java.util.Iterator;

 import java.util.List;

 

 import javax.swing.AbstractAction;

@@ -86,13 +85,10 @@
      * This function is intended for the initial setting 

      * of the snap when ArgoUML is started.

      */

-    public static void init() {

+    static void init() {

         String id = Configuration.getString(Argo.KEY_SNAP, DEFAULT_ID);

-        List actions = createAdjustSnapActions();

-        Iterator i = actions.iterator();

-        Action a;

-        while (i.hasNext()) {

-            a = (Action) i.next();

+        List<Action> actions = createAdjustSnapActions();

+        for (Action a : actions) {

             if (a.getValue("ID").equals(id)) {

                 a.actionPerformed(null);

 

@@ -121,8 +117,8 @@
      * 

      * @return List of Actions which adjust the size of the snap grid

      */

-    static List createAdjustSnapActions() {

-        List result = new ArrayList();

+    static List<Action> createAdjustSnapActions() {

+        List<Action> result = new ArrayList<Action>();

         Action a;

         String name;

         


Added: trunk/src_new/org/argouml/ui/cmd/InitUiCmdSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/InitUiCmdSubsystem.java?view=auto&rev=12959
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/ui/cmd/InitUiCmdSubsystem.java	2007-07-02 10:53:38-0700
@@ -0,0 +1,57 @@
+// $Id$
+// Copyright (c) 2007 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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.application.api.InitSubsystem;
+
+/**
+ * Initialise this subsystem.
+ *
+ * @author Michiel
+ */
+public class InitUiCmdSubsystem implements InitSubsystem {
+
+    public List<GUISettingsTabInterface> getProjectSettingsTabs() {
+        return Collections.emptyList();
+    }
+
+    public List<GUISettingsTabInterface> getSettingsTabs() {
+        List<GUISettingsTabInterface> result = 
+            new ArrayList<GUISettingsTabInterface>();
+        result.add(new SettingsTabShortcuts());
+        return result;
+    }
+
+    public void init() {
+        ActionAdjustSnap.init();
+        ActionAdjustGrid.init();
+    }
+
+}

Copied: trunk/src_new/org/argouml/ui/cmd/SettingsTabShortcuts.java (from r12883, /trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java)
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/SettingsTabShortcuts.java?view=diff&rev=12959&p1=/trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java&p2=trunk/src_new/org/argouml/ui/cmd/SettingsTabShortcuts.java&r1=12883&r2=12959
==============================================================================
--- /trunk/src_new/org/argouml/ui/SettingsTabShortcuts.java	(original)
+++ trunk/src_new/org/argouml/ui/cmd/SettingsTabShortcuts.java	2007-07-02 10:53:38-0700
@@ -22,7 +22,7 @@
 // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
 // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 
-package org.argouml.ui;
+package org.argouml.ui.cmd;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -50,11 +50,6 @@
 
 import org.argouml.application.api.GUISettingsTabInterface;
 import org.argouml.i18n.Translator;
-import org.argouml.ui.cmd.Action;
-import org.argouml.ui.cmd.ShortcutChangedEvent;
-import org.argouml.ui.cmd.ShortcutChangedListener;
-import org.argouml.ui.cmd.ShortcutField;
-import org.argouml.ui.cmd.ShortcutMgr;
 import org.argouml.util.KeyEventUtils;
 
 /**
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.