cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject svn commit: r656712 - /cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
Date Thu, 15 May 2008 15:53:51 GMT
Author: mgentry
Date: Thu May 15 08:53:51 2008
New Revision: 656712

URL: http://svn.apache.org/viewvc?rev=656712&view=rev
Log:
Added generics to eliminate warnings.

Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java?rev=656712&r1=656711&r2=656712&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
Thu May 15 08:53:51 2008
@@ -27,7 +27,6 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.swing.AbstractListModel;
@@ -83,9 +82,9 @@
     protected Object[] selectionPath;
     protected Dimension preferredColumnSize;
 
-    private List columns;
+    private List<BrowserPanel> columns;
     private ListSelectionListener browserSelector;
-    private List treeSelectionListeners;
+    private List<TreeSelectionListener> treeSelectionListeners;
 
     public MultiColumnBrowser() {
         this(DEFAULT_MIN_COLUMNS_COUNT);
@@ -102,7 +101,7 @@
 
         this.minColumns = minColumns;
         this.browserSelector = new PanelController();
-        this.treeSelectionListeners = Collections.synchronizedList(new ArrayList());
+        this.treeSelectionListeners = Collections.synchronizedList(new ArrayList<TreeSelectionListener>());
         initView();
     }
 
@@ -127,11 +126,13 @@
         TreeSelectionEvent e =
             new TreeSelectionEvent(this, new TreePath(selectionPath), false, null, null);
         synchronized (treeSelectionListeners) {
-            Iterator it = treeSelectionListeners.iterator();
-            while (it.hasNext()) {
-                TreeSelectionListener listener = (TreeSelectionListener) it.next();
+            for (TreeSelectionListener listener : treeSelectionListeners)
                 listener.valueChanged(e);
-            }
+//            Iterator<TreeSelectionListener> it = treeSelectionListeners.iterator();
+//            while (it.hasNext()) {
+//                TreeSelectionListener listener = (TreeSelectionListener) it.next();
+//                listener.valueChanged(e);
+//            }
         }
     }
 
@@ -195,11 +196,13 @@
 
             // update existing browser
             if (columns != null && columns.size() > 0) {
-                Iterator it = columns.iterator();
-                while (it.hasNext()) {
-                    JList column = (JList) it.next();
+                for (JList column : columns)
                     column.setCellRenderer(renderer);
-                }
+//                Iterator it = columns.iterator();
+//                while (it.hasNext()) {
+//                    JList column = (JList) it.next();
+//                    column.setCellRenderer(renderer);
+//                }
             }
         }
     }
@@ -239,7 +242,7 @@
     // ====================================================
 
     private void initView() {
-        columns = Collections.synchronizedList(new ArrayList(minColumns));
+        columns = Collections.synchronizedList(new ArrayList<BrowserPanel>(minColumns));
         adjustViewColumns(minColumns);
     }
 



Mime
View raw message