|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.effects.ShadeDecorator
public class ShadeDecorator
Decorator that applies a "shade" to a component. The shade is a rectangle of the same size as the component that is painted over the component using a given color and opacity value.
Constructor Summary | |
---|---|
ShadeDecorator()
Creates a new ShadeDecorator with the default opacity and shade color. |
|
ShadeDecorator(float opacity,
Color color)
Creates a new ShadeDecorator with the specified opacity and shade color. |
Method Summary | |
---|---|
Bounds |
getBounds(Component componentArgument)
Returns the bounding area of the decorator. |
Color |
getColor()
Returns the color of the decorator |
float |
getOpacity()
Returns the opacity of the decorator, in [0,1]. |
AffineTransform |
getTransform(Component componentArgument)
Returns the transformation the decorator applies to the component's coordinate space. |
Graphics2D |
prepare(Component componentArgument,
Graphics2D graphicsArgument)
Prepares the graphics context into which the component or prior decorator will paint. |
void |
setColor(Color color)
Sets the color of the decorator |
void |
setColor(String color)
Sets the color of the decorator |
void |
setOpacity(float opacity)
Sets the opacity of the decorator. |
void |
setOpacity(Number opacity)
Sets the opacity of the decorator. |
void |
update()
Updates the graphics context into which the component or prior decorator was painted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShadeDecorator()
public ShadeDecorator(float opacity, Color color)
opacity
- The opacity of the shade, between 0 and 1, exclusive.color
- The color of the shade.Method Detail |
---|
public float getOpacity()
public void setOpacity(float opacity)
opacity
- A number between 0 (transparent) and 1 (opaque)public void setOpacity(Number opacity)
opacity
- A number between 0 (transparent) and 1 (opaque)public Color getColor()
public void setColor(Color color)
public final void setColor(String color)
color
- Any of the color values recognized by Pivot.public Graphics2D prepare(Component componentArgument, Graphics2D graphicsArgument)
Decorator
Component.paint(Graphics2D)
; decorators are called in
descending order.
prepare
in interface Decorator
public void update()
Decorator
Component.paint(Graphics2D)
; decorators are called in
ascending order.
update
in interface Decorator
public Bounds getBounds(Component componentArgument)
Decorator
getBounds
in interface Decorator
public AffineTransform getTransform(Component componentArgument)
Decorator
getTransform
in interface Decorator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |