I committed the attached patch, which fixes the modifiers of several
fields, methods and inner classes of javax.swing.plaf.basic.BasicListUI
to match the spec.

/Roman

Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.3267
diff -u -r1.3267 ChangeLog
--- ChangeLog	27 Feb 2005 14:32:28 -0000	1.3267
+++ ChangeLog	27 Feb 2005 16:01:19 -0000
@@ -1,3 +1,9 @@
+2005-02-27  Roman Kennke  <[EMAIL PROTECTED]>
+
+	* javax/swing/plaf/basic/BasicListUI:
+	fixed modifiers of several fields, methods and inner
+	classes to match the 'spec'
+
 2005-02-27  Chris Burdess  <[EMAIL PROTECTED]>
 
 	* gnu/xml/aelfred2/JAXPFactory.java,
Index: javax/swing/plaf/basic/BasicListUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicListUI.java,v
retrieving revision 1.12
diff -u -r1.12 BasicListUI.java
--- javax/swing/plaf/basic/BasicListUI.java	27 Feb 2005 13:51:05 -0000	1.12
+++ javax/swing/plaf/basic/BasicListUI.java	27 Feb 2005 16:01:20 -0000
@@ -79,7 +79,7 @@
    * A helper class which listens for [EMAIL PROTECTED] ComponentEvent}s from
    * the JList.
    */
-  class ComponentHandler extends ComponentAdapter {
+  private class ComponentHandler extends ComponentAdapter {
 
     /**
      * Called when the component is hidden. Invalidates the internal
@@ -94,7 +94,7 @@
    * A helper class which listens for [EMAIL PROTECTED] FocusEvents}
    * from the JList.
    */
-  class FocusHandler implements FocusListener
+  public class FocusHandler implements FocusListener
   {
     /**
      * Called when the JList acquires focus.
@@ -131,7 +131,7 @@
    *
    * @see javax.swing.JList#model
    */
-  class ListDataHandler implements ListDataListener
+  public class ListDataHandler implements ListDataListener
   {
     /**
      * Called when a general change has happened in the model which cannot
@@ -169,7 +169,7 @@
    * A helper class which listens for [EMAIL PROTECTED] ListSelectionEvent}s
    * from the [EMAIL PROTECTED] JList}'s [EMAIL PROTECTED] ListSelectionModel}.
    */
-  class ListSelectionHandler implements ListSelectionListener
+  public class ListSelectionHandler implements ListSelectionListener
   {
     /**
      * Called when the list selection changes.  
@@ -185,7 +185,7 @@
    * A helper class which listens for [EMAIL PROTECTED] MouseEvent}s 
    * from the [EMAIL PROTECTED] JList}.
    */
-  class MouseInputHandler implements MouseInputListener
+  public class MouseInputHandler implements MouseInputListener
   {
     /**
      * Called when a mouse button press/release cycle completes
@@ -268,7 +268,7 @@
    * Helper class which listens to [EMAIL PROTECTED] PropertyChangeEvent}s
    * from the [EMAIL PROTECTED] JList}.
    */
-  class PropertyChangeHandler implements PropertyChangeListener
+  public class PropertyChangeHandler implements PropertyChangeListener
   {
     /**
      * Called when the [EMAIL PROTECTED] JList} changes one of its bound properties.
@@ -302,45 +302,45 @@
   }
 
   /** The current focus listener. */
-  FocusHandler focusListener;
+  protected FocusHandler focusListener;
 
   /** The data listener listening to the model. */
-  ListDataHandler listDataListener;
+  protected ListDataHandler listDataListener;
 
   /** The selection listener listening to the selection model. */
-  ListSelectionHandler listSelectionListener;
+  protected ListSelectionHandler listSelectionListener;
 
   /** The mouse listener listening to the list. */
-  MouseInputHandler mouseInputListener;
+  protected MouseInputHandler mouseInputListener;
 
   /** The property change listener listening to the list. */
-  PropertyChangeHandler propertyChangeListener;
+  protected PropertyChangeHandler propertyChangeListener;
 
   /** The component listener that receives notification for resizing the
    * JList component.*/
-  ComponentListener componentListener;
+  private ComponentListener componentListener;
 
   /** Saved reference to the list this UI was created for. */
-  JList list;
+  protected JList list;
 
   /** The height of a single cell in the list. */
-  int cellHeight;
+  protected int cellHeight;
 
   /** The width of a single cell in the list. */
-  int cellWidth;
+  protected int cellWidth;
 
   /** 
    * An array of varying heights of cells in the list, in cases where each
    * cell might have a different height.
    */
-  int[] cellHeights;
+  protected int[] cellHeights;
 
   /**
    * A simple counter. When nonzero, indicates that the UI class is out of
    * date with respect to the underlying list, and must recalculate the
    * list layout before painting or performing size calculations.
    */
-  int updateLayoutStateNeeded;
+  protected int updateLayoutStateNeeded;
 
   /**
    * Calculate the height of a particular row. If there is a fixed [EMAIL PROTECTED]
@@ -352,7 +352,7 @@
    *
    * @return The height, in pixels, of the specified row
    */
-  int getRowHeight(int row)
+  protected int getRowHeight(int row)
   {
     if (row < 0 || row >= cellHeights.length)
       return -1;
@@ -402,7 +402,7 @@
    * @return The Y coordinate of the specified row, or <code>-1</code> if
    * the specified row number is invalid
    */
-  int convertRowToY(int row)
+  protected int convertRowToY(int row)
   {
     int y = 0;
     for (int i = 0; i < row; ++i)
@@ -425,7 +425,7 @@
    * @return The row number containing the specified Y value, or <code>-1</code>
    * if the specified Y coordinate is invalid
    */
-  int convertYToRow(int y0)
+  protected int convertYToRow(int y0)
   {
     for (int row = 0; row < cellHeights.length; ++row)
       {
@@ -443,7 +443,7 @@
    * #cellWidth} properties by examining the variouis properties of the
    * [EMAIL PROTECTED] JList}.
    */
-  void updateLayoutState()
+  protected void updateLayoutState()
   {
     int nrows = list.getModel().getSize();
     cellHeight = -1;
@@ -482,7 +482,7 @@
    *
    * @see #updateLayoutStateNeeded
    */
-  void damageLayout()
+  private void damageLayout()
   {
     updateLayoutStateNeeded = 1;
     list.revalidate();
@@ -492,7 +492,7 @@
    * Calls [EMAIL PROTECTED] #updateLayoutState} if [EMAIL PROTECTED] #updateLayoutStateNeeded}
    * is nonzero, then resets [EMAIL PROTECTED] #updateLayoutStateNeeded} to zero.
    */
-  void maybeUpdateLayoutState()
+  protected void maybeUpdateLayoutState()
   {
     if (updateLayoutStateNeeded != 0)
       {
@@ -521,7 +521,7 @@
    *
    * @see #uninstallDefaults
    */
-  void installDefaults()
+  protected void installDefaults()
   {
     UIDefaults defaults = UIManager.getLookAndFeelDefaults();
     list.setForeground(defaults.getColor("List.foreground"));
@@ -535,7 +535,7 @@
    * Resets to <code>null</code> those defaults which were installed in 
    * [EMAIL PROTECTED] #installDefaults}
    */
-  void uninstallDefaults()
+  protected void uninstallDefaults()
   {
     UIDefaults defaults = UIManager.getLookAndFeelDefaults();
     list.setForeground(null);
@@ -550,7 +550,7 @@
    *
    * @see #uninstallListeners
    */
-  void installListeners()
+  protected void installListeners()
   {
     list.addFocusListener(focusListener);
     list.getModel().addListDataListener(listDataListener);
@@ -564,7 +564,7 @@
   /**
    * Detaches all the listeners we attached in [EMAIL PROTECTED] #installListeners}.
    */
-  void uninstallListeners()
+  protected void uninstallListeners()
   {
     list.removeFocusListener(focusListener);
     list.getModel().removeListDataListener(listDataListener);
@@ -577,14 +577,14 @@
   /**
    * Installs keyboard actions for this UI in the [EMAIL PROTECTED] JList}.
    */
-  void installKeyboardActions()
+  protected void installKeyboardActions()
   {
   }
 
   /**
    * Uninstalls keyboard actions for this UI in the [EMAIL PROTECTED] JList}.
    */
-  void uninstallKeyboardActions()
+  protected void uninstallKeyboardActions()
   {
   }
 
@@ -623,18 +623,6 @@
   }
 
   /**
-   * Gets the maximum size this list can assume.
-   *
-   * @param c The component to measure the size of
-   *
-   * @return A new Dimension representing the component's maximum size
-   */
-  public Dimension getMaximumSize(JComponent c)
-  {
-    return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
-  }
-
-  /**
    * Gets the size this list would prefer to assume. This is calculated by
    * calling [EMAIL PROTECTED] #getCellBounds} over the entire list.
    *
@@ -657,7 +645,7 @@
    * @param g The graphics context to paint in
    * @param c The component to paint the background of
    */
-  public void paintBackground(Graphics g, JComponent c)
+  private void paintBackground(Graphics g, JComponent c)
   {
     Dimension size = getPreferredSize(c);
     Color save = g.getColor();
@@ -679,8 +667,9 @@
    * @param sel A selection model to provide to the cell renderer
    * @param lead The lead selection index of the list
    */
-  void paintCell(Graphics g, int row, Rectangle bounds, ListCellRenderer rend,
-                 ListModel data, ListSelectionModel sel, int lead)
+  protected void paintCell(Graphics g, int row, Rectangle bounds,
+                 ListCellRenderer rend, ListModel data,
+                 ListSelectionModel sel, int lead)
   {
     boolean is_sel = list.isSelectedIndex(row);
     boolean has_focus = false;

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to