org.ascape.util.swing
Class ShadowBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by javax.swing.border.BevelBorder
          extended by org.ascape.util.swing.ShadowBorder
All Implemented Interfaces:
java.io.Serializable, javax.swing.border.Border

public class ShadowBorder
extends javax.swing.border.BevelBorder

A class which implements a shadow border, or BevelBorder of thickness 1. Copied from sun's BevelBorder.

Version:
1.2 7/16/99
Author:
Miles Parker, David Kloba
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.border.BevelBorder
bevelType, highlightInner, highlightOuter, LOWERED, RAISED, shadowInner, shadowOuter
 
Constructor Summary
ShadowBorder(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.
ShadowBorder(int bevelType, java.awt.Color highlight, java.awt.Color shadow)
          Creates a bevel border with the specified type, highlight and shadow colors.
ShadowBorder(int bevelType, java.awt.Color highlightOuter, java.awt.Color highlightInner, java.awt.Color shadowOuter, java.awt.Color shadowInner)
          Creates a bevel border with the specified type, highlight shadow colors.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Returns the insets of the border.
 java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
          Reinitialize the insets parameter with this Border's current Insets.
 void paintBorder(java.awt.Component c, 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(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
           
protected  void paintRaisedBevel(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
           
 
Methods inherited from class javax.swing.border.BevelBorder
getBevelType, getHighlightInnerColor, getHighlightInnerColor, getHighlightOuterColor, getHighlightOuterColor, getShadowInnerColor, getShadowInnerColor, getShadowOuterColor, getShadowOuterColor, isBorderOpaque
 
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

ShadowBorder

public ShadowBorder(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

ShadowBorder

public ShadowBorder(int bevelType,
                    java.awt.Color highlight,
                    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

ShadowBorder

public ShadowBorder(int bevelType,
                    java.awt.Color highlightOuter,
                    java.awt.Color highlightInner,
                    java.awt.Color shadowOuter,
                    java.awt.Color shadowInner)
Creates a bevel border with the specified type, highlight shadow colors.

Parameters:
bevelType - the type of bevel for the border
highlightOuter - the color to use for the bevel outer highlight
highlightInner - the color to use for the bevel inner highlight
shadowOuter - the color to use for the bevel outer shadow
shadowInner - the color to use for the bevel inner shadow
Method Detail

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Returns the insets of the border.

Specified by:
getBorderInsets in interface javax.swing.border.Border
Overrides:
getBorderInsets in class javax.swing.border.BevelBorder
Parameters:
c - the component for which this border insets value applies

getBorderInsets

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

Overrides:
getBorderInsets in class javax.swing.border.BevelBorder
Parameters:
c - the component for which this border insets value applies
insets - the object to be reinitialized

paintBorder

public void paintBorder(java.awt.Component c,
                        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 in interface javax.swing.border.Border
Overrides:
paintBorder in class javax.swing.border.BevelBorder
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

paintRaisedBevel

protected void paintRaisedBevel(java.awt.Component c,
                                java.awt.Graphics g,
                                int x,
                                int y,
                                int width,
                                int height)
Overrides:
paintRaisedBevel in class javax.swing.border.BevelBorder

paintLoweredBevel

protected void paintLoweredBevel(java.awt.Component c,
                                 java.awt.Graphics g,
                                 int x,
                                 int y,
                                 int width,
                                 int height)
Overrides:
paintLoweredBevel in class javax.swing.border.BevelBorder


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.