classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: BasicComboBoxRenderer


From: David Gilbert
Subject: [cp-patches] FYI: BasicComboBoxRenderer
Date: Fri, 16 Sep 2005 11:53:13 +0000
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050728)

I committed this patch:

2005-09-16  David Gilbert  <address@hidden>

        * javax/swing/plaf/basic/BasicComboBoxRenderer.java: updated API docs
        and minor reformatting.

Regards,

Dave
Index: javax/swing/plaf/basic/BasicComboBoxRenderer.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java,v
retrieving revision 1.5
diff -u -r1.5 BasicComboBoxRenderer.java
--- javax/swing/plaf/basic/BasicComboBoxRenderer.java   15 Sep 2005 19:58:43 
-0000      1.5
+++ javax/swing/plaf/basic/BasicComboBoxRenderer.java   16 Sep 2005 10:48:50 
-0000
@@ -1,5 +1,5 @@
 /* BasicComboBoxRenderer.java --
-   Copyright (C) 2004  Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -43,6 +43,7 @@
 import java.awt.FontMetrics;
 import java.io.Serializable;
 
+import javax.swing.JComboBox;
 import javax.swing.JLabel;
 import javax.swing.JList;
 import javax.swing.ListCellRenderer;
@@ -54,20 +55,21 @@
 import javax.swing.border.EmptyBorder;
 
 /**
- * This class is renderer for the combo box. 
+ * A renderer for a address@hidden JComboBox}. 
  *
  * @author Olga Rodimina
  */
-public class BasicComboBoxRenderer extends JLabel implements ListCellRenderer,
-                                                             Serializable
+public class BasicComboBoxRenderer 
+  extends JLabel 
+  implements ListCellRenderer, Serializable
 {
   /**
-   * This border is used whenever renderer doesn't have a focus.
+   * A shared border instance for all renderers.
    */
   protected static Border noFocusBorder = new EmptyBorder(0, 0, 0, 0);
 
   /**
-   * Creates a new BasicComboBoxRenderer object.
+   * Creates a new <code>BasicComboBoxRenderer</code> object.
    */
   public BasicComboBoxRenderer()
   {
@@ -85,7 +87,8 @@
   }
 
   /**
-   * getListCellRendererComponent
+   * Returns a component that has been configured to display the given
+   * <code>value</code>.
    *
    * @param list List of items for which to the background and foreground
    *        colors
@@ -126,17 +129,15 @@
     
     setOpaque(true);
 
-    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
     if (isSelected)
       {
-       setBackground(list.getSelectionBackground());
-       setForeground(list.getSelectionForeground());
+        setBackground(list.getSelectionBackground());
+        setForeground(list.getSelectionForeground());
       }
     else
       {
-       setBackground(list.getBackground());
-       setForeground(list.getForeground());
+        setBackground(list.getBackground());
+        setForeground(list.getForeground());
       }
 
     setEnabled(list.isEnabled());
@@ -152,11 +153,15 @@
     return this;
   }
 
+  /**
+   * A subclass of address@hidden BasicComboBoxRenderer} that implements the
+   * address@hidden javax.swing.plaf.UIResource} interface.
+   */
   public static class UIResource extends BasicComboBoxRenderer
     implements javax.swing.plaf.UIResource
   {
     /**
-     * Creates a new UIResource object.
+     * Creates a new <code>UIResource</code> object.
      */
     public UIResource()
     {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]