Package org.apache.pivot.wtk.effects
Class DropShadowDecorator
- java.lang.Object
-
- org.apache.pivot.wtk.effects.DropShadowDecorator
-
-
Field Summary
Fields Modifier and Type Field Description static float
DEFAULT_SHADOW_OPACITY
-
Constructor Summary
Constructors Constructor Description DropShadowDecorator()
Default constructor with values of3, 3, 3
.DropShadowDecorator(int radius, int xOff, int yOff)
Construct using non-default values of radius and offsets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBlurRadius()
Bounds
getBounds(Component component)
Returns the bounding area of the decorator.java.awt.Color
getShadowColor()
float
getShadowOpacity()
Returns the opacity used to draw the shadow.int
getXOffset()
Returns the amount that the drop shadow will be offset along the x axis.int
getYOffset()
Returns the amount that the drop shadow will be offset along the y axis.java.awt.Graphics2D
prepare(Component component, java.awt.Graphics2D graphics)
Prepares the graphics context into which the component or prior decorator will paint.void
setBlurRadius(int radius)
Sets the blur radius used to draw the shadow.void
setShadowColor(java.awt.Color colorValue)
Sets the color used to draw the shadow.void
setShadowColor(java.lang.String shadowColorString)
Sets the color used to draw the shadow.void
setShadowOpacity(float opacity)
Sets the opacity used to draw the shadow.void
setXOffset(int xOff)
Sets the amount that the drop shadow will be offset along the x axis.void
setYOffset(int yOff)
Sets the amount that the drop shadow will be offset along the y axis.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.effects.Decorator
getTransform, update
-
-
-
-
Field Detail
-
DEFAULT_SHADOW_OPACITY
public static final float DEFAULT_SHADOW_OPACITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DropShadowDecorator
public DropShadowDecorator()
Default constructor with values of3, 3, 3
.
-
DropShadowDecorator
public DropShadowDecorator(int radius, int xOff, int yOff)
Construct using non-default values of radius and offsets.- Parameters:
radius
- The radius to blur around the component.xOff
- X-offset for the blurring to occur.yOff
- Y-offset of the blurring.
-
-
Method Detail
-
getShadowColor
public java.awt.Color getShadowColor()
- Returns:
- The color used to draw the shadow.
-
setShadowColor
public void setShadowColor(java.awt.Color colorValue)
Sets the color used to draw the shadow.- Parameters:
colorValue
- The color used to draw the shadow.
-
setShadowColor
public final void setShadowColor(java.lang.String shadowColorString)
Sets the color used to draw the shadow.- Parameters:
shadowColorString
- The color used to draw the shadow, which can be any of the color values recognized by Pivot.
-
getShadowOpacity
public float getShadowOpacity()
Returns the opacity used to draw the shadow.- Returns:
- The color used to draw the shadow.
-
setShadowOpacity
public void setShadowOpacity(float opacity)
Sets the opacity used to draw the shadow.- Parameters:
opacity
- The opacity used to draw the shadow.
-
getBlurRadius
public int getBlurRadius()
- Returns:
- The blur radius used to draw the shadow.
-
setBlurRadius
public void setBlurRadius(int radius)
Sets the blur radius used to draw the shadow.- Parameters:
radius
- The blur radius used to draw the shadow.
-
getXOffset
public int getXOffset()
Returns the amount that the drop shadow will be offset along the x axis.- Returns:
- The x offset used to draw the shadow.
-
setXOffset
public void setXOffset(int xOff)
Sets the amount that the drop shadow will be offset along the x axis.- Parameters:
xOff
- The x offset used to draw the shadow.
-
getYOffset
public int getYOffset()
Returns the amount that the drop shadow will be offset along the y axis.- Returns:
- The y offset used to draw the shadow.
-
setYOffset
public void setYOffset(int yOff)
Sets the amount that the drop shadow will be offset along the y axis.- Parameters:
yOff
- The y offset used to draw the shadow.
-
prepare
public java.awt.Graphics2D prepare(Component component, java.awt.Graphics2D graphics)
Description copied from interface:Decorator
Prepares the graphics context into which the component or prior decorator will paint. This method is called immediately prior toComponent.paint(Graphics2D)
; decorators are called in descending order.
-
-