javax.swing.border
Class BevelBorder

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.border.AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder 
      extended by javax.swing.border.BevelBorder
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Direct Known Subclasses:
BorderUIResource.BevelBorderUIResource sample code for javax.swing.plaf.BorderUIResource.BevelBorderUIResource definition code for javax.swing.plaf.BorderUIResource.BevelBorderUIResource , SoftBevelBorder sample code for javax.swing.border.SoftBevelBorder definition code for javax.swing.border.SoftBevelBorder

public class BevelBorder
extends AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder

A class which implements a simple two-line bevel border.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Serialized Form

Field Summary
protected  int bevelType sample code for javax.swing.border.BevelBorder.bevelType definition code for javax.swing.border.BevelBorder.bevelType
           
protected  Color sample code for java.awt.Color definition code for java.awt.Color highlightInner sample code for javax.swing.border.BevelBorder.highlightInner definition code for javax.swing.border.BevelBorder.highlightInner
           
protected  Color sample code for java.awt.Color definition code for java.awt.Color highlightOuter sample code for javax.swing.border.BevelBorder.highlightOuter definition code for javax.swing.border.BevelBorder.highlightOuter
           
static int LOWERED sample code for javax.swing.border.BevelBorder.LOWERED definition code for javax.swing.border.BevelBorder.LOWERED
          Lowered bevel type.
static int RAISED sample code for javax.swing.border.BevelBorder.RAISED definition code for javax.swing.border.BevelBorder.RAISED
          Raised bevel type.
protected  Color sample code for java.awt.Color definition code for java.awt.Color shadowInner sample code for javax.swing.border.BevelBorder.shadowInner definition code for javax.swing.border.BevelBorder.shadowInner
           
protected  Color sample code for java.awt.Color definition code for java.awt.Color shadowOuter sample code for javax.swing.border.BevelBorder.shadowOuter definition code for javax.swing.border.BevelBorder.shadowOuter
           
 
Constructor Summary
BevelBorder sample code for javax.swing.border.BevelBorder.BevelBorder(int) definition code for javax.swing.border.BevelBorder.BevelBorder(int) (int bevelType)
          Creates a bevel border with the specified type and whose colors will be derived from the background color of the component passed into the paintBorder method.
BevelBorder sample code for javax.swing.border.BevelBorder.BevelBorder(int, java.awt.Color, java.awt.Color) definition code for javax.swing.border.BevelBorder.BevelBorder(int, java.awt.Color, java.awt.Color) (int bevelType, Color sample code for java.awt.Color definition code for java.awt.Color  highlight, Color sample code for java.awt.Color definition code for java.awt.Color  shadow)
          Creates a bevel border with the specified type, highlight and shadow colors.
BevelBorder sample code for javax.swing.border.BevelBorder.BevelBorder(int, java.awt.Color, java.awt.Color, java.awt.Color, java.awt.Color) definition code for javax.swing.border.BevelBorder.BevelBorder(int, java.awt.Color, java.awt.Color, java.awt.Color, java.awt.Color) (int bevelType, Color sample code for java.awt.Color definition code for java.awt.Color  highlightOuterColor, Color sample code for java.awt.Color definition code for java.awt.Color  highlightInnerColor, Color sample code for java.awt.Color definition code for java.awt.Color  shadowOuterColor, Color sample code for java.awt.Color definition code for java.awt.Color  shadowInnerColor)
          Creates a bevel border with the specified type, highlight and shadow colors.
 
Method Summary
 int getBevelType sample code for javax.swing.border.BevelBorder.getBevelType() definition code for javax.swing.border.BevelBorder.getBevelType() ()
          Returns the type of the bevel border.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getBorderInsets sample code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component) definition code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns the insets of the border.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getBorderInsets sample code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component, java.awt.Insets) definition code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component, java.awt.Insets) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
          Reinitialize the insets parameter with this Border's current Insets.
 Color sample code for java.awt.Color definition code for java.awt.Color getHighlightInnerColor sample code for javax.swing.border.BevelBorder.getHighlightInnerColor() definition code for javax.swing.border.BevelBorder.getHighlightInnerColor() ()
          Returns the inner highlight color of the bevel border.
 Color sample code for java.awt.Color definition code for java.awt.Color getHighlightInnerColor sample code for javax.swing.border.BevelBorder.getHighlightInnerColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getHighlightInnerColor(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns the inner highlight color of the bevel border when rendered on the specified component.
 Color sample code for java.awt.Color definition code for java.awt.Color getHighlightOuterColor sample code for javax.swing.border.BevelBorder.getHighlightOuterColor() definition code for javax.swing.border.BevelBorder.getHighlightOuterColor() ()
          Returns the outer highlight color of the bevel border.
 Color sample code for java.awt.Color definition code for java.awt.Color getHighlightOuterColor sample code for javax.swing.border.BevelBorder.getHighlightOuterColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getHighlightOuterColor(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns the outer highlight color of the bevel border when rendered on the specified component.
 Color sample code for java.awt.Color definition code for java.awt.Color getShadowInnerColor sample code for javax.swing.border.BevelBorder.getShadowInnerColor() definition code for javax.swing.border.BevelBorder.getShadowInnerColor() ()
          Returns the inner shadow color of the bevel border.
 Color sample code for java.awt.Color definition code for java.awt.Color getShadowInnerColor sample code for javax.swing.border.BevelBorder.getShadowInnerColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getShadowInnerColor(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns the inner shadow color of the bevel border when rendered on the specified component.
 Color sample code for java.awt.Color definition code for java.awt.Color getShadowOuterColor sample code for javax.swing.border.BevelBorder.getShadowOuterColor() definition code for javax.swing.border.BevelBorder.getShadowOuterColor() ()
          Returns the outer shadow color of the bevel border.
 Color sample code for java.awt.Color definition code for java.awt.Color getShadowOuterColor sample code for javax.swing.border.BevelBorder.getShadowOuterColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getShadowOuterColor(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns the outer shadow color of the bevel border when rendered on the specified component.
 boolean isBorderOpaque sample code for javax.swing.border.BevelBorder.isBorderOpaque() definition code for javax.swing.border.BevelBorder.isBorderOpaque() ()
          Returns whether or not the border is opaque.
 void paintBorder sample code for javax.swing.border.BevelBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.BevelBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
protected  void paintLoweredBevel sample code for javax.swing.border.BevelBorder.paintLoweredBevel(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.BevelBorder.paintLoweredBevel(java.awt.Component, java.awt.Graphics, int, int, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, int x, int y, int width, int height)
           
protected  void paintRaisedBevel sample code for javax.swing.border.BevelBorder.paintRaisedBevel(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.BevelBorder.paintRaisedBevel(java.awt.Component, java.awt.Graphics, int, int, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, int x, int y, int width, int height)
           
 
Methods inherited from class javax.swing.border.AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder
getInteriorRectangle sample code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, javax.swing.border.Border, int, int, int, int) definition code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, javax.swing.border.Border, int, int, int, int) , getInteriorRectangle sample code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, int, int, int, int) definition code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, int, int, int, int)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

RAISED sample code for javax.swing.border.BevelBorder.RAISED

public static final int RAISED
Raised bevel type.

See Also:
Constant Field Values

LOWERED sample code for javax.swing.border.BevelBorder.LOWERED

public static final int LOWERED
Lowered bevel type.

See Also:
Constant Field Values

bevelType sample code for javax.swing.border.BevelBorder.bevelType

protected int bevelType

highlightOuter sample code for javax.swing.border.BevelBorder.highlightOuter

protected Color sample code for java.awt.Color definition code for java.awt.Color  highlightOuter

highlightInner sample code for javax.swing.border.BevelBorder.highlightInner

protected Color sample code for java.awt.Color definition code for java.awt.Color  highlightInner

shadowInner sample code for javax.swing.border.BevelBorder.shadowInner

protected Color sample code for java.awt.Color definition code for java.awt.Color  shadowInner

shadowOuter sample code for javax.swing.border.BevelBorder.shadowOuter

protected Color sample code for java.awt.Color definition code for java.awt.Color  shadowOuter
Constructor Detail

BevelBorder sample code for javax.swing.border.BevelBorder(int) definition code for javax.swing.border.BevelBorder(int)

public BevelBorder(int bevelType)
Creates a bevel border with the specified type and whose colors will be derived from the background color of the component passed into the paintBorder method.

Parameters:
bevelType - the type of bevel for the border

BevelBorder sample code for javax.swing.border.BevelBorder(int, java.awt.Color, java.awt.Color) definition code for javax.swing.border.BevelBorder(int, java.awt.Color, java.awt.Color)

public BevelBorder(int bevelType,
                   Color sample code for java.awt.Color definition code for java.awt.Color  highlight,
                   Color sample code for java.awt.Color definition code for java.awt.Color  shadow)
Creates a bevel border with the specified type, highlight and shadow colors.

Parameters:
bevelType - the type of bevel for the border
highlight - the color to use for the bevel highlight
shadow - the color to use for the bevel shadow

BevelBorder sample code for javax.swing.border.BevelBorder(int, java.awt.Color, java.awt.Color, java.awt.Color, java.awt.Color) definition code for javax.swing.border.BevelBorder(int, java.awt.Color, java.awt.Color, java.awt.Color, java.awt.Color)

public BevelBorder(int bevelType,
                   Color sample code for java.awt.Color definition code for java.awt.Color  highlightOuterColor,
                   Color sample code for java.awt.Color definition code for java.awt.Color  highlightInnerColor,
                   Color sample code for java.awt.Color definition code for java.awt.Color  shadowOuterColor,
                   Color sample code for java.awt.Color definition code for java.awt.Color  shadowInnerColor)
Creates a bevel border with the specified type, highlight and shadow colors.

Note: The shadow inner and outer colors are switched for a lowered bevel border.

Parameters:
bevelType - the type of bevel for the border
highlightOuterColor - the color to use for the bevel outer highlight
highlightInnerColor - the color to use for the bevel inner highlight
shadowOuterColor - the color to use for the bevel outer shadow
shadowInnerColor - the color to use for the bevel inner shadow
Method Detail

paintBorder sample code for javax.swing.border.BevelBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.BevelBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int)

public void paintBorder(Component sample code for java.awt.Component definition code for java.awt.Component  c,
                        Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border for the specified component with the specified position and size.

Specified by:
paintBorder sample code for javax.swing.border.Border.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.Border.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) in interface Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Overrides:
paintBorder sample code for javax.swing.border.AbstractBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.AbstractBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) in class AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder
Parameters:
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border

getBorderInsets sample code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component) definition code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component)

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getBorderInsets(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns the insets of the border.

Specified by:
getBorderInsets sample code for javax.swing.border.Border.getBorderInsets(java.awt.Component) definition code for javax.swing.border.Border.getBorderInsets(java.awt.Component) in interface Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Overrides:
getBorderInsets sample code for javax.swing.border.AbstractBorder.getBorderInsets(java.awt.Component) definition code for javax.swing.border.AbstractBorder.getBorderInsets(java.awt.Component) in class AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder
Parameters:
c - the component for which this border insets value applies
Returns:
the new Insets object initialized to 0

getBorderInsets sample code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component, java.awt.Insets) definition code for javax.swing.border.BevelBorder.getBorderInsets(java.awt.Component, java.awt.Insets)

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getBorderInsets(Component sample code for java.awt.Component definition code for java.awt.Component  c,
                              Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
Reinitialize the insets parameter with this Border's current Insets.

Overrides:
getBorderInsets sample code for javax.swing.border.AbstractBorder.getBorderInsets(java.awt.Component, java.awt.Insets) definition code for javax.swing.border.AbstractBorder.getBorderInsets(java.awt.Component, java.awt.Insets) in class AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder
Parameters:
c - the component for which this border insets value applies
insets - the object to be reinitialized
Returns:
the insets object

getHighlightOuterColor sample code for javax.swing.border.BevelBorder.getHighlightOuterColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getHighlightOuterColor(java.awt.Component)

public Color sample code for java.awt.Color definition code for java.awt.Color  getHighlightOuterColor(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns the outer highlight color of the bevel border when rendered on the specified component. If no highlight color was specified at instantiation, the highlight color is derived from the specified component's background color.

Parameters:
c - the component for which the highlight may be derived

getHighlightInnerColor sample code for javax.swing.border.BevelBorder.getHighlightInnerColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getHighlightInnerColor(java.awt.Component)

public Color sample code for java.awt.Color definition code for java.awt.Color  getHighlightInnerColor(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns the inner highlight color of the bevel border when rendered on the specified component. If no highlight color was specified at instantiation, the highlight color is derived from the specified component's background color.

Parameters:
c - the component for which the highlight may be derived

getShadowInnerColor sample code for javax.swing.border.BevelBorder.getShadowInnerColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getShadowInnerColor(java.awt.Component)

public Color sample code for java.awt.Color definition code for java.awt.Color  getShadowInnerColor(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns the inner shadow color of the bevel border when rendered on the specified component. If no shadow color was specified at instantiation, the shadow color is derived from the specified component's background color.

Parameters:
c - the component for which the shadow may be derived

getShadowOuterColor sample code for javax.swing.border.BevelBorder.getShadowOuterColor(java.awt.Component) definition code for javax.swing.border.BevelBorder.getShadowOuterColor(java.awt.Component)

public Color sample code for java.awt.Color definition code for java.awt.Color  getShadowOuterColor(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns the outer shadow color of the bevel border when rendered on the specified component. If no shadow color was specified at instantiation, the shadow color is derived from the specified component's background color.

Parameters:
c - the component for which the shadow may be derived

getHighlightOuterColor sample code for javax.swing.border.BevelBorder.getHighlightOuterColor() definition code for javax.swing.border.BevelBorder.getHighlightOuterColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getHighlightOuterColor()
Returns the outer highlight color of the bevel border. Will return null if no highlight color was specified at instantiation.


getHighlightInnerColor sample code for javax.swing.border.BevelBorder.getHighlightInnerColor() definition code for javax.swing.border.BevelBorder.getHighlightInnerColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getHighlightInnerColor()
Returns the inner highlight color of the bevel border. Will return null if no highlight color was specified at instantiation.


getShadowInnerColor sample code for javax.swing.border.BevelBorder.getShadowInnerColor() definition code for javax.swing.border.BevelBorder.getShadowInnerColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getShadowInnerColor()
Returns the inner shadow color of the bevel border. Will return null if no shadow color was specified at instantiation.


getShadowOuterColor sample code for javax.swing.border.BevelBorder.getShadowOuterColor() definition code for javax.swing.border.BevelBorder.getShadowOuterColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getShadowOuterColor()
Returns the outer shadow color of the bevel border. Will return null if no shadow color was specified at instantiation.


getBevelType sample code for javax.swing.border.BevelBorder.getBevelType() definition code for javax.swing.border.BevelBorder.getBevelType()

public int getBevelType()
Returns the type of the bevel border.


isBorderOpaque sample code for javax.swing.border.BevelBorder.isBorderOpaque() definition code for javax.swing.border.BevelBorder.isBorderOpaque()

public boolean isBorderOpaque()
Returns whether or not the border is opaque.

Specified by:
isBorderOpaque sample code for javax.swing.border.Border.isBorderOpaque() definition code for javax.swing.border.Border.isBorderOpaque() in interface Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Overrides:
isBorderOpaque sample code for javax.swing.border.AbstractBorder.isBorderOpaque() definition code for javax.swing.border.AbstractBorder.isBorderOpaque() in class AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder
Returns:
false

paintRaisedBevel sample code for javax.swing.border.BevelBorder.paintRaisedBevel(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.BevelBorder.paintRaisedBevel(java.awt.Component, java.awt.Graphics, int, int, int, int)

protected void paintRaisedBevel(Component sample code for java.awt.Component definition code for java.awt.Component  c,
                                Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                                int x,
                                int y,
                                int width,
                                int height)

paintLoweredBevel sample code for javax.swing.border.BevelBorder.paintLoweredBevel(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.BevelBorder.paintLoweredBevel(java.awt.Component, java.awt.Graphics, int, int, int, int)

protected void paintLoweredBevel(Component sample code for java.awt.Component definition code for java.awt.Component  c,
                                 Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                                 int x,
                                 int y,
                                 int width,
                                 int height)