All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.Shade

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----tea.set.Shade

public class Shade
extends Panel
implements Decorator
Shade class is a decorator class to add a shade to an AWT component. When Shade class is constructed, a component must be passed in to be shaded. The shade width can be controled by setShadeWidth() function. The default behavior of Shade addes a border to the component being shaded. It can be turned off by using Shade(Component,boolean) constructor, or by calling setBorder() method.

Shade supports the following properties:
Property NameProperty TypeDescription
ComponentComponent The shaded component.
Borderboolean True to draw a border around child component.
ShadeWidthint The width of the shade in pixels.


Constructor Index

 o Shade()
Construct an empty Shade.
 o Shade(Component)
Construct a shaded component.
 o Shade(Component, boolean)
Construct a shaded component and draw border according to the border flag.

Method Index

 o getChild()
Get the decorated component.
 o getComponent()
Get the managed component.
 o getMinimumSize()
Minimum size is the minimum size of the component increased by the shade and border width.
 o getPreferredSize()
Preferred size is the preferred size of the component increased by the shade and border width.
 o getShadeWidth()
Get shadow width.
 o isBorder()
Get the border option of this Shade.
 o paint(Graphics)
Paint the component with a shade.
 o setBorder(boolean)
Set border option to true or false.
 o setComponent(Component)
Set the managed component of this Shade.
 o setShadeWidth(int)
Set the shade width.

Constructors

 o Shade
 public Shade()
Construct an empty Shade. Shade.setComponent() must be called to set the shaded component.

 o Shade
 public Shade(Component comp)
Construct a shaded component. Border option defaults to true.

Parameters:
comp - component to add shade to.
 o Shade
 public Shade(Component comp,
              boolean border)
Construct a shaded component and draw border according to the border flag.

Parameters:
comp - component to add shade to.
border - draw border if true.

Methods

 o setComponent
 public synchronized void setComponent(Component comp)
Set the managed component of this Shade.

Parameters:
comp - managed component.
 o getComponent
 public Component getComponent()
Get the managed component.

Returns:
managed component.
 o setBorder
 public synchronized void setBorder(boolean border)
Set border option to true or false. If border option is true, a light border is draw around the component to highlight it.

Parameters:
border - draw border if true.
 o isBorder
 public boolean isBorder()
Get the border option of this Shade.

Returns:
true if border option is true.
 o getShadeWidth
 public int getShadeWidth()
Get shadow width.

Returns:
shadow width.
 o setShadeWidth
 public synchronized void setShadeWidth(int shadeW)
Set the shade width. Default width is 5 pixels.

Parameters:
shadeW - shade width.
 o paint
 public void paint(Graphics g)
Paint the component with a shade.

Parameters:
g - Graphics context of this component.
Overrides:
paint in class Container
 o getPreferredSize
 public Dimension getPreferredSize()
Preferred size is the preferred size of the component increased by the shade and border width.

Returns:
preferred size.
Overrides:
getPreferredSize in class Container
 o getMinimumSize
 public Dimension getMinimumSize()
Minimum size is the minimum size of the component increased by the shade and border width.

Returns:
minimum size.
Overrides:
getMinimumSize in class Container
 o getChild
 public Component getChild()
Get the decorated component.

Returns:
component.

All Packages  Class Hierarchy  This Package  Previous  Next  Index