I committed this: 2005-10-02 David Gilbert <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicButtonUI.java: API doc updates. Regards, Dave
Index: javax/swing/plaf/basic/BasicButtonUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicButtonUI.java,v retrieving revision 1.28 diff -u -r1.28 BasicButtonUI.java --- javax/swing/plaf/basic/BasicButtonUI.java 28 Sep 2005 15:17:42 -0000 1.28 +++ javax/swing/plaf/basic/BasicButtonUI.java 2 Oct 2005 05:57:44 -0000 @@ -49,6 +49,7 @@ import javax.swing.ButtonModel; import javax.swing.Icon; import javax.swing.InputMap; +import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.SwingUtilities; import javax.swing.UIDefaults; @@ -57,6 +58,9 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; +/** + * A UI delegate for the [EMAIL PROTECTED] JButton} component. + */ public class BasicButtonUI extends ButtonUI { /** @@ -79,7 +83,7 @@ * Factory method to create an instance of BasicButtonUI for a given * [EMAIL PROTECTED] JComponent}, which should be an [EMAIL PROTECTED] AbstractButton}. * - * @param c The component to create a UI got + * @param c The component. * * @return A new UI capable of drawing the component */ @@ -88,21 +92,46 @@ return new BasicButtonUI(); } + /** + * Returns the default gap between the button's text and icon (in pixels). + * + * @param b the button (ignored). + * + * @return The gap. + */ public int getDefaultTextIconGap(AbstractButton b) { return defaultTextIconGap; } + /** + * Sets the text shift offset to zero. + * + * @see #setTextShiftOffset() + */ protected void clearTextShiftOffset() { textShiftOffset = 0; } + /** + * Returns the text shift offset. + * + * @return The text shift offset. + * + * @see #clearTextShiftOffset() + * @see #setTextShiftOffset() + */ protected int getTextShiftOffset() { return textShiftOffset; } + /** + * Sets the text shift offset to the value in [EMAIL PROTECTED] #defaultTextShiftOffset}. + * + * @see #clearTextShiftOffset() + */ protected void setTextShiftOffset() { textShiftOffset = defaultTextShiftOffset; @@ -119,6 +148,11 @@ return "Button."; } + /** + * Installs the default settings. + * + * @param b the button (<code>null</code> not permitted). + */ protected void installDefaults(AbstractButton b) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); @@ -136,6 +170,11 @@ b.setOpaque(true); } + /** + * Removes the defaults added by [EMAIL PROTECTED] #installDefaults(AbstractButton)}. + * + * @param b the button (<code>null</code> not permitted). + */ protected void uninstallDefaults(AbstractButton b) { if (b.getFont() instanceof UIResource) @@ -149,11 +188,25 @@ protected BasicButtonListener listener; + /** + * Creates and returns a new instance of [EMAIL PROTECTED] BasicButtonListener}. This + * method provides a hook to make it easy for subclasses to install a + * different listener. + * + * @param b the button. + * + * @return A new listener. + */ protected BasicButtonListener createButtonListener(AbstractButton b) { return new BasicButtonListener(b); } + /** + * Installs listeners for the button. + * + * @param b the button (<code>null</code> not permitted). + */ protected void installListeners(AbstractButton b) { listener = createButtonListener(b); @@ -164,6 +217,11 @@ b.addMouseMotionListener(listener); } + /** + * Uninstalls listeners for the button. + * + * @param b the button (<code>null</code> not permitted). + */ protected void uninstallListeners(AbstractButton b) { b.removeChangeListener(listener); @@ -337,8 +395,8 @@ /** * Paints the background area of an [EMAIL PROTECTED] AbstractButton} in the pressed - * state. This means filling the supplied area with the [EMAIL PROTECTED] - * pressedBackgroundColor}. + * state. This means filling the supplied area with a darker than normal + * background. * * @param g The graphics context to paint with * @param b The button to paint the state of @@ -355,8 +413,7 @@ } /** - * Paints the "text" property of an [EMAIL PROTECTED] AbstractButton}, using the - * [EMAIL PROTECTED] textColor} color. + * Paints the "text" property of an [EMAIL PROTECTED] AbstractButton}. * * @param g The graphics context to paint with * @param c The component to paint the state of @@ -370,8 +427,7 @@ } /** - * Paints the "text" property of an [EMAIL PROTECTED] AbstractButton}, using the - * [EMAIL PROTECTED] textColor} color. + * Paints the "text" property of an [EMAIL PROTECTED] AbstractButton}. * * @param g The graphics context to paint with * @param b The button to paint the state of
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches