javax.swing.plaf
Class BorderUIResource.TitledBorderUIResource

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by javax.swing.border.TitledBorder
          extended by javax.swing.plaf.BorderUIResource.TitledBorderUIResource
All Implemented Interfaces:
Serializable, Border, UIResource
Enclosing class:
BorderUIResource

public static class BorderUIResource.TitledBorderUIResource
extends TitledBorder
implements UIResource, Serializable

A TitledBorder that also implements the UIResource marker interface. This is useful for implementing pluggable look-and-feels: When switching the current LookAndFeel, only those borders are replaced that are marked as UIResource. For this reason, a look-and-feel should always install borders that implement UIResource, such as the borders provided by this class.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.border.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
 
Constructor Summary
BorderUIResource.TitledBorderUIResource(Border border)
          Constructs an initially untitled TitledBorderUIResource given another border.
BorderUIResource.TitledBorderUIResource(Border border, String title)
          Constructs a TitledBorder given its border and title text.
BorderUIResource.TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition)
          Constructs a TitledBorderUIResource given its border, title text, horizontal alignment, and vertical position.
BorderUIResource.TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
          Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, and font.
BorderUIResource.TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
          Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, font, and color.
BorderUIResource.TitledBorderUIResource(String title)
          Constructs a TitledBorderUIResource given the text of its title.
 
Method Summary
 
Methods inherited from class javax.swing.border.TitledBorder
getBorder, getBorderInsets, getBorderInsets, getFont, getMinimumSize, getTitle, getTitleColor, getTitleFont, getTitleJustification, getTitlePosition, isBorderOpaque, paintBorder, setBorder, setTitle, setTitleColor, setTitleFont, setTitleJustification, setTitlePosition
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderUIResource.TitledBorderUIResource

public BorderUIResource.TitledBorderUIResource(String title)
Constructs a TitledBorderUIResource given the text of its title.

Parameters:
title - the title text, or null to use no title text.

BorderUIResource.TitledBorderUIResource

public BorderUIResource.TitledBorderUIResource(Border border)
Constructs an initially untitled TitledBorderUIResource given another border.

Parameters:
border - the border underneath the title, or null to use a default from the current look and feel.

BorderUIResource.TitledBorderUIResource

public BorderUIResource.TitledBorderUIResource(Border border,
                                               String title)
Constructs a TitledBorder given its border and title text.

Parameters:
border - the border underneath the title, or null to use a default from the current look and feel.
title - the title text, or null to use no title text.

BorderUIResource.TitledBorderUIResource

public BorderUIResource.TitledBorderUIResource(Border border,
                                               String title,
                                               int titleJustification,
                                               int titlePosition)
Constructs a TitledBorderUIResource given its border, title text, horizontal alignment, and vertical position.

Parameters:
border - the border underneath the title, or null to use a default from the current look and feel.
title - the title text, or null to use no title text.
titleJustification - the horizontal alignment of the title text in relation to the border. The value must be one of TitledBorder.LEFT, TitledBorder.CENTER, TitledBorder.RIGHT, TitledBorder.LEADING, TitledBorder.TRAILING, or TitledBorder.DEFAULT_JUSTIFICATION.
titlePosition - the vertical position of the title text in relation to the border. The value must be one of TitledBorder.ABOVE_TOP, TitledBorder.TOP, TitledBorder.BELOW_TOP, TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM, TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION.
Throws:
IllegalArgumentException - if titleJustification or titlePosition have an unsupported value.

BorderUIResource.TitledBorderUIResource

public BorderUIResource.TitledBorderUIResource(Border border,
                                               String title,
                                               int titleJustification,
                                               int titlePosition,
                                               Font titleFont)
Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, and font.

Parameters:
border - the border underneath the title, or null to use a default from the current look and feel.
title - the title text, or null to use no title text.
titleJustification - the horizontal alignment of the title text in relation to the border. The value must be one of TitledBorder.LEFT, TitledBorder.CENTER, TitledBorder.RIGHT, TitledBorder.LEADING, TitledBorder.TRAILING, or TitledBorder.DEFAULT_JUSTIFICATION.
titlePosition - the vertical position of the title text in relation to the border. The value must be one of TitledBorder.ABOVE_TOP, TitledBorder.TOP, TitledBorder.BELOW_TOP, TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM, TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION.
titleFont - the font for the title text, or null to use a default from the current look and feel.
Throws:
IllegalArgumentException - if titleJustification or titlePosition have an unsupported value.

BorderUIResource.TitledBorderUIResource

public BorderUIResource.TitledBorderUIResource(Border border,
                                               String title,
                                               int titleJustification,
                                               int titlePosition,
                                               Font titleFont,
                                               Color titleColor)
Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, font, and color.

Parameters:
border - the border underneath the title, or null to use a default from the current look and feel.
title - the title text, or null to use no title text.
titleJustification - the horizontal alignment of the title text in relation to the border. The value must be one of TitledBorder.LEFT, TitledBorder.CENTER, TitledBorder.RIGHT, TitledBorder.LEADING, TitledBorder.TRAILING, or TitledBorder.DEFAULT_JUSTIFICATION.
titlePosition - the vertical position of the title text in relation to the border. The value must be one of TitledBorder.ABOVE_TOP, TitledBorder.TOP, TitledBorder.BELOW_TOP, TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM, TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION.
titleFont - the font for the title text, or null to use a default from the current look and feel.
titleColor - the color for the title text, or null to use a default from the current look and feel.
Throws:
IllegalArgumentException - if titleJustification or titlePosition have an unsupported value.