Class BorderUIResource.TitledBorderUIResource
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.TitledBorder
javax.swing.plaf.BorderUIResource.TitledBorderUIResource
- All Implemented Interfaces:
Serializable, Border, UIResource
- Enclosing class:
BorderUIResource
public static class BorderUIResource.TitledBorderUIResource
extends TitledBorder
implements UIResource
A titled border UI resource.
-
Field Summary
Fields declared in class TitledBorder
ABOVE_BOTTOM, ABOVE_TOP, BELOW_BOTTOM, BELOW_TOP, border, BOTTOM, CENTER, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, EDGE_SPACING, LEADING, LEFT, RIGHT, TEXT_INSET_H, TEXT_SPACING, title, titleColor, titleFont, titleJustification, titlePosition, TOP, TRAILING
Modifier and TypeFieldDescriptionstatic final int
Position the title above the border's bottom line.static final int
Position the title above the border's top line.static final int
Position the title below the border's bottom line.static final int
Position the title below the border's top line.protected Border
The border.static final int
Position the title in the middle of the border's bottom line.static final int
Position title text in the center of the border line.static final int
Use the default justification for the title text.static final int
Use the default vertical orientation for the title text.protected static final int
Space between the border and the component's edgestatic final int
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 final int
Position title text at the left side of the border line.static final int
Position title text at the right side of the border line.protected static final int
Horizontal inset of text that is left or right justifiedprotected static final int
Space between the border and textprotected String
The title the border should display.protected Color
The color of the title.protected Font
The font for rendering the title.protected int
The justification for the title.protected int
The position for the title.static final int
Position the title in the middle of the border's top line.static final int
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
ConstructorsConstructorDescriptionTitledBorderUIResource
(String title) Constructs aTitledBorderUIResource
.TitledBorderUIResource
(Border border) Constructs aTitledBorderUIResource
.TitledBorderUIResource
(Border border, String title) Constructs aTitledBorderUIResource
.TitledBorderUIResource
(Border border, String title, int titleJustification, int titlePosition) Constructs aTitledBorderUIResource
.TitledBorderUIResource
(Border border, String title, int titleJustification, int titlePosition, Font titleFont) Constructs aTitledBorderUIResource
.TitledBorderUIResource
(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) Constructs aTitledBorderUIResource
. -
Method Summary
Methods declared in class TitledBorder
getBaseline, getBaselineResizeBehavior, getBorder, getBorderInsets, getFont, getMinimumSize, getTitle, getTitleColor, getTitleFont, getTitleJustification, getTitlePosition, isBorderOpaque, paintBorder, setBorder, setTitle, setTitleColor, setTitleFont, setTitleJustification, setTitlePosition
Modifier and TypeMethodDescriptionint
getBaseline
(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.getBorderInsets
(Component c, Insets insets) Reinitialize the insets parameter with this Border's current Insets.protected Font
Returns default font of the titled border.Returns 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.int
Returns the title-justification of the titled border.int
Returns the title-position of the titled border.boolean
Returns whether or not the border is opaque.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
Sets the border of the titled border.void
Sets the title of the titled border.void
setTitleColor
(Color titleColor) Sets the title-color of the titled border.void
setTitleFont
(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 declared in class AbstractBorder
getBorderInsets, getInteriorRectangle, getInteriorRectangle
Modifier and TypeMethodDescriptionThis default implementation returns a newInsets
object that is initialized by theAbstractBorder.getBorderInsets(Component,Insets)
method.getInteriorRectangle
(Component c, int x, int y, int width, int height) This convenience method calls the static method.static Rectangle
getInteriorRectangle
(Component c, Border b, int x, int y, int width, int height) Returns a rectangle using the arguments minus the insets of the border.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
TitledBorderUIResource
Constructs aTitledBorderUIResource
.- Parameters:
title
- the title the border should display
-
TitledBorderUIResource
Constructs aTitledBorderUIResource
.- Parameters:
border
- the border
-
TitledBorderUIResource
-
TitledBorderUIResource
public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition) Constructs aTitledBorderUIResource
.- Parameters:
border
- the bordertitle
- the title the border should displaytitleJustification
- the justification for the titletitlePosition
- the position for the title
-
TitledBorderUIResource
public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont) Constructs aTitledBorderUIResource
.- 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
-
TitledBorderUIResource
@ConstructorProperties({"border","title","titleJustification","titlePosition","titleFont","titleColor"}) public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) Constructs aTitledBorderUIResource
.- 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 titletitleColor
- the color of the title
-