javax.swing.plaf
Class BorderUIResource.BevelBorderUIResource

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

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

A BevelBorder 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.BevelBorder
bevelType, highlightInner, highlightOuter, LOWERED, RAISED, shadowInner, shadowOuter
 
Constructor Summary
BorderUIResource.BevelBorderUIResource(int bevelType)
          Constructs a BevelBorderUIResource whose colors will be derived from the background of the enclosed component.
BorderUIResource.BevelBorderUIResource(int bevelType, Color highlight, Color shadow)
          Constructs a BevelBorderUIResource given its appearance type and two colors for its highlight and shadow.
BorderUIResource.BevelBorderUIResource(int bevelType, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
          Constructs a BevelBorderUIResource given its appearance type and all its colors.
 
Method Summary
 
Methods inherited from class javax.swing.border.BevelBorder
getBevelType, getBorderInsets, getBorderInsets, getHighlightInnerColor, getHighlightInnerColor, getHighlightOuterColor, getHighlightOuterColor, getShadowInnerColor, getShadowInnerColor, getShadowOuterColor, getShadowOuterColor, isBorderOpaque, paintBorder, paintLoweredBevel, paintRaisedBevel
 
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.BevelBorderUIResource

public BorderUIResource.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 BevelBorder.RAISED or BevelBorder.LOWERED.
Throws:
IllegalArgumentException - if bevelType has an unsupported value.

BorderUIResource.BevelBorderUIResource

public BorderUIResource.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 BevelBorder.RAISED or BevelBorder.LOWERED.
highlight - the color that will be used for the inner side of the highlighted edges (top and left if if bevelType is 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 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.

BorderUIResource.BevelBorderUIResource

public BorderUIResource.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 BevelBorder.RAISED or BevelBorder.LOWERED.
highlightOuter - the color that will be used for the outer side of the highlighted edges (top and left if bevelType is 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 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.