All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.taligent.widget.BorderPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----COM.taligent.widget.BorderPanel

public class BorderPanel
extends Panel
Various graphical borders. The border itself is a Panel so that it can contain other Components (i.e. it borders something). You use the BorderPanel like any other Panel: you set the layout that you prefer and add Components to it. Beware that a null layout does not obey the insets of the panel so if you use null layouts, adjust your measurements to handle the border by calling insets().


Variable Index

 o CENTER
Center alignment.
 o DEFAULT_ALIGNMENT
Default alignment (LEFT).
 o DEFAULT_COLOR
Default color (black).
 o DEFAULT_FONT
Default font (TimesRoman,PLAIN,14).
 o DEFAULT_GAP
Default gap between border and contained component (5).
 o DEFAULT_IN_THICKNESS
Default thickness for etched-in borders (10).
 o DEFAULT_LOWERED_THICKNESS
Default thickness for lowered borders (2).
 o DEFAULT_OUT_THICKNESS
Default thickness for etched-out borders (10).
 o DEFAULT_RAISED_THICKNESS
Default thickness for raised borders (2).
 o DEFAULT_SOLID_THICKNESS
Default thickness for solid borders (4).
 o DEFAULT_STYLE
Default style (IN).
 o DEFAULT_THICKNESS
Default thickness (10).
 o IN
An etched in border.
 o LEFT
Left alignment.
 o LOWERED
A lowered border.
 o OUT
An etched out border.
 o RAISED
A raised border.
 o RIGHT
Right alignment.
 o SOLID
Solid border.

Constructor Index

 o BorderPanel()
Constructor.
 o BorderPanel(Color, int)
Constructor.
 o BorderPanel(int)
Constructor.
 o BorderPanel(int, int)
Constructor.
 o BorderPanel(String)
Constructor.

Method Index

 o getAlignment()
Gets the text alignment.
 o getColor()
Gets the current color for SOLID borders and the caption text color for etched borders.
 o getGap()
Gets the gap between the border and the contained Component.
 o getStyle()
Gets the style of the border
 o getText()
Gets the text.
 o getTextFont()
Gets the font of the text.
 o getThickness()
Gets the thickness of the border.
 o insets()
Returns the insets of this panel..
 o paint(Graphics)
Repaints the border.
 o setAlignment(int)
Sets the text alignment.
 o setColor(Color)
Sets the current color for SOLID borders and the caption text color for etched borders.
 o setGap(int)
Sets the gap between the border and the contained Component.
 o setStyle(int)
Sets the style of the border
 o setText(String)
Sets the text.
 o setTextFont(Font)
Sets the font.
 o setThickness(int)
Sets the thickness of the border.
 o toString()
Returns the settings of this BorderPanel instance as a string.

Variables

 o SOLID
 public static final int SOLID
Solid border.

 o RAISED
 public static final int RAISED
A raised border.

 o LOWERED
 public static final int LOWERED
A lowered border.

 o IN
 public static final int IN
An etched in border.

 o OUT
 public static final int OUT
An etched out border.

 o LEFT
 public static final int LEFT
Left alignment.

 o CENTER
 public static final int CENTER
Center alignment.

 o RIGHT
 public static final int RIGHT
Right alignment.

 o DEFAULT_STYLE
 public static final int DEFAULT_STYLE
Default style (IN).

 o DEFAULT_THICKNESS
 public static final int DEFAULT_THICKNESS
Default thickness (10).

 o DEFAULT_SOLID_THICKNESS
 public static final int DEFAULT_SOLID_THICKNESS
Default thickness for solid borders (4).

 o DEFAULT_RAISED_THICKNESS
 public static final int DEFAULT_RAISED_THICKNESS
Default thickness for raised borders (2).

 o DEFAULT_LOWERED_THICKNESS
 public static final int DEFAULT_LOWERED_THICKNESS
Default thickness for lowered borders (2).

 o DEFAULT_IN_THICKNESS
 public static final int DEFAULT_IN_THICKNESS
Default thickness for etched-in borders (10).

 o DEFAULT_OUT_THICKNESS
 public static final int DEFAULT_OUT_THICKNESS
Default thickness for etched-out borders (10).

 o DEFAULT_GAP
 public static final int DEFAULT_GAP
Default gap between border and contained component (5).

 o DEFAULT_COLOR
 public static final Color DEFAULT_COLOR
Default color (black). Applies to SOLID and etched borders.

 o DEFAULT_FONT
 public static final Font DEFAULT_FONT
Default font (TimesRoman,PLAIN,14). Only applies to etched borders.

 o DEFAULT_ALIGNMENT
 public static final int DEFAULT_ALIGNMENT
Default alignment (LEFT). Only applies to etched borders.

Constructors

 o BorderPanel
 public BorderPanel()
Constructor. Makes default border.

 o BorderPanel
 public BorderPanel(String text)
Constructor. Makes an etched IN border with given text caption.

Parameters:
text - Text caption
 o BorderPanel
 public BorderPanel(Color color,
                    int thickness)
Constructor. Makes SOLID border with color and thickness given.

Parameters:
color - The color for the border.
thickness - The thickness of the border.
 o BorderPanel
 public BorderPanel(int style)
Constructor. Makes a border of the given style with the default thickness for that style.

Parameters:
style - The style for this border.
 o BorderPanel
 public BorderPanel(int style,
                    int thickness)
Constructor. Makes border with given style and thickness.

Parameters:
style - The style for this border.
thickness - The thickness for this border.

Methods

 o insets
 public Insets insets()
Returns the insets of this panel..

Overrides:
insets in class Container
 o setStyle
 public BorderPanel setStyle(int style)
Sets the style of the border

Parameters:
style - The new style.
 o getStyle
 public int getStyle()
Gets the style of the border

 o setThickness
 public BorderPanel setThickness(int thickness)
Sets the thickness of the border.

Parameters:
thickness - The new thickness
 o getThickness
 public int getThickness()
Gets the thickness of the border.

 o setGap
 public BorderPanel setGap(int gap)
Sets the gap between the border and the contained Component.

Parameters:
gap - The new gap, in pixels.
 o getGap
 public int getGap()
Gets the gap between the border and the contained Component.

 o setColor
 public BorderPanel setColor(Color color)
Sets the current color for SOLID borders and the caption text color for etched borders.

Parameters:
color - The new color.
 o getColor
 public Color getColor()
Gets the current color for SOLID borders and the caption text color for etched borders.

 o setTextFont
 public BorderPanel setTextFont(Font font)
Sets the font. Only applies to etched borders.

 o getTextFont
 public Font getTextFont()
Gets the font of the text. Only applies to etched borders.

 o setText
 public BorderPanel setText(String text)
Sets the text. Only applies to etched borders.

Parameters:
text - The new text.
 o getText
 public String getText()
Gets the text. Only applies to etched borders.

 o setAlignment
 public BorderPanel setAlignment(int alignment)
Sets the text alignment. Only applies to etched borders.

Parameters:
alignment - The new alignment.
 o getAlignment
 public int getAlignment()
Gets the text alignment.

 o paint
 public void paint(Graphics g)
Repaints the border.

Parameters:
g - The graphics context.
Overrides:
paint in class Container
 o toString
 public String toString()
Returns the settings of this BorderPanel instance as a string.

Overrides:
toString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index