Class FlatDropShadowBorder
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
javax.swing.plaf.BorderUIResource.EmptyBorderUIResource
com.formdev.flatlaf.ui.FlatEmptyBorder
com.formdev.flatlaf.ui.FlatDropShadowBorder
- All Implemented Interfaces:
FlatStylingSupport.StyleableBorder, Serializable, Border, UIResource
public class FlatDropShadowBorder
extends FlatEmptyBorder
implements FlatStylingSupport.StyleableBorder
Paints a drop shadow border around the component.
Supports 1-sided, 2-side, 3-sided or 4-sided drop shadows.
The shadow insets allow specifying drop shadow thickness for each side. A zero or negative value hides the drop shadow on that side. A negative value can be used to indent the drop shadow on corners. E.g. -4 on left indents drop shadow at top-left and bottom-left corners by 4 pixels.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Colorprivate floatprivate intprivate doubleprivate floatprotected Colorprivate Imageprotected Insetsprotected floatprivate intFields inherited from class EmptyBorder
bottom, left, right, top -
Constructor Summary
ConstructorsConstructorDescriptionFlatDropShadowBorder(Color shadowColor) FlatDropShadowBorder(Color shadowColor, int shadowSize, float shadowOpacity) FlatDropShadowBorder(Color shadowColor, Insets shadowInsets, float shadowOpacity) -
Method Summary
Modifier and TypeMethodDescriptionapplyStyleProperty(String key, Object value) private static BufferedImagecreateShadowImage(Color shadowColor, int shadowSize, float shadowOpacity, float scaleFactor) getStyleableValue(String key) private intprivate static InsetsnonNegativeInsets(Insets shadowInsets) voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height) private voidpaintImpl(Graphics2D g, int x, int y, int width, int height, double scaleFactor) private intscale(int value, double scaleFactor) Methods inherited from class FlatEmptyBorder
applyStyleProperty, getBorderInsets, getBorderInsets, getStyleableValue, getUnscaledBorderInsets, scaleInsetsMethods inherited from class EmptyBorder
isBorderOpaqueMethods inherited from class AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
Field Details
-
shadowColor
-
shadowInsets
-
shadowOpacity
protected float shadowOpacity -
shadowSize
private int shadowSize -
shadowImage
-
lastShadowColor
-
lastShadowOpacity
private float lastShadowOpacity -
lastShadowSize
private int lastShadowSize -
lastSystemScaleFactor
private double lastSystemScaleFactor -
lastUserScaleFactor
private float lastUserScaleFactor
-
-
Constructor Details
-
FlatDropShadowBorder
public FlatDropShadowBorder() -
FlatDropShadowBorder
-
FlatDropShadowBorder
-
FlatDropShadowBorder
-
-
Method Details
-
nonNegativeInsets
-
maxInset
-
applyStyleProperty
- Specified by:
applyStylePropertyin interfaceFlatStylingSupport.StyleableBorder- Since:
- 2
-
getStyleableInfos
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableBorder- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableBorder- Since:
- 2.5
-
paintBorder
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classEmptyBorder
-
paintImpl
-
scale
private int scale(int value, double scaleFactor) -
createShadowImage
private static BufferedImage createShadowImage(Color shadowColor, int shadowSize, float shadowOpacity, float scaleFactor)
-