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
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum representing the Etch type to be used (RAISED or LOWERED) for a borderstatic classShaped Etched Border Builder is used to create aShapedEtchedBorder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ShapedEtchedBorder.EtchTypeThetype of etching(RAISED or LOWERED)private final SizablePaintTheSizablePaintfor the highlightprivate final SizablePaintTheSizablePaintfor the shadowprivate final ShapeInfoTheShapeInfoto use on the Border (may be null to use the component's shape) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateShapedEtchedBorder(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 PaintgetHighlightPaint(Component c, Dimension size) Returns aPaintto use for the highlight on the given component with the given size.private PaintgetShadowPaint(Component c, Dimension size) Returns aPaintto use for the shadow on the given component with the given size.voidpaintBorder(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
TheShapeInfoto use on the Border (may be null to use the component's shape) -
etchType
Thetype of etching(RAISED or LOWERED) -
highlightPaint
TheSizablePaintfor the highlight -
shadowPaint
TheSizablePaintfor 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- TheShapeInfoto use on the Border (may be null to use the component's shape)etchType- Thetype of etching(RAISED or LOWERED)highlightPaint- TheSizablePaintfor the highlightshadowPaint- TheSizablePaintfor the shadow
-
-
Method Details
-
builder
- Returns:
- A
builderto create aShapedEtchedBorder
-
getBorderInsets
- Specified by:
getBorderInsetsin interfaceBorder- Overrides:
getBorderInsetsin classAbstractBorder
-
getBorderInsets
- Overrides:
getBorderInsetsin classAbstractBorder
-
paintBorder
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classAbstractBorder
-
getHighlightPaint
Returns aPaintto use for the highlight on the given component with the given size. -
getShadowPaint
Returns aPaintto use for the shadow on the given component with the given size.
-