[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: BasicButtonUI API doc updates
From: |
David Gilbert |
Subject: |
[cp-patches] FYI: BasicButtonUI API doc updates |
Date: |
Sun, 02 Oct 2005 07:05:13 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050728) |
I committed this:
2005-10-02 David Gilbert <address@hidden>
* 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 address@hidden JButton} component.
+ */
public class BasicButtonUI extends ButtonUI
{
/**
@@ -79,7 +83,7 @@
* Factory method to create an instance of BasicButtonUI for a given
* address@hidden JComponent}, which should be an address@hidden
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 address@hidden
#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 address@hidden
#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 address@hidden
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 address@hidden AbstractButton} in the
pressed
- * state. This means filling the supplied area with the address@hidden
- * 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 address@hidden AbstractButton}, using the
- * address@hidden textColor} color.
+ * Paints the "text" property of an address@hidden 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 address@hidden AbstractButton}, using the
- * address@hidden textColor} color.
+ * Paints the "text" property of an address@hidden AbstractButton}.
*
* @param g The graphics context to paint with
* @param b The button to paint the state of
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: BasicButtonUI API doc updates,
David Gilbert <=