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.
-
Shade(Component)
- Construct a shaded component.
-
Shade(Component, boolean)
- Construct a shaded component and draw border according to the
border flag.
-
minimumSize()
- Minimum size is the minimum size of the component increased
by the shade and border width.
-
paint(Graphics)
- Paint the component with a shade.
-
preferredSize()
- Preferred size is the preferred size of the component increased
by the shade and border width.
-
setBorder(boolean)
- Set border option to true or false.
-
setShadeWidth(int)
- Set the shade width.
Shade
public Shade(Component comp)
- Construct a shaded component. Border option defaults to true.
- Parameters:
- comp - component to add shade to.
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.
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.
setShadeWidth
public void setShadeWidth(int shadeW)
- Set the shade width. Default width is 5 pixels.
- Parameters:
- shadeW - shade width.
paint
public void paint(Graphics g)
- Paint the component with a shade.
- Parameters:
- g - Graphics context of this component.
- Overrides:
- paint in class Component
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
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