Package com.iizigo.swt
Class ThinBorder
java.lang.Object
javax.swing.border.AbstractBorder
com.iizigo.swt.ThinBorder
- All Implemented Interfaces:
Serializable
,Border
A class which implements three different kinds of borders:
- The raised bevel border,
- The lowered bevel border,
- The line border.
- The raised bevel border,
- The lowered bevel border,
- The line border.
- Author:
- Christopher Mindus
- See Also:
Field Summary
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionReturns the insets of the border.getBorderInsets
(Component c, Insets insets) Reinitialize the insets parameter with this Border's current Insets.void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) Paints the border for the specified component with the specified position and size.void
setHorzMargin
(int margin) Sets the horizontal margin.Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
Field Details
RAISED
public static final int RAISEDRaised bevel type.- See Also:
LOWERED
public static final int LOWEREDLowered bevel type.- See Also:
LINE
public static final int LINELine border type.- See Also:
Constructor Details
ThinBorder
public ThinBorder(int borderType) Creates a bevel border with the specified type. Depending on the type, the correct top and bottom colors will be used.- Parameters:
borderType
- the type of bevel for the border.
Method Details
setHorzMargin
public void setHorzMargin(int margin) Sets the horizontal margin.paintBorder
Paints the border for the specified component with the specified position and size.- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in 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
getBorderInsets
Returns the insets of the border.- Specified by:
getBorderInsets
in interfaceBorder
- Overrides:
getBorderInsets
in classAbstractBorder
- Parameters:
c
- the component for which this border insets value applies
getBorderInsets
Reinitialize the insets parameter with this Border's current Insets.- Overrides:
getBorderInsets
in classAbstractBorder
- Parameters:
c
- the component for which this border insets value applies.insets
- the object to be reinitialized.