Package com.formdev.flatlaf.ui
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 Color
private float
private int
private double
private float
protected Color
private Image
protected Insets
protected float
private int
Fields inherited from class javax.swing.border.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 BufferedImage
createShadowImage
(Color shadowColor, int shadowSize, float shadowOpacity, float scaleFactor) getStyleableValue
(String key) private int
private static Insets
nonNegativeInsets
(Insets shadowInsets) void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) private void
paintImpl
(Graphics2D g, int x, int y, int width, int height, double scaleFactor) private int
scale
(int value, double scaleFactor) Methods inherited from class com.formdev.flatlaf.ui.FlatEmptyBorder
applyStyleProperty, getBorderInsets, getBorderInsets, getStyleableValue, getUnscaledBorderInsets, scaleInsets
Methods inherited from class javax.swing.border.EmptyBorder
isBorderOpaque
Methods inherited from class javax.swing.border.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:
applyStyleProperty
in interfaceFlatStylingSupport.StyleableBorder
- Since:
- 2
-
getStyleableInfos
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableBorder
- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableBorder
- Since:
- 2.5
-
paintBorder
- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in classEmptyBorder
-
paintImpl
-
scale
private int scale(int value, double scaleFactor) -
createShadowImage
private static BufferedImage createShadowImage(Color shadowColor, int shadowSize, float shadowOpacity, float scaleFactor)
-