APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.border

public Class BevelBorder

extends AbstractBorder
Class Inheritance
Known Direct Subclasses
javax.swing.border.SoftBevelBorder, javax.swing.plaf.BorderUIResource.BevelBorderUIResource
Annotations
@SuppressWarnings:serial
Imports
java.awt.Graphics, .Insets, .Color, .Component, java.beans.ConstructorProperties

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 JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
David Kloba

Field Summary

Modifier and TypeField and Description
protected int
bevelType

The bevel type.

protected Color
highlightInner

The color to use for the bevel inner highlight.

protected Color
highlightOuter

The color to use for the bevel outer highlight.

public static final int
LOWERED

Lowered bevel type.

public static final int
RAISED

Raised bevel type.

protected Color
shadowInner

The color to use for the bevel inner shadow.

protected Color
shadowOuter

the color to use for the bevel outer shadow

Constructor Summary

AccessConstructor and Description
public
BevelBorder(int
the type of bevel for the border
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.

public
BevelBorder(int
the type of bevel for the border
bevelType
,
Color
the color to use for the bevel highlight
highlight
,
Color
the color to use for the bevel shadow
shadow
)

Creates a bevel border with the specified type, highlight and shadow colors.

public
BevelBorder(int
the type of bevel for the border
bevelType
,
Color
the color to use for the bevel outer highlight
highlightOuterColor
,
Color
the color to use for the bevel inner highlight
highlightInnerColor
,
Color
the color to use for the bevel outer shadow
shadowOuterColor
,
Color
the color to use for the bevel inner shadow
shadowInnerColor
)

Creates a bevel border with the specified type, highlight and shadow colors.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the bevel border type, either RAISED or LOWERED
getBevelType
()

Returns the type of the bevel border.

public Insets
getBorderInsets(Component
the component for which this border insets value applies
c
,
Insets
the object to be reinitialized
insets
)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Reinitialize the insets parameter with this Border's current Insets.

public Color

Returns:

the inner highlight Color
getHighlightInnerColor
(Component
the component for which the highlight may be derived
c
)

Returns the inner highlight color of the bevel border when rendered on the specified component.

public Color

Returns:

the inner highlight Color or null if no highlight color was specified
getHighlightInnerColor
()

Returns the inner highlight color of the bevel border.

public Color

Returns:

the outer highlight Color
getHighlightOuterColor
(Component
the component for which the highlight may be derived
c
)

Returns the outer highlight color of the bevel border when rendered on the specified component.

public Color

Returns:

the outer highlight Color or null if no highlight color was specified
getHighlightOuterColor
()

Returns the outer highlight color of the bevel border.

public Color

Returns:

the inner shadow Color
getShadowInnerColor
(Component
the component for which the shadow may be derived
c
)

Returns the inner shadow color of the bevel border when rendered on the specified component.

public Color

Returns:

the inner shadow Color or null if no shadow color was specified
getShadowInnerColor
()

Returns the inner shadow color of the bevel border.

public Color

Returns:

the outer shadow Color
getShadowOuterColor
(Component
the component for which the shadow may be derived
c
)

Returns the outer shadow color of the bevel border when rendered on the specified component.

public Color

Returns:

the outer shadow Color or null if no shadow color was specified
getShadowOuterColor
()

Returns the outer shadow color of the bevel border.

public boolean

Returns:

true
isBorderOpaque
()

Overrides javax.swing.border.AbstractBorder.isBorderOpaque.

Implements javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque.

public void
paintBorder(Component
the component for which this border is being painted
c
,
Graphics
the paint graphics
g
,
int
the x position of the painted border
x
,
int
the y position of the painted border
y
,
int
the width of the painted border
width
,
int
the height of the painted border
height
)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

protected void
paintLoweredBevel(Component
the component for which the lowered bevel is being painted
c
,
Graphics
the paint graphics
g
,
int
the x position of the lowered bevel
x
,
int
the y position of the lowered bevel
y
,
int
the width of the lowered bevel
width
,
int
the height of the lowered bevel
height
)

Paints a lowered bevel for the specified component with the specified position and size.

protected void
paintRaisedBevel(Component
the component for which the raised bevel is being painted
c
,
Graphics
the paint graphics
g
,
int
the x position of the raised bevel
x
,
int
the y position of the raised bevel
y
,
int
the width of the raised bevel
width
,
int
the height of the raised bevel
height
)

Paints a raised bevel for the specified component with the specified position and size.

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangleisLeftToRight

Field Detail

bevelTypeback to summary
protected int bevelType

The bevel type.

highlightInnerback to summary
protected Color highlightInner

The color to use for the bevel inner highlight.

highlightOuterback to summary
protected Color highlightOuter

The color to use for the bevel outer highlight.

LOWEREDback to summary
public static final int LOWERED

Lowered bevel type.

RAISEDback to summary
public static final int RAISED

Raised bevel type.

shadowInnerback to summary
protected Color shadowInner

The color to use for the bevel inner shadow.

shadowOuterback to summary
protected Color shadowOuter

the color to use for the bevel outer shadow

Constructor Detail

BevelBorderback to summary
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:int

the type of bevel for the border

BevelBorderback to summary
public BevelBorder(int bevelType, Color highlight, Color shadow)

Creates a bevel border with the specified type, highlight and shadow colors. The bevel outer highlight color and bevel inner highlight color will be derived from specified highlight color and bevel outer shadow color and bevel inner shadow color will be derived from specified shadow color.

Parameters
bevelType:int

the type of bevel for the border

highlight:Color

the color to use for the bevel highlight

shadow:Color

the color to use for the bevel shadow

BevelBorderback to summary
public BevelBorder(int bevelType, Color highlightOuterColor, Color highlightInnerColor, Color shadowOuterColor, Color shadowInnerColor)

Creates a bevel border with the specified type, highlight and shadow colors.

Parameters
bevelType:int

the type of bevel for the border

highlightOuterColor:Color

the color to use for the bevel outer highlight

highlightInnerColor:Color

the color to use for the bevel inner highlight

shadowOuterColor:Color

the color to use for the bevel outer shadow

shadowInnerColor:Color

the color to use for the bevel inner shadow

Annotations
@ConstructorProperties:bevelType, highlightOuterColor, highlightInnerColor, shadowOuterColor, shadowInnerColor

Method Detail

getBevelTypeback to summary
public int getBevelType()

Returns the type of the bevel border.

Returns:int

the bevel border type, either RAISED or LOWERED

getBorderInsetsback to summary
public Insets getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Reinitialize the insets parameter with this Border's current Insets.

Parameters
c:Component

the component for which this border insets value applies

insets:Insets

the object to be reinitialized

Exceptions
NullPointerException:
if the specified insets is null
getHighlightInnerColorback to summary
public Color getHighlightInnerColor(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:Component

the component for which the highlight may be derived

Returns:Color

the inner highlight Color

Since
1.3
getHighlightInnerColorback to summary
public Color getHighlightInnerColor()

Returns the inner highlight color of the bevel border. Will return null if no highlight color was specified at instantiation.

Returns:Color

the inner highlight Color or null if no highlight color was specified

Since
1.3
getHighlightOuterColorback to summary
public Color getHighlightOuterColor(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:Component

the component for which the highlight may be derived

Returns:Color

the outer highlight Color

Since
1.3
getHighlightOuterColorback to summary
public Color getHighlightOuterColor()

Returns the outer highlight color of the bevel border. Will return null if no highlight color was specified at instantiation.

Returns:Color

the outer highlight Color or null if no highlight color was specified

Since
1.3
getShadowInnerColorback to summary
public Color getShadowInnerColor(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:Component

the component for which the shadow may be derived

Returns:Color

the inner shadow Color

Since
1.3
getShadowInnerColorback to summary
public Color getShadowInnerColor()

Returns the inner shadow color of the bevel border. Will return null if no shadow color was specified at instantiation.

Returns:Color

the inner shadow Color or null if no shadow color was specified

Since
1.3
getShadowOuterColorback to summary
public Color getShadowOuterColor(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:Component

the component for which the shadow may be derived

Returns:Color

the outer shadow Color

Since
1.3
getShadowOuterColorback to summary
public Color getShadowOuterColor()

Returns the outer shadow color of the bevel border. Will return null if no shadow color was specified at instantiation.

Returns:Color

the outer shadow Color or null if no shadow color was specified

Since
1.3
isBorderOpaqueback to summary
public boolean isBorderOpaque()

Overrides javax.swing.border.AbstractBorder.isBorderOpaque.

Implements javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque. This implementation returns true.

Returns:boolean

true

paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

Parameters
c:Component

the component for which this border is being painted

g:Graphics

the paint graphics

x:int

the x position of the painted border

y:int

the y position of the painted border

width:int

the width of the painted border

height:int

the height of the painted border

paintLoweredBevelback to summary
protected void paintLoweredBevel(Component c, Graphics g, int x, int y, int width, int height)

Paints a lowered bevel for the specified component with the specified position and size.

Parameters
c:Component

the component for which the lowered bevel is being painted

g:Graphics

the paint graphics

x:int

the x position of the lowered bevel

y:int

the y position of the lowered bevel

width:int

the width of the lowered bevel

height:int

the height of the lowered bevel

paintRaisedBevelback to summary
protected void paintRaisedBevel(Component c, Graphics g, int x, int y, int width, int height)

Paints a raised bevel for the specified component with the specified position and size.

Parameters
c:Component

the component for which the raised bevel is being painted

g:Graphics

the paint graphics

x:int

the x position of the raised bevel

y:int

the y position of the raised bevel

width:int

the width of the raised bevel

height:int

the height of the raised bevel