javax.swing.plaf

Class BorderUIResource.BevelBorderUIResource

public static class BorderUIResource.BevelBorderUIResource extends BevelBorder implements UIResource, Serializable

A {@link javax.swing.border.BevelBorder} that also implements the {@link 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 {@link UIResource}. For this reason, a look-and-feel should always install borders that implement UIResource, such as the borders provided by this class.
Constructor Summary
BevelBorderUIResource(int bevelType)
Constructs a BevelBorderUIResource whose colors will be derived from the background of the enclosed component.
BevelBorderUIResource(int bevelType, Color highlight, Color shadow)
Constructs a BevelBorderUIResource given its appearance type and two colors for its highlight and shadow.
BevelBorderUIResource(int bevelType, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
Constructs a BevelBorderUIResource given its appearance type and all its colors.

Constructor Detail

BevelBorderUIResource

public BevelBorderUIResource(int bevelType)
Constructs a BevelBorderUIResource whose colors will be derived from the background of the enclosed component. The background color is retrieved each time the border is painted, so a border constructed by this method will automatically reflect a change to the component’s background color.

[An illustration showing raised and lowered BevelBorders]

Parameters: bevelType the desired appearance of the border. The value must be either {@link javax.swing.border.BevelBorder#RAISED} or {@link javax.swing.border.BevelBorder#LOWERED}.

Throws: IllegalArgumentException if bevelType has an unsupported value.

BevelBorderUIResource

public BevelBorderUIResource(int bevelType, Color highlight, Color shadow)
Constructs a BevelBorderUIResource given its appearance type and two colors for its highlight and shadow.

[An illustration showing BevelBorders that were
 constructed with this method]

Parameters: bevelType the desired appearance of the border. The value must be either {@link javax.swing.border.BevelBorder#RAISED} or {@link javax.swing.border.BevelBorder#LOWERED}. highlight the color that will be used for the inner side of the highlighted edges (top and left if if bevelType is {@link javax.swing.border.BevelBorder#RAISED}; bottom and right otherwise). The color for the outer side is a brightened version of this color. shadow the color that will be used for the outer side of the shadowed edges (bottom and right if bevelType is {@link javax.swing.border.BevelBorder#RAISED}; top and left otherwise). The color for the inner side is a brightened version of this color.

Throws: IllegalArgumentException if bevelType has an unsupported value. NullPointerException if highlight or shadow is null.

BevelBorderUIResource

public BevelBorderUIResource(int bevelType, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
Constructs a BevelBorderUIResource given its appearance type and all its colors.

[An illustration showing BevelBorders that
 were constructed with this method]

Parameters: bevelType the desired appearance of the border. The value must be either {@link javax.swing.border.BevelBorder#RAISED} or {@link javax.swing.border.BevelBorder#LOWERED}. highlightOuter the color that will be used for the outer side of the highlighted edges (top and left if bevelType is {@link javax.swing.border.BevelBorder#RAISED}; bottom and right otherwise). highlightInner the color that will be used for the inner side of the highlighted edges. shadowOuter the color that will be used for the outer side of the shadowed edges (bottom and right if bevelType is {@link javax.swing.border.BevelBorder#RAISED}; top and left otherwise). shadowInner the color that will be used for the inner side of the shadowed edges.

Throws: IllegalArgumentException if bevelType has an unsupported value. NullPointerException if one of the passed colors is null.