|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.border.AbstractBorder
com.jaxfront.swing.ui.tools.TitledBorder
public class TitledBorder
A class which implements an arbitrary border with the addition of a String title in a specified position and justification.
If the border, font, or color property values are not specified in the constuctor or by invoking the appropriate set methods, the property values will be defined by the current look and feel, using the following property names in the Defaults Table:
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
Field Summary | |
---|---|
static int |
ABOVE_BOTTOM
Position the title above the border's bottom line. |
static int |
ABOVE_TOP
Position the title above the border's top line. |
static int |
BELOW_BOTTOM
Position the title below the border's bottom line. |
static int |
BELOW_TOP
Position the title below the border's top line. |
static int |
BOTTOM
Position the title in the middle of the border's bottom line. |
static int |
CENTER
Position title text in the center of the border line. |
static int |
DEFAULT_JUSTIFICATION
Use the default justification for the title text. |
static int |
DEFAULT_POSITION
Use the default vertical orientation for the title text. |
static int |
LEADING
Position title text at the left side of the border line for left to right orientation, at the right side of the border line for right to left orientation. |
static int |
LEFT
Position title text at the left side of the border line. |
static int |
RIGHT
Position title text at the right side of the border line. |
static int |
TOP
Position the title in the middle of the border's top line. |
static int |
TRAILING
Position title text at the right side of the border line for left to right orientation, at the left side of the border line for right to left orientation. |
Constructor Summary | |
---|---|
TitledBorder(javax.swing.border.Border border)
Creates a TitledBorder instance with the specified border and an empty title. |
|
TitledBorder(javax.swing.border.Border border,
java.lang.String title)
Creates a TitledBorder instance with the specified border and title. |
|
TitledBorder(javax.swing.border.Border border,
java.lang.String title,
int titleJustification,
int titlePosition)
Creates a TitledBorder instance with the specified border, title, title-justification, and title-position. |
|
TitledBorder(javax.swing.border.Border border,
java.lang.String title,
int titleJustification,
int titlePosition,
java.awt.Font titleFont)
Creates a TitledBorder instance with the specified border, title, title-justification, title-position, and title-font. |
|
TitledBorder(javax.swing.border.Border border,
java.lang.String title,
int titleJustification,
int titlePosition,
java.awt.Font titleFont,
java.awt.Color titleColor)
Creates a TitledBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color. |
|
TitledBorder(java.lang.String title)
Creates a TitledBorder instance. |
Method Summary | |
---|---|
javax.swing.border.Border |
getBorder()
Returns the border of the titled border. |
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. |
java.awt.Dimension |
getMinimumSize(java.awt.Component c)
Returns the minimum dimensions this border requires in order to fully display the border and title. |
java.lang.String |
getTitle()
Returns the title of the titled border. |
java.awt.Color |
getTitleColor()
Returns the title-color of the titled border. |
java.awt.Font |
getTitleFont()
Returns the title-font of the titled border. |
int |
getTitleJustification()
Returns the title-justification of the titled border. |
int |
getTitlePosition()
Returns the title-position of the titled border. |
boolean |
isBorderOpaque()
Returns whether or not the border is opaque. |
boolean |
isInTitelBox(java.awt.Point p)
Returns true if the point is in the titel check box rectangle which contains the text. |
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 |
setBorder(javax.swing.border.Border border)
Sets the border of the titled border. |
void |
setCaptionIndent(float indent)
|
void |
setTitle(java.lang.String title)
Sets the title of the titled border. |
void |
setTitleColor(java.awt.Color titleColor)
Sets the title-color of the titled border. |
void |
setTitleFont(java.awt.Font titleFont)
Sets the title-font of the titled border. |
void |
setTitleJustification(int titleJustification)
Sets the title-justification of the titled border. |
void |
setTitlePosition(int titlePosition)
Sets the title-position of the titled border. |
Methods inherited from class javax.swing.border.AbstractBorder |
---|
getInteriorRectangle, getInteriorRectangle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_POSITION
public static final int ABOVE_TOP
public static final int TOP
public static final int BELOW_TOP
public static final int ABOVE_BOTTOM
public static final int BOTTOM
public static final int BELOW_BOTTOM
public static final int DEFAULT_JUSTIFICATION
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int LEADING
public static final int TRAILING
Constructor Detail |
---|
public TitledBorder(java.lang.String title)
title
- the title the border should displaypublic TitledBorder(javax.swing.border.Border border)
border
- the borderpublic TitledBorder(javax.swing.border.Border border, java.lang.String title)
border
- the bordertitle
- the title the border should displaypublic TitledBorder(javax.swing.border.Border border, java.lang.String title, int titleJustification, int titlePosition)
border
- the bordertitle
- the title the border should displaytitleJustification
- the justification for the titletitlePosition
- the position for the titlepublic TitledBorder(javax.swing.border.Border border, java.lang.String title, int titleJustification, int titlePosition, java.awt.Font titleFont)
border
- the bordertitle
- the title the border should displaytitleJustification
- the justification for the titletitlePosition
- the position for the titletitleFont
- the font for rendering the titlepublic TitledBorder(javax.swing.border.Border border, java.lang.String title, int titleJustification, int titlePosition, java.awt.Font titleFont, java.awt.Color titleColor)
border
- the bordertitle
- the title the border should displaytitleJustification
- the justification for the titletitlePosition
- the position for the titletitleFont
- the font of the titletitleColor
- the color of the titleMethod Detail |
---|
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
paintBorder
in interface javax.swing.border.Border
paintBorder
in class javax.swing.border.AbstractBorder
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 borderpublic java.awt.Insets getBorderInsets(java.awt.Component c)
getBorderInsets
in interface javax.swing.border.Border
getBorderInsets
in class javax.swing.border.AbstractBorder
c
- the component for which this border insets value appliespublic java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
getBorderInsets
in class javax.swing.border.AbstractBorder
c
- the component for which this border insets value appliesinsets
- the object to be reinitializedpublic boolean isBorderOpaque()
isBorderOpaque
in interface javax.swing.border.Border
isBorderOpaque
in class javax.swing.border.AbstractBorder
public java.lang.String getTitle()
public void setCaptionIndent(float indent)
public javax.swing.border.Border getBorder()
public int getTitlePosition()
public int getTitleJustification()
public java.awt.Font getTitleFont()
public java.awt.Color getTitleColor()
public void setTitle(java.lang.String title)
public void setBorder(javax.swing.border.Border border)
border
- the borderpublic void setTitlePosition(int titlePosition)
titlePosition
- the position for the borderpublic void setTitleJustification(int titleJustification)
titleJustification
- the justification for the borderpublic void setTitleFont(java.awt.Font titleFont)
titleFont
- the font for the border titlepublic void setTitleColor(java.awt.Color titleColor)
titleColor
- the color for the border titlepublic java.awt.Dimension getMinimumSize(java.awt.Component c)
c
- the component where this border will be drawnpublic boolean isInTitelBox(java.awt.Point p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |