Class AbstractAreaEffect
java.lang.Object
org.jdesktop.swingx.painter.effects.AbstractAreaEffect
- All Implemented Interfaces:
AreaEffect
- Direct Known Subclasses:
GlowPathEffect, InnerGlowPathEffect, InnerShadowPathEffect, NeonBorderEffect, ShadowPathEffect
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
FieldsModifier and TypeFieldDescription(package private) BufferedImageprivate ColorHolds value of property brushColor.private intHolds value of property brushSteps.private static final booleanprivate intHolds value of property effectWidth.private Point2DHolds value of property offset.private PropertyChangeSupportUtility field used by bound properties.private booleanHolds value of property renderInsideShape.private booleanHolds value of property shapeMasked.private booleanHolds value of property shouldFillShape. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a PropertyChangeListener to the listener list.voidapply(Graphics2D g, Shape clipShape, int width, int height) Draws an effect on the specified graphics and path using the specified width and height.Getter for property brushColor.intGetter for property brushSteps.private BufferedImagegetClipImage(Rectangle effectBounds) intGetter for property effectWidth.Getter for property offset.booleanGetter for property renderInsideShape.booleanGetter for property shapeMasked.booleanGetter for property shouldFillShape.protected voidpaintBorderGlow(Graphics2D g2, Shape clipShape, int width, int height) Paints the border glowvoidRemoves a PropertyChangeListener from the listener list.voidsetBrushColor(Color brushColor) Setter for property brushColor.voidsetBrushSteps(int brushSteps) Setter for property brushSteps.voidsetEffectWidth(int effectWidth) Setter for property effectWidth.voidSetter for property offset.voidsetRenderInsideShape(boolean renderInsideShape) Setter for property renderInsideShape.voidsetShapeMasked(boolean shapeMasked) Setter for property shapeMasked.voidsetShouldFillShape(boolean shouldFillShape) Setter for property shouldFillShape.
-
Field Details
-
debug
private static final boolean debug- See Also:
-
_clipImage
BufferedImage _clipImage -
brushColor
Holds value of property brushColor. -
propertyChangeSupport
Utility field used by bound properties. -
brushSteps
private int brushStepsHolds value of property brushSteps. -
effectWidth
private int effectWidthHolds value of property effectWidth. -
renderInsideShape
private boolean renderInsideShapeHolds value of property renderInsideShape. -
offset
Holds value of property offset. -
shouldFillShape
private boolean shouldFillShapeHolds value of property shouldFillShape. -
shapeMasked
private boolean shapeMaskedHolds value of property shapeMasked.
-
-
Constructor Details
-
AbstractAreaEffect
public AbstractAreaEffect()Creates a new instance of AreaEffect
-
-
Method Details
-
apply
Description copied from interface:AreaEffectDraws an effect on the specified graphics and path using the specified width and height.- Specified by:
applyin interfaceAreaEffect- Parameters:
g-clipShape-width-height-
-
getClipImage
-
paintBorderGlow
Paints the border glow- Parameters:
g2-clipShape-width-height-
-
addPropertyChangeListener
Adds a PropertyChangeListener to the listener list.- Parameters:
l- The listener to add.
-
removePropertyChangeListener
Removes a PropertyChangeListener from the listener list.- Parameters:
l- The listener to remove.
-
getBrushColor
-
setBrushColor
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
-
setOffset
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.
-