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
-
ColorCellItemPainter()
- Creates and initializes a new ColorCellItemPainter.
-
getBackground(ItemPaintSite, int)
- Returns the color to be used when painting the background of the cell.
-
getForeground(TimeSlice, int)
- Returns the color to be used when painting the foreground of the cell.
-
getPreferredSize(Object, Graphics, int, ItemPaintSite)
- Returns the preferred size of the ItemPainter.
-
paint(Object, Graphics, Rectangle, int, ItemPaintSite)
- Paints the data Object within the Rectangle bounds, using passed Graphics
and state information.
-
paintHeader(String, Graphics, Rectangle, int, ItemPaintSite)
- Paints a header cell.
-
paintRegularCell(Vector, Graphics, Rectangle, int, ItemPaintSite)
- Paints a regular cell with a vector of time slices in it.
ColorCellItemPainter
public ColorCellItemPainter()
- Creates and initializes a new ColorCellItemPainter.
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.
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.
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.
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.
paintHeader
protected void paintHeader(String header,
Graphics g,
Rectangle r,
int state,
ItemPaintSite site)
- Paints a header cell.
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