|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.gui.PaintableTools
The class PaintableTools collects static methods that
construct objects of other types from Paintable objects.
Class PaintableTools cannot be instantiated.
| Method Summary | |
static BufferedImage |
makeBufferedImage(Paintable paintable)
Returns a BufferedImage whose size equals the size of
the bounds rectangle of the given paintable and whose contents have
been determined by one execution of the paint method
on the graphics context of the BufferedImage. |
static JButton |
makeButton(Paintable paintable)
Returns a JButton using
the given Paintable to construct the button icon,
no specified action for the button behavior,
the Java default background color,
and insets of 2, 2, 2, 2. |
static JButton |
makeButton(Paintable paintable,
Action action)
Returns a JButton using
the given Paintable to construct the button icon,
the given Action for the button behavior,
the Java default background color,
and insets of 2, 2, 2, 2. |
static JButton |
makeButton(Paintable paintable,
Action action,
Color color)
Returns a JButton using
the given Paintable to construct the button icon,
the given Action for the button behavior,
the given background color,
and insets of 2, 2, 2, 2. |
static JButton |
makeButton(Paintable paintable,
Action action,
Color color,
Insets insets)
Returns a JButton using
the given Paintable to construct the button icon,
the given Action for the button behavior,
the given background color,
and the given insets. |
static JPTComponent |
makeComponent(Paintable paintable)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior. |
static JPTComponent |
makeComponent(Paintable paintable,
Color color)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior
and the optional background color. |
static JPTComponent |
makeComponent(Paintable paintable,
Color color,
boolean opaque)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior,
the optional background color,
and the opacity setting. |
static JPTComponent |
makeComponent(Paintable paintable,
Color color,
boolean opaque,
Border border)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior,
the optional background color,
the opacity setting,
and the component border. |
static Icon |
makeIcon(Paintable paintable)
Returns an Icon constructed using the paint operation
and bounds of the given Paintable object. |
static TexturePaint |
makeTexturePaint(Paintable paintable)
Returns a TexturePaint whose BufferedImage
is constructed using the method makeBufferedImage and
whose anchor rectangle is the bounds rectangle of the given paintable. |
static MutatablePaintable |
wrapPaintable(Paintable paintable)
Returns a MutatablePaintable that wraps the given
Paintable. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static MutatablePaintable wrapPaintable(Paintable paintable)
Returns a MutatablePaintable that wraps the given
Paintable.
If the given Paintable is already an instance
of MutatablePaintable then it is returned as is.
Otherwise, the given Paintable is wrapped using a
a MutatableWrapper and this object is returned.
paintable - the paintable to wrap as a mutatable paintable
public static Icon makeIcon(Paintable paintable)
Returns an Icon constructed using the paint operation
and bounds of the given Paintable object.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableComponent,
viewed as an Icon, or null.
paintable - the paintable used in the construction
Icon constructed from the paintablemakeButton(Paintable, Action),
makeButton(Paintable, Action, Color)public static BufferedImage makeBufferedImage(Paintable paintable)
Returns a BufferedImage whose size equals the size of
the bounds rectangle of the given paintable and whose contents have
been determined by one execution of the paint method
on the graphics context of the BufferedImage.
In effect, this method creates a snapshot of the paintable that is
encapsulated in the BufferedImage data. Hence, even if
the paintable should later change, the BufferedImage is
unaffected.
If the given paintable is null, then returns
null.
paintable - the paintable used in the construction
BufferedImage constructed from the paintablemakeTexturePaint(Paintable)public static TexturePaint makeTexturePaint(Paintable paintable)
Returns a TexturePaint whose BufferedImage
is constructed using the method makeBufferedImage and
whose anchor rectangle is the bounds rectangle of the given paintable.
If the given paintable is null, then returns
null.
paintable - the paintable used in the construction
TexturePaint constructed from the paintablemakeBufferedImage(Paintable)public static JButton makeButton(Paintable paintable)
Returns a JButton using
the given Paintable to construct the button icon,
no specified action for the button behavior,
the Java default background color,
and insets of 2, 2, 2, 2.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableButton
or null.
paintable - the paintable that defines the button
makeIcon(Paintable),
makeButton(Paintable, Action),
makeButton(Paintable, Action, Color),
makeButton(Paintable, Action, Color, Insets)
public static JButton makeButton(Paintable paintable,
Action action)
Returns a JButton using
the given Paintable to construct the button icon,
the given Action for the button behavior,
the Java default background color,
and insets of 2, 2, 2, 2.
The action is used only to supply behavior not to set the button icon or text.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableButton
or null.
paintable - the paintable that defines the buttonaction - the action to define the button behavior
makeIcon(Paintable),
makeButton(Paintable),
makeButton(Paintable, Action, Color),
makeButton(Paintable, Action, Color, Insets)
public static JButton makeButton(Paintable paintable,
Action action,
Color color)
Returns a JButton using
the given Paintable to construct the button icon,
the given Action for the button behavior,
the given background color,
and insets of 2, 2, 2, 2.
The action is used only to supply behavior not to set the button icon or text.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableButton
or null.
paintable - the paintable that defines the buttonaction - the action to define the button behaviorcolor - the button background color
makeIcon(Paintable),
makeButton(Paintable),
makeButton(Paintable, Action),
makeButton(Paintable, Action, Color, Insets)
public static JButton makeButton(Paintable paintable,
Action action,
Color color,
Insets insets)
Returns a JButton using
the given Paintable to construct the button icon,
the given Action for the button behavior,
the given background color,
and the given insets.
The action is used only to supply behavior not to set the button icon or text.
If the given insets is null, then the insets
are set to 2, 2, 2, 2.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableButton
or null.
paintable - the paintable that defines the buttonaction - the action to define the button behaviorcolor - the button background colorinsets - the button insets
makeIcon(Paintable),
makeButton(Paintable),
makeButton(Paintable, Action),
makeButton(Paintable, Action, Color)public static JPTComponent makeComponent(Paintable paintable)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableComponent
or null.
paintable - the paintable to encapsulate
makeComponent(Paintable, Color),
makeComponent(Paintable, Color, boolean),
makeComponent(Paintable, Color, boolean, Border)
public static JPTComponent makeComponent(Paintable paintable,
Color color)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior
and the optional background color.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableComponent
or null.
paintable - the paintable to encapsulatecolor - the optional background color
makeComponent(Paintable),
makeComponent(Paintable, Color, boolean),
makeComponent(Paintable, Color, boolean, Border)
public static JPTComponent makeComponent(Paintable paintable,
Color color,
boolean opaque)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior,
the optional background color,
and the opacity setting.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableComponent
or null.
paintable - the paintable to encapsulatecolor - the optional background coloropaque - whether or not to paint the component background
makeComponent(Paintable),
makeComponent(Paintable, Color),
makeComponent(Paintable, Color, boolean, Border)
public static JPTComponent makeComponent(Paintable paintable,
Color color,
boolean opaque,
Border border)
Returns a JPTComponent using the given
Paintable to define its location and paint
behavior,
the optional background color,
the opacity setting,
and the component border.
If the given paintable is null, then returns
null.
As of 2.3.2, this method returns a PaintableComponent
or null.
paintable - the paintable to encapsulatecolor - the optional background coloropaque - whether or not to paint the component backgroundborder - the border for the component
makeComponent(Paintable),
makeComponent(Paintable, Color),
makeComponent(Paintable, Color, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||