svn commit: r12945 - trunk/src_new/org/argouml: application/api application/events application/helpers i18n uml/reveng

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-06-30 22:48:28-0700
New Revision: 12945

Modified:
   trunk/src_new/org/argouml/application/api/Argo.java
   trunk/src_new/org/argouml/application/events/ArgoEventPump.java
   trunk/src_new/org/argouml/application/helpers/ResourceLoader.java
   trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java
   trunk/src_new/org/argouml/i18n/Translator.java
   trunk/src_new/org/argouml/uml/reveng/Import.java

Log:
Clean up warnings.

Modified: trunk/src_new/org/argouml/application/api/Argo.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/api/Argo.java?view=diff&rev=12945&p1=trunk/src_new/org/argouml/application/api/Argo.java&p2=trunk/src_new/org/argouml/application/api/Argo.java&r1=12944&r2=12945
==============================================================================
--- trunk/src_new/org/argouml/application/api/Argo.java	(original)
+++ trunk/src_new/org/argouml/application/api/Argo.java	2007-06-30 22:48:28-0700
@@ -347,6 +347,7 @@
      * used for backward compatibilty.
      * @deprecated for 0.25.1 by tfmorris - don't use for new code.
      */
+    @Deprecated
     public static final String DOCUMENTATION_TAG_ALT = "javadocs";
 
     /**

Modified: trunk/src_new/org/argouml/application/events/ArgoEventPump.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/events/ArgoEventPump.java?view=diff&rev=12945&p1=trunk/src_new/org/argouml/application/events/ArgoEventPump.java&p2=trunk/src_new/org/argouml/application/events/ArgoEventPump.java&r1=12944&r2=12945
==============================================================================
--- trunk/src_new/org/argouml/application/events/ArgoEventPump.java	(original)
+++ trunk/src_new/org/argouml/application/events/ArgoEventPump.java	2007-06-30 22:48:28-0700
@@ -25,7 +25,6 @@
 package org.argouml.application.events;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 
@@ -47,7 +46,7 @@
      *
      * It is a list of {@link Pair}.
      */
-    private List listeners;
+    private List<Pair> listeners;
 
     /**
      * The singleton.
@@ -103,7 +102,7 @@
      */
     protected void doAddListener(int event, ArgoEventListener listener) {
         if (listeners == null) {
-            listeners = new ArrayList();
+            listeners = new ArrayList<Pair>();
         }
         listeners.add(new Pair(event, listener));
     }
@@ -121,12 +120,9 @@
         if (listeners == null) {
             return;
         }
-        Iterator it = listeners.iterator();
-        List removeList = new ArrayList();
+        List<Pair> removeList = new ArrayList<Pair>();
         if (event == ArgoEventTypes.ANY_EVENT) {
-
-            while (it.hasNext()) {
-                Pair p = (Pair) it.next();
+            for (Pair p : listeners) {
                 if (p.listener == listener) {
                     removeList.add(p);
                 }
@@ -134,8 +130,7 @@
 
         } else {
             Pair test = new Pair(event, listener);
-            while (it.hasNext()) {
-                Pair p = (Pair) it.next();
+            for (Pair p : listeners) {
                 if (p.equals(test)) {
                     removeList.add(p);
                 }

Modified: trunk/src_new/org/argouml/application/helpers/ResourceLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/helpers/ResourceLoader.java?view=diff&rev=12945&p1=trunk/src_new/org/argouml/application/helpers/ResourceLoader.java&p2=trunk/src_new/org/argouml/application/helpers/ResourceLoader.java&r1=12944&r2=12945
==============================================================================
--- trunk/src_new/org/argouml/application/helpers/ResourceLoader.java	(original)
+++ trunk/src_new/org/argouml/application/helpers/ResourceLoader.java	2007-06-30 22:48:28-0700
@@ -29,6 +29,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.swing.Icon;
 import javax.swing.ImageIcon;
 
 /**
@@ -48,9 +49,10 @@
 
 // NOTE: This is package scope to force callers to use ResourceLoaderWrapper
 class ResourceLoader {
-    private static HashMap resourceCache = new HashMap();
-    private static List resourceLocations = new ArrayList();
-    private static List resourceExtensions = new ArrayList();
+    private static HashMap<String, Icon> resourceCache = 
+        new HashMap<String, Icon>();
+    private static List<String> resourceLocations = new ArrayList<String>();
+    private static List<String> resourceExtensions = new ArrayList<String>();
 
     public static ImageIcon lookupIconResource(String resource) {
         return lookupIconResource(resource, resource);

Modified: trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java?view=diff&rev=12945&p1=trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java&p2=trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java&r1=12944&r2=12945
==============================================================================
--- trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java	(original)
+++ trunk/src_new/org/argouml/application/helpers/ResourceLoaderWrapper.java	2007-06-30 22:48:28-0700
@@ -69,7 +69,7 @@
     private static ImageIcon exceptionIcon;
     private static ImageIcon commentIcon;
 
-    private Hashtable iconCache = new Hashtable();
+    private Hashtable<Class, Icon> iconCache = new Hashtable<Class, Icon>();
 
     /**
      * Singleton implementation.
@@ -229,7 +229,7 @@
             return null;
         }
 
-        Icon icon = (Icon) iconCache.get(value.getClass());
+        Icon icon = iconCache.get(value.getClass());
         
         try {
             if (Model.getFacade().isAPseudostate(value)) {
@@ -301,7 +301,7 @@
     /**
      * Map to convert tokens into file names.
      */
-    private static Map images = new HashMap();
+    private static Map<String, String> images = new HashMap<String, String>();
     static {
         images.put("action.about-argouml", "AboutArgoUML");
         images.put("action.activity-diagram", "Activity Diagram");
@@ -434,7 +434,7 @@
      * @return the file name (base part only).
      */
     public static String getImageBinding(String name) {
-        String found = (String) images.get(name);
+        String found = images.get(name);
         if (found == null) {
             return name;
         }

Modified: trunk/src_new/org/argouml/i18n/Translator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/i18n/Translator.java?view=diff&rev=12945&p1=trunk/src_new/org/argouml/i18n/Translator.java&p2=trunk/src_new/org/argouml/i18n/Translator.java&r1=12944&r2=12945
==============================================================================
--- trunk/src_new/org/argouml/i18n/Translator.java	(original)
+++ trunk/src_new/org/argouml/i18n/Translator.java	2007-06-30 22:48:28-0700
@@ -57,12 +57,13 @@
     /**
      * Store bundles for current Locale.
      */
-    private static Map bundles;
+    private static Map<String, ResourceBundle> bundles;
 
     /**
      * Store of ClassLoaders where we could find the bundles.
      */
-    private static List classLoaders = new ArrayList();
+    private static List<ClassLoader> classLoaders = 
+        new ArrayList<ClassLoader>();
 
     /**
      * Used to make this class self-initialising when needed.
@@ -91,6 +92,7 @@
      * 
      * @deprecated by MVW in V0.25, replaced by initForEclipse(String).
      */
+    @Deprecated
     public static void initForEclipse() {
         initInternal(""/*Configuration.getString(Argo.KEY_LOCALE)*/);
     }
@@ -113,6 +115,7 @@
      * Default Locale is set and resources Bundles are loaded.
      * @deprecated by MVW in V0.25.3, replaced by init(String locale).
      */
+    @Deprecated
     public static void init () {
         initInternal(""/*Configuration.getString(Argo.KEY_LOCALE)*/);
         /* TODO: This is an uplevel reference from GEF to ArgoUML - tfm
@@ -235,7 +238,7 @@
      */
     public static void setLocale(Locale locale) {
         Locale.setDefault(locale);
-        bundles = new HashMap();
+        bundles = new HashMap<String, ResourceBundle>();
     }
 
     /**
@@ -355,7 +358,7 @@
 
         loadBundle(name);
 
-        ResourceBundle bundle = (ResourceBundle) bundles.get(name);
+        ResourceBundle bundle = bundles.get(name);
         if (bundle == null) {
             LOG.debug("Bundle (" + name + ") for resource "
                     + key + " not found.");

Modified: trunk/src_new/org/argouml/uml/reveng/Import.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/reveng/Import.java?view=diff&rev=12945&p1=trunk/src_new/org/argouml/uml/reveng/Import.java&p2=trunk/src_new/org/argouml/uml/reveng/Import.java&r1=12944&r2=12945
==============================================================================
--- trunk/src_new/org/argouml/uml/reveng/Import.java	(original)
+++ trunk/src_new/org/argouml/uml/reveng/Import.java	2007-06-30 22:48:28-0700
@@ -35,9 +35,7 @@
 import java.awt.event.WindowEvent;
 import java.io.File;
 import java.net.URL;
-import java.util.Enumeration;
 import java.util.StringTokenizer;
-import java.util.Vector;
 
 import javax.swing.ButtonGroup;
 import javax.swing.DefaultListModel;
@@ -242,13 +240,8 @@
             general.add(new JLabel(
                     Translator.localize("action.import-select-lang")));
 
-            Vector languages = new Vector();
-
-            for (Enumeration keys = getModules().keys();
-                    keys.hasMoreElements();) {
-                languages.add(keys.nextElement());
-            }
-            JComboBox selectedLanguage = new JComboBox(languages);
+            JComboBox selectedLanguage = 
+                new JComboBox(getModules().keySet().toArray());
             selectedLanguage.addActionListener(
                     new SelectedLanguageListener(importInstance, tab));
             general.add(selectedLanguage);
@@ -380,11 +373,8 @@
 //            general.add(encoding);
 
             tab.add(general, Translator.localize("action.import-general"));
-            String moduleName = "";
-            if (getCurrentModule() instanceof ModuleInterface) {
-                moduleName = ((ModuleInterface) getCurrentModule()).getName();
-            }
-            tab.add(getConfigPanelExtension(), moduleName);
+            tab.add(getConfigPanelExtension(), 
+                    ((ModuleInterface) getCurrentModule()).getName());
             configPanel = tab;
         }
         return configPanel;
@@ -433,15 +423,14 @@
             String selected = (String) cb.getSelectedItem();
             ImportInterface oldModule = getCurrentModule();
             setCurrentModule(getModules().get(selected));
-            if (getCurrentModule() instanceof ImportInterface) {
-                updateFilters(
-                        (JFileChooser) dialog.getContentPane().getComponent(0),
-                        ((ImportInterface) oldModule).getSuffixFilters(),
-                        ((ImportInterface) getCurrentModule())
-                                .getSuffixFilters());
-                // TODO: Update configPanelExtension with extension settings
-                // for new language
-            }
+            updateFilters(
+                    (JFileChooser) dialog.getContentPane().getComponent(0),
+                    oldModule.getSuffixFilters(),
+                    getCurrentModule()
+                    .getSuffixFilters());
+            // TODO: Update configPanelExtension with extension settings
+            // for new language
+            
         }
     }
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.