Package com.github.tadukoo.view.border
Class ShapedEtchedBorder
java.lang.Object
javax.swing.border.AbstractBorder
com.github.tadukoo.view.border.ShapedEtchedBorder
- All Implemented Interfaces:
Serializable
,Border
Shaped Etched Border mimics the functionality of a
EtchedBorder
, but uses the
ShapeInfo
(if present) on the component to draw the border, rather than making a rectangular border, or
it can have its own ShapeInfo
if desired.- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.2.1
- Author:
- Logan Ferree (Tadukoo)
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enum representing the Etch type to be used (RAISED or LOWERED) for a borderstatic class
Shaped Etched Border Builder is used to create aShapedEtchedBorder
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final ShapedEtchedBorder.EtchType
Thetype of etching
(RAISED or LOWERED)private final SizablePaint
TheSizablePaint
for the highlightprivate final SizablePaint
TheSizablePaint
for the shadowprivate final ShapeInfo
TheShapeInfo
to use on the Border (may be null to use the component's shape) -
Constructor Summary
ModifierConstructorDescriptionprivate
ShapedEtchedBorder
(ShapeInfo shapeInfo, ShapedEtchedBorder.EtchType etchType, SizablePaint highlightPaint, SizablePaint shadowPaint) Creates a new Shaped Etched Border with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
getBorderInsets
(Component c, Insets insets) private Paint
getHighlightPaint
(Component c, Dimension size) Returns aPaint
to use for the highlight on the given component with the given size.private Paint
getShadowPaint
(Component c, Dimension size) Returns aPaint
to use for the shadow on the given component with the given size.void
paintBorder
(Component c, Graphics g, int x, int y, int w, int h) Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
-
Field Details
-
shapeInfo
TheShapeInfo
to use on the Border (may be null to use the component's shape) -
etchType
Thetype of etching
(RAISED or LOWERED) -
highlightPaint
TheSizablePaint
for the highlight -
shadowPaint
TheSizablePaint
for the shadow
-
-
Constructor Details
-
ShapedEtchedBorder
private ShapedEtchedBorder(ShapeInfo shapeInfo, ShapedEtchedBorder.EtchType etchType, SizablePaint highlightPaint, SizablePaint shadowPaint) Creates a new Shaped Etched Border with the given parameters- Parameters:
shapeInfo
- TheShapeInfo
to use on the Border (may be null to use the component's shape)etchType
- Thetype of etching
(RAISED or LOWERED)highlightPaint
- TheSizablePaint
for the highlightshadowPaint
- TheSizablePaint
for the shadow
-
-
Method Details
-
builder
- Returns:
- A
builder
to create aShapedEtchedBorder
-
getBorderInsets
- Specified by:
getBorderInsets
in interfaceBorder
- Overrides:
getBorderInsets
in classAbstractBorder
-
getBorderInsets
- Overrides:
getBorderInsets
in classAbstractBorder
-
paintBorder
- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in classAbstractBorder
-
getHighlightPaint
Returns aPaint
to use for the highlight on the given component with the given size. -
getShadowPaint
Returns aPaint
to use for the shadow on the given component with the given size.
-