Package com.iizigo.swt
Class ThinBorder
- java.lang.Object
- javax.swing.border.AbstractBorder
- com.iizigo.swt.ThinBorder
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.border.Border
public class ThinBorder extends javax.swing.border.AbstractBorder
A class which implements three different kinds of borders:
- The raised bevel border,
- The lowered bevel border,
- The line border.- Author:
- Christopher Mindus
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description ThinBorder(int borderType)
Creates a bevel border with the specified type.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Insets
getBorderInsets(java.awt.Component c)
Returns the insets of the border.java.awt.Insets
getBorderInsets(java.awt.Component c, java.awt.Insets insets)
Reinitialize the insets parameter with this Border's current Insets.void
paintBorder(java.awt.Component c, java.awt.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.
Field Detail
RAISED
public static final int RAISED
Raised bevel type.- See Also:
- Constant Field Values
LOWERED
public static final int LOWERED
Lowered bevel type.- See Also:
- Constant Field Values
LINE
public static final int LINE
Line border type.- See Also:
- Constant Field Values
Method Detail
setHorzMargin
public void setHorzMargin(int margin)
Sets the horizontal margin.
paintBorder
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
Paints the border for the specified component with the specified position and size.- Specified by:
paintBorder
in interfacejavax.swing.border.Border
- Overrides:
paintBorder
in classjavax.swing.border.AbstractBorder
- 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
public java.awt.Insets getBorderInsets(java.awt.Component c)
Returns the insets of the border.- Specified by:
getBorderInsets
in interfacejavax.swing.border.Border
- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
- Parameters:
c
- the component for which this border insets value applies
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
Reinitialize the insets parameter with this Border's current Insets.- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
- Parameters:
c
- the component for which this border insets value applies.insets
- the object to be reinitialized.