This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.plaf.basic
class BasicButtonUI

java.lang.Object extended by javax.swing.plaf.ComponentUI extended by javax.swing.plaf.ButtonUI extended by javax.swing.plaf.basic.BasicButtonUI
Direct Known Subclasses:
BasicToggleButtonUI, MetalButtonUI

public class BasicButtonUI
extends ButtonUI

BasicButton implementation


Field Summary
protected int defaultTextIconGap
          
protected int defaultTextShiftOffset
          
 
Constructor Summary

          
 
Method Summary
protected void

          
protected BasicButtonListener

          
static ComponentUI

          
 int
getBaseline(JComponent c, int width, int height)

          Returns the baseline.
 Component.BaselineResizeBehavior

          Returns an enum indicating how the baseline of the component changes as the size changes.
 int

          
 Dimension

          Returns the specified component's maximum size appropriate for the look and feel.
 Dimension

          Returns the specified component's minimum size appropriate for the look and feel.
 Dimension

          Returns the specified component's preferred size appropriate for the look and feel.
protected String

          
protected int

          
protected void

          
protected void

          
protected void

          
 void

          Configures the specified component appropriate for the look and feel.
 void

          Paints the specified component appropriate for the look and feel.
protected void

          
protected void
paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)

          
protected void

          
protected void

          Method which renders the text of the current button.
protected void
paintText(Graphics g, JComponent c, Rectangle textRect, String text)

          As of Java 2 platform v 1.4 this method should not be used or overriden.
protected void

          
protected void

          
protected void

          
protected void

          
 void

          Reverses configuration which was done on the specified component during installUI.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultTextIconGap

protected int defaultTextIconGap

defaultTextShiftOffset

protected int defaultTextShiftOffset
Constructor Detail

BasicButtonUI

public BasicButtonUI()
Method Detail

clearTextShiftOffset

protected void clearTextShiftOffset()

createButtonListener

protected BasicButtonListener createButtonListener(AbstractButton b)
Parameters:
b

createUI

public static ComponentUI createUI(JComponent c)
Parameters:
c

getBaseline

public int getBaseline(JComponent c,
                       int width,
                       int height)
Returns the baseline.

Overrides:
getBaseline in class ComponentUI
Parameters:
c
width
height

getBaselineResizeBehavior

public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
Returns an enum indicating how the baseline of the component changes as the size changes.

Overrides:
getBaselineResizeBehavior in class ComponentUI
Parameters:
c

getDefaultTextIconGap

public int getDefaultTextIconGap(AbstractButton b)
Parameters:
b

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Overrides:
getMaximumSize in class ComponentUI
Parameters:
c

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Overrides:
getMinimumSize in class ComponentUI
Parameters:
c

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Overrides:
getPreferredSize in class ComponentUI
Parameters:
c

getPropertyPrefix

protected String getPropertyPrefix()

getTextShiftOffset

protected int getTextShiftOffset()

installDefaults

protected void installDefaults(AbstractButton b)
Parameters:
b

installKeyboardActions

protected void installKeyboardActions(AbstractButton b)
Parameters:
b

installListeners

protected void installListeners(AbstractButton b)
Parameters:
b

installUI

public void installUI(JComponent c)
Overrides:
installUI in class ComponentUI
Parameters:
c

paint

public void paint(Graphics g,
                  JComponent c)
Overrides:
paint in class ComponentUI
Parameters:
g
c

paintButtonPressed

protected void paintButtonPressed(Graphics g,
                                  AbstractButton b)
Parameters:
g
b

paintFocus

protected void paintFocus(Graphics g,
                          AbstractButton b,
                          Rectangle viewRect,
                          Rectangle textRect,
                          Rectangle iconRect)
Parameters:
g
b
viewRect
textRect
iconRect

paintIcon

protected void paintIcon(Graphics g,
                         JComponent c,
                         Rectangle iconRect)
Parameters:
g
c
iconRect

paintText

protected void paintText(Graphics g,
                         AbstractButton b,
                         Rectangle textRect,
                         String text)
Method which renders the text of the current button.

Parameters:
g - Graphics context
b - Current button to render
textRect - Bounding rectangle to render the text.
text - String to render

paintText

protected void paintText(Graphics g,
                         JComponent c,
                         Rectangle textRect,
                         String text)
As of Java 2 platform v 1.4 this method should not be used or overriden. Use the paintText method which takes the AbstractButton argument.

Parameters:
g
c
textRect
text

setTextShiftOffset

protected void setTextShiftOffset()

uninstallDefaults

protected void uninstallDefaults(AbstractButton b)
Parameters:
b

uninstallKeyboardActions

protected void uninstallKeyboardActions(AbstractButton b)
Parameters:
b

uninstallListeners

protected void uninstallListeners(AbstractButton b)
Parameters:
b

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class ComponentUI
Parameters:
c


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.