Package weka.gui.beans
Class ShadowBorder
java.lang.Object
javax.swing.border.AbstractBorder
weka.gui.beans.ShadowBorder
- All Implemented Interfaces:
Serializable,Border
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.ShadowBorder(int width) Constructor.ShadowBorder(int width, Color color) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new Insets instance where the top and left are 1, the bottom and right fields are the border width + 1.getBorderInsets(Component c, Insets insets) Reinitializes theinsetsparameter with this ShadowBorder's current Insets.booleanThis implementation always returns true.voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height) Paints the drop shadow border around the given component.Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle
-
Constructor Details
-
ShadowBorder
public ShadowBorder()Constructor. Drop shadow with default width of 2 pixels and black color. -
ShadowBorder
public ShadowBorder(int width) Constructor. Drop shadow, default shadow color is black.- Parameters:
width- the width of the shadow.
-
ShadowBorder
Constructor. Drop shadow, width and color are adjustable.- Parameters:
width- the width of the shadow.color- the color of the shadow.
-
-
Method Details
-
getBorderInsets
Returns a new Insets instance where the top and left are 1, the bottom and right fields are the border width + 1.- Specified by:
getBorderInsetsin interfaceBorder- Overrides:
getBorderInsetsin classAbstractBorder- Parameters:
c- the component for which this border insets value applies- Returns:
- a new Insets object initialized as stated above.
-
getBorderInsets
Reinitializes theinsetsparameter with this ShadowBorder's current Insets.- Overrides:
getBorderInsetsin classAbstractBorder- Parameters:
c- the component for which this border insets value appliesinsets- the object to be reinitialized- Returns:
- the given
insetsobject
-
isBorderOpaque
public boolean isBorderOpaque()This implementation always returns true.- Specified by:
isBorderOpaquein interfaceBorder- Overrides:
isBorderOpaquein classAbstractBorder- Returns:
- true
-
paintBorder
Paints the drop shadow border around the given component.- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classAbstractBorder- Parameters:
c- - the component for which this border is being paintedg- - the paint graphicsx- - the x position of the painted bordery- - the y position of the painted borderwidth- - the width of the painted borderheight- - the height of the painted border
-