public class DropShadowBorder extends Object implements Border, Serializable
Note: DropShadowBorder
should usually be added to non-opaque
components, otherwise the background is likely to bleed through.
Constructor and Description |
---|
DropShadowBorder()
Constructs a new border.
|
DropShadowBorder(boolean showLeftShadow)
Constructs a new border (color = black, size = 5, opacity = .5, corner
size = 12).
|
DropShadowBorder(Color shadowColor,
int shadowSize)
Constructs a new border.
|
DropShadowBorder(Color shadowColor,
int shadowSize,
float shadowOpacity,
int cornerSize,
boolean showTopShadow,
boolean showLeftShadow,
boolean showBottomShadow,
boolean showRightShadow)
Constructs a new border.
|
Modifier and Type | Method and Description |
---|---|
Insets |
getBorderInsets(Component c) |
int |
getCornerSize()
Returns the corner size of the shadow.
|
Color |
getShadowColor()
Returns the color of the shadow.
|
float |
getShadowOpacity()
Returns the opacity of the shadow.
|
int |
getShadowSize()
Returns the size of the shadow.
|
boolean |
isBorderOpaque() |
boolean |
isShowBottomShadow()
Determines if border draws shadow on bottom of the component.
|
boolean |
isShowLeftShadow()
Determines if border draws shadow on left side of the component.
|
boolean |
isShowRightShadow()
Determines if border draws shadow on right side of the component.
|
boolean |
isShowTopShadow()
Determines if border draws shadow on top of the component.
|
void |
paintBorder(Component c,
Graphics graphics,
int x,
int y,
int width,
int height) |
public DropShadowBorder()
public DropShadowBorder(Color shadowColor, int shadowSize)
shadowColor
- the color of the shadowshadowSize
- the size of the shadowpublic DropShadowBorder(boolean showLeftShadow)
showLeftShadow
- also show shadow to the leftpublic DropShadowBorder(Color shadowColor, int shadowSize, float shadowOpacity, int cornerSize, boolean showTopShadow, boolean showLeftShadow, boolean showBottomShadow, boolean showRightShadow)
shadowColor
- the color of the shadowshadowSize
- the size of the shadowshadowOpacity
- the opacity of the shadowcornerSize
- the size of the shadow cornersshowTopShadow
- draw border at topshowLeftShadow
- draw border on left sideshowBottomShadow
- draw border at bottomshowRightShadow
- draw border on right sidepublic void paintBorder(Component c, Graphics graphics, int x, int y, int width, int height)
paintBorder
in interface Border
public Insets getBorderInsets(Component c)
getBorderInsets
in interface Border
public boolean isBorderOpaque()
isBorderOpaque
in interface Border
public boolean isShowTopShadow()
public boolean isShowLeftShadow()
public boolean isShowRightShadow()
public boolean isShowBottomShadow()
public int getShadowSize()
public Color getShadowColor()
public float getShadowOpacity()
public int getCornerSize()
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.