Class NeonBorderEffect
- java.lang.Object
-
- org.jdesktop.swingx.painter.effects.AbstractAreaEffect
-
- org.jdesktop.swingx.painter.effects.NeonBorderEffect
-
- All Implemented Interfaces:
AreaEffect
public class NeonBorderEffect extends AbstractAreaEffect
An effect which draws a multicolored border around a painter's shape. It will interpolate between two specified colors, creating a neon like effect.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NeonBorderEffect.BorderPosition
An enum representing the position of the border: inside, outside, or centered on the border.
-
Constructor Summary
Constructors Constructor Description NeonBorderEffect()
Create a new NeonBorderEffectNeonBorderEffect(java.awt.Color edgeColor, java.awt.Color centerColor, int effectWidth)
Creates a new instance of NeonBorderEffect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NeonBorderEffect.BorderPosition
getBorderPosition()
java.awt.Color
getCenterColor()
java.awt.Color
getEdgeColor()
Gets the current edge color.protected java.awt.Color
interpolateColor(float t, java.awt.Color start, java.awt.Color end)
protected void
paintBorderGlow(java.awt.Graphics2D gfx, java.awt.Shape clipShape, int width, int height)
Paints the border glowvoid
setBorderPosition(NeonBorderEffect.BorderPosition borderPosition)
void
setCenterColor(java.awt.Color centerColor)
void
setEdgeColor(java.awt.Color edgeColor)
Set the edge color-
Methods inherited from class org.jdesktop.swingx.painter.effects.AbstractAreaEffect
addPropertyChangeListener, apply, getBrushColor, getBrushSteps, getEffectWidth, getOffset, isRenderInsideShape, isShapeMasked, isShouldFillShape, removePropertyChangeListener, setBrushColor, setBrushSteps, setEffectWidth, setOffset, setRenderInsideShape, setShapeMasked, setShouldFillShape
-
-
-
-
Method Detail
-
paintBorderGlow
protected void paintBorderGlow(java.awt.Graphics2D gfx, java.awt.Shape clipShape, int width, int height)
Description copied from class:AbstractAreaEffect
Paints the border glow- Overrides:
paintBorderGlow
in classAbstractAreaEffect
-
interpolateColor
protected java.awt.Color interpolateColor(float t, java.awt.Color start, java.awt.Color end)
-
getEdgeColor
public java.awt.Color getEdgeColor()
Gets the current edge color.- Returns:
- current edge color
-
setEdgeColor
public void setEdgeColor(java.awt.Color edgeColor)
Set the edge color- Parameters:
edgeColor
-
-
getCenterColor
public java.awt.Color getCenterColor()
- Returns:
-
setCenterColor
public void setCenterColor(java.awt.Color centerColor)
- Parameters:
centerColor
-
-
getBorderPosition
public NeonBorderEffect.BorderPosition getBorderPosition()
- Returns:
-
setBorderPosition
public void setBorderPosition(NeonBorderEffect.BorderPosition borderPosition)
- Parameters:
borderPosition
-
-
-