JComponentPack 1.3.0

com.zfqjava.swing.border
Class ShadowBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by com.zfqjava.swing.border.ShadowBorder
All Implemented Interfaces:
Serializable, Border

public class ShadowBorder
extends AbstractBorder

A shadow border.

See Also:
Serialized Form

Constructor Summary
ShadowBorder(Color shadowColor)
          Contructs a shadow border use the specify shadow color.
ShadowBorder(Color shadowColor, int hoffset, int voffset)
          Constructs a shadow border use the specify shadow color and the horizontal offset and vertical offset.
 
Method Summary
 Insets getBorderInsets(Component c)
          This default implementation returns a new Insets instance where the top, left, bottom, and right fields are set to 0.
 Insets getBorderInsets(Component c, Insets insets)
          Reinitializes the insets parameter with this Border's current Insets.
 int getHorizontalOffset()
          Returns the horizontal offset.
 Color getShadowColor()
          Returns the shadow color of the etched border.
 int getVerticalOffset()
          Returns the vertical offset.
 boolean isBorderOpaque()
          This default implementation returns false.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          This default implementation does no painting.
 
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(Color shadowColor)
Contructs a shadow border use the specify shadow color.

Parameters:
shadowColor - the specify shadow color

ShadowBorder

public ShadowBorder(Color shadowColor,
                    int hoffset,
                    int voffset)
Constructs a shadow border use the specify shadow color and the horizontal offset and vertical offset.

Parameters:
shadowColor - the specify shadow color
hoffset - the shadow horizontal offset
voffset - the shadow vertical offset
Method Detail

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
This default implementation does no painting.

Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class 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

public Insets getBorderInsets(Component c)
This default implementation returns a new Insets instance where the top, left, bottom, and right fields are set to 0.

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which this border insets value applies
Returns:
the new Insets object initialized to 0

getBorderInsets

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

Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which this border insets value applies
insets - the object to be reinitialized
Returns:
the insets object

isBorderOpaque

public boolean isBorderOpaque()
This default implementation returns false.

Specified by:
isBorderOpaque in interface Border
Overrides:
isBorderOpaque in class AbstractBorder
Returns:
false

getShadowColor

public Color getShadowColor()
Returns the shadow color of the etched border. Will return null if no shadow color was specified at instantiation.


getHorizontalOffset

public int getHorizontalOffset()
Returns the horizontal offset.

Returns:
the horizontal offset

getVerticalOffset

public int getVerticalOffset()
Returns the vertical offset.

Returns:
the vertical offset

JComponentPack 1.3.0

Send your Feedback
JComponentPack 1.3.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.