public class BounceButtonUI extends BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
Constructor and Description |
---|
BounceButtonUI() |
Modifier and Type | Method and Description |
---|---|
protected BasicButtonListener |
createButtonListener(AbstractButton b)
Overrides the createButtonListener method in the BasicButtonUI class,
to be able to install a new button listener that can listen to double clicks.
|
static ComponentUI |
createUI(JComponent c)
Return this button look and feel.
|
Dimension |
getPreferredSize(JComponent c)
Returns the preferred size of the button, this size will return the
full width of the text as the preferred width and the full height of the
lines as the height.
|
void |
paint(Graphics g,
JComponent c)
Overrides the paint method in the BasicButtonUI class.
|
protected void |
paintBackground(Graphics g,
JComponent c)
Paints button's background.
|
protected void |
paintFocus(Graphics g,
QButton b,
Rectangle viewRect,
Rectangle textRect,
Rectangle iconRect)
Paints the focus rectangle on the button.
|
protected void |
paintIcon(Graphics g,
JComponent c,
Rectangle iconRect,
Icon icon)
Paints the icon for the button.
|
protected void |
paintText(Graphics g,
JComponent c,
Rectangle textRect,
String[] text)
Paints the text on the button.
|
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPropertyPrefix, getTextShiftOffset, installDefaults, installKeyboardActions, installListeners, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
public static ComponentUI createUI(JComponent c)
c
- the component the look and feel is for, normally a QButton.public void paint(Graphics g, JComponent c)
paint
in class BasicButtonUI
g
- the graphics.c
- the button component.protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect, Icon icon)
g
- the graphics.c
- the button component.iconRect
- the rectangle the icon has to be painted in.icon
- the icon.protected void paintBackground(Graphics g, JComponent c)
g
- the graphics.c
- the button component.protected void paintFocus(Graphics g, QButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
g
- the graphics.b
- the button component.viewRect
- the whole button rectangle.textRect
- the text rectangle.iconRect
- the icon rectangle.protected void paintText(Graphics g, JComponent c, Rectangle textRect, String[] text)
g
- the graphics.c
- the button component.textRect
- the text rectangle.text
- the text to be painted.protected BasicButtonListener createButtonListener(AbstractButton b)
createButtonListener
in class BasicButtonUI
b
- the button component.public Dimension getPreferredSize(JComponent c)
This method is a revamped version of the method:
BasicButtonUI.getPreferredSize()
getPreferredSize
in class BasicButtonUI
c
- the button component.Copyright © 2002-2013 Edwin Dankert. All Rights Reserved.