Package com.jidesoft.swing
Class JideTitledBorder
java.lang.Object
javax.swing.border.AbstractBorder
com.jidesoft.swing.JideTitledBorder
- All Implemented Interfaces:
Serializable,Border
The source code is the same as TitledBorder in JDK 1.4.2 except field TEXT_INSET_H is 0 instead of 5.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPosition the title above the border's bottom line.static final intPosition the title above the border's top line.static final intPosition the title below the border's bottom line.static final intPosition the title below the border's top line.protected Borderstatic final intPosition the title in the middle of the border's bottom line.static final intPosition title text in the center of the border line.static final intUse the default justification for the title text.static final intUse the default vertical orientation for the title text.protected static final intstatic final intPosition 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 final intPosition title text at the left side of the border line.static final intPosition title text at the right side of the border line.protected static final intprotected static final intprotected Stringprotected Colorprotected Fontprotected intprotected intstatic final intPosition the title in the middle of the border's top line.static final intPosition 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
ConstructorsConstructorDescriptionJideTitledBorder(String title) Creates a JideTitledBorder instance.JideTitledBorder(Border border) Creates a JideTitledBorder instance with the specified border and an empty title.JideTitledBorder(Border border, String title) Creates a JideTitledBorder instance with the specified border and title.JideTitledBorder(Border border, String title, int titleJustification, int titlePosition) Creates a JideTitledBorder instance with the specified border, title, title-justification, and title-position.JideTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont) Creates a JideTitledBorder instance with the specified border, title, title-justification, title-position, and title-font.JideTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) Creates a JideTitledBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color. -
Method Summary
Modifier and TypeMethodDescriptionintgetBaseline(Component c, int width, int height) Returns the baseline.Returns an enum indicating how the baseline of the border changes as the size changes.Returns the border of the titled border.This default implementation returns a newInsetsinstance where thetop,left,bottom, andrightfields are set to0.getBorderInsets(Component c, Insets insets) Reinitialize the insets parameter with this Border's current Insets.protected FontReturns the minimum dimensions this border requires in order to fully display the border and title.getTitle()Returns the title of the titled border.Returns the title-color of the titled border.Returns the title-font of the titled border.intReturns the title-justification of the titled border.intReturns the title-position of the titled border.booleanReturns whether or not the border is opaque.voidpaintBorder(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.voidSets the border of the titled border.voidSets the title of the titled border.voidsetTitleColor(Color titleColor) Sets the title-color of the titled border.voidsetTitleFont(Font titleFont) Sets the title-font of the titled border.voidsetTitleJustification(int titleJustification) Sets the title-justification of the titled border.voidsetTitlePosition(int titlePosition) Sets the title-position of the titled border.Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle
-
Field Details
-
title
-
border
-
titlePosition
protected int titlePosition -
titleJustification
protected int titleJustification -
titleFont
-
titleColor
-
DEFAULT_POSITION
public static final int DEFAULT_POSITIONUse the default vertical orientation for the title text.- See Also:
-
ABOVE_TOP
public static final int ABOVE_TOPPosition the title above the border's top line.- See Also:
-
TOP
public static final int TOPPosition the title in the middle of the border's top line.- See Also:
-
BELOW_TOP
public static final int BELOW_TOPPosition the title below the border's top line.- See Also:
-
ABOVE_BOTTOM
public static final int ABOVE_BOTTOMPosition the title above the border's bottom line.- See Also:
-
BOTTOM
public static final int BOTTOMPosition the title in the middle of the border's bottom line.- See Also:
-
BELOW_BOTTOM
public static final int BELOW_BOTTOMPosition the title below the border's bottom line.- See Also:
-
DEFAULT_JUSTIFICATION
public static final int DEFAULT_JUSTIFICATIONUse the default justification for the title text.- See Also:
-
LEFT
public static final int LEFTPosition title text at the left side of the border line.- See Also:
-
CENTER
public static final int CENTERPosition title text in the center of the border line.- See Also:
-
RIGHT
public static final int RIGHTPosition title text at the right side of the border line.- See Also:
-
LEADING
public static final int LEADINGPosition 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.- See Also:
-
TRAILING
public static final int TRAILINGPosition 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.- See Also:
-
EDGE_SPACING
protected static final int EDGE_SPACING- See Also:
-
TEXT_SPACING
protected static final int TEXT_SPACING- See Also:
-
TEXT_INSET_H
protected static final int TEXT_INSET_H- See Also:
-
-
Constructor Details
-
JideTitledBorder
Creates a JideTitledBorder instance.- Parameters:
title- the title the border should display
-
JideTitledBorder
Creates a JideTitledBorder instance with the specified border and an empty title.- Parameters:
border- the border
-
JideTitledBorder
Creates a JideTitledBorder instance with the specified border and title.- Parameters:
border- the bordertitle- the title the border should display
-
JideTitledBorder
Creates a JideTitledBorder instance with the specified border, title, title-justification, and title-position.- Parameters:
border- the bordertitle- the title the border should displaytitleJustification- the justification for the titletitlePosition- the position for the title
-
JideTitledBorder
public JideTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont) Creates a JideTitledBorder instance with the specified border, title, title-justification, title-position, and title-font.- Parameters:
border- the bordertitle- the title the border should displaytitleJustification- the justification for the titletitlePosition- the position for the titletitleFont- the font for rendering the title
-
JideTitledBorder
@ConstructorProperties({"border","title","titleJustification","titlePosition","titleFont","titleColor"}) public JideTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) Creates a JideTitledBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color.- Parameters:
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 title
-
-
Method Details
-
paintBorder
Paints the border for the specified component with the specified position and size.- 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
-
getBorderInsets
This default implementation returns a newInsetsinstance where thetop,left,bottom, andrightfields are set to0.- Specified by:
getBorderInsetsin interfaceBorder- Overrides:
getBorderInsetsin classAbstractBorder- Parameters:
c- the component for which this border insets value applies- Returns:
- the new
Insetsobject initialized to 0
-
getBorderInsets
Reinitialize the insets parameter with this Border's current Insets.- Overrides:
getBorderInsetsin classAbstractBorder- Parameters:
c- the component for which this border insets value appliesinsets- the object to be reinitialized
-
isBorderOpaque
public boolean isBorderOpaque()Returns whether or not the border is opaque.- Specified by:
isBorderOpaquein interfaceBorder- Overrides:
isBorderOpaquein classAbstractBorder
-
getTitle
Returns the title of the titled border. -
getBorder
Returns the border of the titled border. -
getTitlePosition
public int getTitlePosition()Returns the title-position of the titled border. -
getTitleJustification
public int getTitleJustification()Returns the title-justification of the titled border. -
getTitleFont
Returns the title-font of the titled border. -
getTitleColor
Returns the title-color of the titled border. -
setTitle
Sets the title of the titled border. param title the title for the border -
setBorder
Sets the border of the titled border.- Parameters:
border- the border
-
setTitlePosition
public void setTitlePosition(int titlePosition) Sets the title-position of the titled border.- Parameters:
titlePosition- the position for the border
-
setTitleJustification
public void setTitleJustification(int titleJustification) Sets the title-justification of the titled border.- Parameters:
titleJustification- the justification for the border
-
setTitleFont
Sets the title-font of the titled border.- Parameters:
titleFont- the font for the border title
-
setTitleColor
Sets the title-color of the titled border.- Parameters:
titleColor- the color for the border title
-
getMinimumSize
Returns the minimum dimensions this border requires in order to fully display the border and title.- Parameters:
c- the component where this border will be drawn
-
getBaseline
Returns the baseline.- Overrides:
getBaselinein classAbstractBorder- Since:
- 1.6
- See Also:
-
getBaselineResizeBehavior
Returns an enum indicating how the baseline of the border changes as the size changes.- Overrides:
getBaselineResizeBehaviorin classAbstractBorder- Since:
- 1.6
- See Also:
-
getFont
-