Class AbstractAreaEffect
- java.lang.Object
-
- org.jdesktop.swingx.painter.effects.AbstractAreaEffect
-
- All Implemented Interfaces:
AreaEffect
- Direct Known Subclasses:
GlowPathEffect
,InnerGlowPathEffect
,InnerShadowPathEffect
,NeonBorderEffect
,ShadowPathEffect
public class AbstractAreaEffect extends java.lang.Object implements AreaEffect
The abstract base class for path effects. It takes care of soft clipping and interpolating brush sizes and colors. Subclasses can change these values to provide prefab effect behavior, like dropshadows and glows.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.awt.image.BufferedImage
_clipImage
private java.awt.Color
brushColor
Holds value of property brushColor.private int
brushSteps
Holds value of property brushSteps.private static boolean
debug
private int
effectWidth
Holds value of property effectWidth.private java.awt.geom.Point2D
offset
Holds value of property offset.private java.beans.PropertyChangeSupport
propertyChangeSupport
Utility field used by bound properties.private boolean
renderInsideShape
Holds value of property renderInsideShape.private boolean
shapeMasked
Holds value of property shapeMasked.private boolean
shouldFillShape
Holds value of property shouldFillShape.
-
Constructor Summary
Constructors Constructor Description AbstractAreaEffect()
Creates a new instance of AreaEffect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list.void
apply(java.awt.Graphics2D g, java.awt.Shape clipShape, int width, int height)
Draws an effect on the specified graphics and path using the specified width and height.java.awt.Color
getBrushColor()
Getter for property brushColor.int
getBrushSteps()
Getter for property brushSteps.private java.awt.image.BufferedImage
getClipImage(java.awt.Rectangle effectBounds)
int
getEffectWidth()
Getter for property effectWidth.java.awt.geom.Point2D
getOffset()
Getter for property offset.boolean
isRenderInsideShape()
Getter for property renderInsideShape.boolean
isShapeMasked()
Getter for property shapeMasked.boolean
isShouldFillShape()
Getter for property shouldFillShape.protected void
paintBorderGlow(java.awt.Graphics2D g2, java.awt.Shape clipShape, int width, int height)
Paints the border glowvoid
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list.void
setBrushColor(java.awt.Color brushColor)
Setter for property brushColor.void
setBrushSteps(int brushSteps)
Setter for property brushSteps.void
setEffectWidth(int effectWidth)
Setter for property effectWidth.void
setOffset(java.awt.geom.Point2D offset)
Setter for property offset.void
setRenderInsideShape(boolean renderInsideShape)
Setter for property renderInsideShape.void
setShapeMasked(boolean shapeMasked)
Setter for property shapeMasked.void
setShouldFillShape(boolean shouldFillShape)
Setter for property shouldFillShape.
-
-
-
Field Detail
-
debug
private static final boolean debug
- See Also:
- Constant Field Values
-
_clipImage
java.awt.image.BufferedImage _clipImage
-
brushColor
private java.awt.Color brushColor
Holds value of property brushColor.
-
propertyChangeSupport
private java.beans.PropertyChangeSupport propertyChangeSupport
Utility field used by bound properties.
-
brushSteps
private int brushSteps
Holds value of property brushSteps.
-
effectWidth
private int effectWidth
Holds value of property effectWidth.
-
renderInsideShape
private boolean renderInsideShape
Holds value of property renderInsideShape.
-
offset
private java.awt.geom.Point2D offset
Holds value of property offset.
-
shouldFillShape
private boolean shouldFillShape
Holds value of property shouldFillShape.
-
shapeMasked
private boolean shapeMasked
Holds value of property shapeMasked.
-
-
Method Detail
-
apply
public void apply(java.awt.Graphics2D g, java.awt.Shape clipShape, int width, int height)
Description copied from interface:AreaEffect
Draws an effect on the specified graphics and path using the specified width and height.- Specified by:
apply
in interfaceAreaEffect
-
getClipImage
private java.awt.image.BufferedImage getClipImage(java.awt.Rectangle effectBounds)
-
paintBorderGlow
protected void paintBorderGlow(java.awt.Graphics2D g2, java.awt.Shape clipShape, int width, int height)
Paints the border glow- Parameters:
g2
-clipShape
-width
-height
-
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list.- Parameters:
l
- The listener to add.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list.- Parameters:
l
- The listener to remove.
-
getBrushColor
public java.awt.Color getBrushColor()
Getter for property brushColor.- Returns:
- Value of property brushColor.
-
setBrushColor
public void setBrushColor(java.awt.Color brushColor)
Setter for property brushColor.- Parameters:
brushColor
- New value of property brushColor.
-
getBrushSteps
public int getBrushSteps()
Getter for property brushSteps.- Returns:
- Value of property brushSteps.
-
setBrushSteps
public void setBrushSteps(int brushSteps)
Setter for property brushSteps.- Parameters:
brushSteps
- New value of property brushSteps.
-
getEffectWidth
public int getEffectWidth()
Getter for property effectWidth.- Returns:
- Value of property effectWidth.
-
setEffectWidth
public void setEffectWidth(int effectWidth)
Setter for property effectWidth.- Parameters:
effectWidth
- New value of property effectWidth.
-
isRenderInsideShape
public boolean isRenderInsideShape()
Getter for property renderInsideShape.- Returns:
- Value of property renderInsideShape.
-
setRenderInsideShape
public void setRenderInsideShape(boolean renderInsideShape)
Setter for property renderInsideShape.- Parameters:
renderInsideShape
- New value of property renderInsideShape.
-
getOffset
public java.awt.geom.Point2D getOffset()
Getter for property offset.- Returns:
- Value of property offset.
-
setOffset
public void setOffset(java.awt.geom.Point2D offset)
Setter for property offset.- Parameters:
offset
- New value of property offset.
-
isShouldFillShape
public boolean isShouldFillShape()
Getter for property shouldFillShape.- Returns:
- Value of property shouldFillShape.
-
setShouldFillShape
public void setShouldFillShape(boolean shouldFillShape)
Setter for property shouldFillShape.- Parameters:
shouldFillShape
- New value of property shouldFillShape.
-
isShapeMasked
public boolean isShapeMasked()
Getter for property shapeMasked.- Returns:
- Value of property shapeMasked.
-
setShapeMasked
public void setShapeMasked(boolean shapeMasked)
Setter for property shapeMasked.- Parameters:
shapeMasked
- New value of property shapeMasked.
-
-