Class tea.set.Shade
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
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.

Constructor Index

 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 minimumSize()
Minimum size is the minimum size of the component increased by the shade and border width.
 o paint(Graphics)
Paint the component with a shade.
 o preferredSize()
Preferred size is the preferred size of the component increased by the shade and border width.
 o setBorder(boolean)
Set border option to true or false.
 o setShadeWidth(int)
Set the shade width.

Constructors

 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 setBorder
  public 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 setShadeWidth
  public 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 Component
 o preferredSize
  public Dimension preferredSize()
Preferred size is the preferred size of the component increased by the shade and border width.
Returns:
preferred size.
Overrides:
preferredSize in class Container
 o minimumSize
  public Dimension minimumSize()
Minimum size is the minimum size of the component increased by the shade and border width.
Returns:
minimum size.
Overrides:
minimumSize in class Container

All Packages  Class Hierarchy  This Package  Previous  Next  Index