Class NeonBorderEffect
java.lang.Object
org.jdesktop.swingx.painter.effects.AbstractAreaEffect
org.jdesktop.swingx.painter.effects.NeonBorderEffect
- All Implemented Interfaces:
AreaEffect
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 ClassesModifier and TypeClassDescriptionstatic enumAn enum representing the position of the border: inside, outside, or centered on the border. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NeonBorderEffect.BorderPositionprivate Colorprivate ColorFields inherited from class org.jdesktop.swingx.painter.effects.AbstractAreaEffect
_clipImage -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new NeonBorderEffectNeonBorderEffect(Color edgeColor, Color centerColor, int effectWidth) Creates a new instance of NeonBorderEffect -
Method Summary
Modifier and TypeMethodDescriptionGets the current edge color.protected ColorinterpolateColor(float t, Color start, Color end) protected voidpaintBorderGlow(Graphics2D gfx, Shape clipShape, int width, int height) Paints the border glowvoidsetBorderPosition(NeonBorderEffect.BorderPosition borderPosition) voidsetCenterColor(Color centerColor) voidsetEdgeColor(Color edgeColor) Set the edge colorMethods 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
-
Field Details
-
edgeColor
-
centerColor
-
borderPosition
-
-
Constructor Details
-
NeonBorderEffect
public NeonBorderEffect()Create a new NeonBorderEffect -
NeonBorderEffect
Creates a new instance of NeonBorderEffect
-
-
Method Details
-
paintBorderGlow
Description copied from class:AbstractAreaEffectPaints the border glow- Overrides:
paintBorderGlowin classAbstractAreaEffect- Parameters:
gfx-clipShape-width-height-
-
interpolateColor
-
getEdgeColor
Gets the current edge color.- Returns:
- current edge color
-
setEdgeColor
Set the edge color- Parameters:
edgeColor-
-
getCenterColor
- Returns:
- color in the center of the effect
-
setCenterColor
- Parameters:
centerColor- color in the center of the effect.- See Also:
-
getBorderPosition
- Returns:
- position of the border relative to the edge of painter covered area.
- See Also:
-
setBorderPosition
- Parameters:
borderPosition- position of the border relative to the edge of painter covered area.- See Also:
-