weka.gui.beans
Class ShadowBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by weka.gui.beans.ShadowBorder
All Implemented Interfaces:
Serializable, Border

public class ShadowBorder
extends AbstractBorder

See Also:
Serialized Form

Constructor Summary
ShadowBorder()
          Constructor.
ShadowBorder(int width)
          Constructor.
ShadowBorder(int width, Color color)
          Constructor.
 
Method Summary
 Insets getBorderInsets(Component c)
          Returns a new Insets instance where the top and left are 1, the bottom and right fields are the border width + 1.
 Insets getBorderInsets(Component c, Insets insets)
          Reinitializes the insets parameter with this ShadowBorder's current Insets.
 boolean isBorderOpaque()
          This implementation always returns true.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the drop shadow border around the given component.
 
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowBorder

public ShadowBorder()
Constructor. Drop shadow with default width of 2 pixels and black color.


ShadowBorder

public ShadowBorder(int width)
Constructor. Drop shadow, default shadow color is black.

Parameters:
width - the width of the shadow.

ShadowBorder

public ShadowBorder(int width,
                    Color color)
Constructor. Drop shadow, width and color are adjustable.

Parameters:
width - the width of the shadow.
color - the color of the shadow.
Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Returns a new Insets instance where the top and left are 1, the bottom and right fields are the border width + 1.

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which this border insets value applies
Returns:
a new Insets object initialized as stated above.

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
Reinitializes the insets parameter with this ShadowBorder'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 given insets object

isBorderOpaque

public boolean isBorderOpaque()
This implementation always returns true.

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

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the drop shadow border around the given component.

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


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.