|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.explodingpixels.painter.ButtonStatePainter<B>
public class ButtonStatePainter<B extends javax.swing.AbstractButton>
A MacWidgetsPainter that can be used to paint the various states of a button. This painter
will delegate to the supplied painters based on the current state of the button. That is, if the button is being
"rolled over", the rolloverPainter will be called; if the button is pressed, then the pressedPainter
will be called, etc.
| Nested Class Summary | |
|---|---|
static class |
ButtonStatePainter.DummyPainter
An implementation of MacWidgetsPainter that does no painting. |
| Constructor Summary | |
|---|---|
ButtonStatePainter(MacWidgetsPainter<java.awt.Component> defaultPainter)
Creates a painter that will always use the given MacWidgetsPainter to
paint the button. |
|
ButtonStatePainter(MacWidgetsPainter<java.awt.Component> defaultPainter,
MacWidgetsPainter<java.awt.Component> rolloverPainter,
MacWidgetsPainter<java.awt.Component> pressedPainter,
MacWidgetsPainter<java.awt.Component> selectedPainter)
Creates a painter that will delegate to the given painters based on the current state of the button. |
|
| Method Summary | |
|---|---|
void |
paint(java.awt.Graphics2D g,
B button,
int width,
int height)
Renders to the given Graphics2D. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ButtonStatePainter(MacWidgetsPainter<java.awt.Component> defaultPainter)
MacWidgetsPainter to
paint the button.
defaultPainter - the Painter to use to paint the
button.
public ButtonStatePainter(MacWidgetsPainter<java.awt.Component> defaultPainter,
MacWidgetsPainter<java.awt.Component> rolloverPainter,
MacWidgetsPainter<java.awt.Component> pressedPainter,
MacWidgetsPainter<java.awt.Component> selectedPainter)
defaultPainter - the MacWidgetsPainter to use when the button has
no specific state.rolloverPainter - the Painter to use when the button is
being "rolled over".pressedPainter - the Painter to use when the button is
being pressed.selectedPainter - the Painter to use when the button has
been selected.| Method Detail |
|---|
public void paint(java.awt.Graphics2D g,
B button,
int width,
int height)
MacWidgetsPainterGraphics2D. The supplied graphics context may be modified - it's
state need not be restored upon completion of painting.
paint in interface MacWidgetsPainter<B extends javax.swing.AbstractButton>g - the graphics context to paint into. It's state need not be restored. Will not
be null.button - the object to be painted.width - the width within the object to paint.height - the height within the object to paint.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||