All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tc.ui.ColorCellItemPainter

java.lang.Object
   |
   +----tc.ui.ColorCellItemPainter

public class ColorCellItemPainter
extends Object
implements ItemPainter
ColorCellItemPainter is used by the CalendarPanel (its user interface grid widget) to paint the time slices as color cells to the grid widget.

Version:
0.30, 1998/04/01
Author:
FRED development team, Jukka Viljamaa, Antti Viljamaa
See Also:
CalendarPanel

Constructor Index

 o ColorCellItemPainter()
Creates and initializes a new ColorCellItemPainter.

Method Index

 o getBackground(ItemPaintSite, int)
Returns the color to be used when painting the background of the cell.
 o getForeground(TimeSlice, int)
Returns the color to be used when painting the foreground of the cell.
 o getPreferredSize(Object, Graphics, int, ItemPaintSite)
Returns the preferred size of the ItemPainter.
 o paint(Object, Graphics, Rectangle, int, ItemPaintSite)
Paints the data Object within the Rectangle bounds, using passed Graphics and state information.
 o paintHeader(String, Graphics, Rectangle, int, ItemPaintSite)
Paints a header cell.
 o paintRegularCell(Vector, Graphics, Rectangle, int, ItemPaintSite)
Paints a regular cell with a vector of time slices in it.

Constructors

 o ColorCellItemPainter
 public ColorCellItemPainter()
Creates and initializes a new ColorCellItemPainter.

Methods

 o getPreferredSize
 public Dimension getPreferredSize(Object data,
                                   Graphics g,
                                   int state,
                                   ItemPaintSite site)
Returns the preferred size of the ItemPainter.

Parameters:
data - The data object to use for size calculation.
graphics - The Graphics object to use for size calculation.
state - The current state of the object.
site - The ItemPaintSite with information about fonts, margins, etc.
Returns:
The calculated Dimension object representing the preferred size of this ItemPainter.
 o paint
 public void paint(Object data,
                   Graphics g,
                   Rectangle r,
                   int state,
                   ItemPaintSite site)
Paints the data Object within the Rectangle bounds, using passed Graphics and state information.

Parameters:
data - The data object to paint.
graphics - The Graphics object to paint to.
bounds - The Rectangle extents to paint in.
state - The current state information for the data object.
site - The ItemPaintSite with information about fonts, margins, etc.
 o getBackground
 protected Color getBackground(ItemPaintSite site,
                               int state)
Returns the color to be used when painting the background of the cell. The color depends on the given cell site and state.

 o getForeground
 protected Color getForeground(TimeSlice ts,
                               int state)
Returns the color to be used when painting the foreground of the cell. The color depends on the given time slice and state.

 o paintHeader
 protected void paintHeader(String header,
                            Graphics g,
                            Rectangle r,
                            int state,
                            ItemPaintSite site)
Paints a header cell.

 o paintRegularCell
 protected void paintRegularCell(Vector slices,
                                 Graphics g,
                                 Rectangle r,
                                 int state,
                                 ItemPaintSite site)
Paints a regular cell with a vector of time slices in it.


All Packages  Class Hierarchy  This Package  Previous  Next  Index