Package com.github.tadukoo.view.border
Class ShapedBevelBorder
java.lang.Object
javax.swing.border.AbstractBorder
com.github.tadukoo.view.border.ShapedBevelBorder
- All Implemented Interfaces:
Serializable,Border
Shaped Etched Border mimics the functionality of a
BevelBorder, 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 Bevel type to be used (RAISED or LOWERED) for a borderstatic classShaped Bevel Border Builder is used to create aShapedBevelBorder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ShapedBevelBorder.BevelTypeThetype of bevel(RAISED or LOWERED)private final SizablePaintTheSizablePaintfor the inner highlightprivate final SizablePaintTheSizablePaintfor the outer highlightprivate final SizablePaintTheSizablePaintfor the inner shadowprivate final SizablePaintTheSizablePaintfor the outer shadowprivate final ShapeInfoTheShapeInfoto use on the Border (may be null to use the component's shape) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateShapedBevelBorder(ShapeInfo shapeInfo, ShapedBevelBorder.BevelType bevelType, SizablePaint highlightInnerPaint, SizablePaint highlightOuterPaint, SizablePaint shadowInnerPaint, SizablePaint shadowOuterPaint) Creates a new Shaped Bevel Border with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionbuilder()getBorderInsets(Component c, Insets insets) private PaintgetHighlightInnerPaint(Component c, Dimension size) Returns aPaintto use for the inner highlight on the given component with the given size.private PaintgetHighlightOuterPaint(Component c, Dimension size) Returns aPaintto use for the outer highlight on the given component with the given size.private PaintgetShadowInnerPaint(Component c, Dimension size) Returns aPaintto use for the inner shadow on the given component with the given size.private PaintgetShadowOuterPaint(Component c, Dimension size) Returns aPaintto use for the outer shadow on the given component with the given size.voidpaintBorder(Component c, Graphics g, int x, int y, int w, int h) private voidpaintLoweredBevel(Component c, Graphics g, int x, int y, int w, int h, ShapeInfo shapeInfo) Paints a lowered bevel for the specified component with the specified position and size.private voidpaintRaisedBevel(Component c, Graphics g, int x, int y, int w, int h, ShapeInfo shapeInfo) Paints a raised bevel for the specified component with the specified position and size.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) -
bevelType
Thetype of bevel(RAISED or LOWERED) -
highlightInnerPaint
TheSizablePaintfor the inner highlight -
highlightOuterPaint
TheSizablePaintfor the outer highlight -
shadowInnerPaint
TheSizablePaintfor the inner shadow -
shadowOuterPaint
TheSizablePaintfor the outer shadow
-
-
Constructor Details
-
ShapedBevelBorder
private ShapedBevelBorder(ShapeInfo shapeInfo, ShapedBevelBorder.BevelType bevelType, SizablePaint highlightInnerPaint, SizablePaint highlightOuterPaint, SizablePaint shadowInnerPaint, SizablePaint shadowOuterPaint) Creates a new Shaped Bevel Border with the given parameters- Parameters:
shapeInfo- TheShapeInfoto use on the Border (may be null to use the component's shape)bevelType- Thetype of bevel(RAISED or LOWERED)highlightInnerPaint- TheSizablePaintfor the inner highlighthighlightOuterPaint- TheSizablePaintfor the outer highlightshadowInnerPaint- TheSizablePaintfor the inner shadowshadowOuterPaint- TheSizablePaintfor the outer shadow
-
-
Method Details
-
builder
- Returns:
- A
builderto create aShapedBevelBorder
-
getBorderInsets
- Specified by:
getBorderInsetsin interfaceBorder- Overrides:
getBorderInsetsin classAbstractBorder
-
getBorderInsets
- Overrides:
getBorderInsetsin classAbstractBorder
-
paintBorder
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classAbstractBorder
-
paintRaisedBevel
private void paintRaisedBevel(Component c, Graphics g, int x, int y, int w, int h, ShapeInfo shapeInfo) Paints a raised bevel for the specified component with the specified position and size.- Parameters:
c- the component for which the bevel is being paintedg- the paint graphicsx- the x position of the bevely- the y position of the bevelw- the width of the bevelh- the height of the bevelshapeInfo- TheShapeInfoto use for the bevel
-
paintLoweredBevel
private void paintLoweredBevel(Component c, Graphics g, int x, int y, int w, int h, ShapeInfo shapeInfo) Paints a lowered bevel for the specified component with the specified position and size.- Parameters:
c- the component for which the lowered bevel is being paintedg- the paint graphicsx- the x position of the lowered bevely- the y position of the lowered bevelw- the width of the lowered bevelh- the height of the lowered bevelshapeInfo- TheShapeInfoto use for the bevel
-
getHighlightInnerPaint
Returns aPaintto use for the inner highlight on the given component with the given size. -
getHighlightOuterPaint
Returns aPaintto use for the outer highlight on the given component with the given size. -
getShadowInnerPaint
Returns aPaintto use for the inner shadow on the given component with the given size. -
getShadowOuterPaint
Returns aPaintto use for the outer shadow on the given component with the given size.
-