borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.model 

ItemPainter interface

borland.jbcl.model.ItemPainter

About the ItemPainter interface

Variables  Methods  

Implemented by BorderItemPainter, ButtonItemPainter, ColorItemPainter, CompositeItemPainter, FocusableItemPainter, ImageArrayItemPainter, ImageButtonItemPainter, ImageItemPainter, SelectableTextItemPainter, StateImageItemPainter, StateItemPainter, TextItemPainter, WrappedTextItemPainter

The ItemPainter interface defines a single item painter for painting a data item.


ItemPainter variables

Variables defined in this interface

ItemPainter methods

Methods defined in this interface


ItemPainter variables

DEFAULT

  public static final int DEFAULT = 0x0000
This is the default state for the item.

DISABLED

  public static final int DISABLED = 0x0001
Used to indicate that the item is disabled and should therefore appear dimmed.

FOCUSED

  public static final int FOCUSED = 0x0002
Used to indicate that the item has the input focus.

INACTIVE

  public static final int INACTIVE = 0x0020
Used to indicate the item's owning window is not focused and is therefore inactive.

INDETERMINATE

  public static final int INDETERMINATE = 0x0008
Used to indicate the item is in a unknown selected state. This setting overrides the selected state.

OPENED

  public static final int OPENED = 0x0010
Used to indicate that the item's contents are open. If the contents are not opened, then they are closed.

SELECTED

  public static final int SELECTED = 0x0004
Used to indicate if the item is selected.

ItemPainter methods

getPreferredSize(java.lang.Object, java.awt.Graphics, int, borland.jbcl.model.ItemPaintSite)

  public Dimension getPreferredSize(java.lang.Object data, java.awt.Graphics graphics, int state, borland.jbcl.model.ItemPaintSite site)
Returns the preferred size of the ItemPainter object as a Dimension object.

Parameters:

data
The data object to use for the size calculation.
graphics
The Graphics object to use for the size calculation.
state
The current state of the object. Use one of the ItemPainter variables to specify state.
site
description

paint(java.lang.Object, java.awt.Graphics, java.awt.Rectangle, int, borland.jbcl.model.ItemPaintSite)

  public void paint(java.lang.Object data, java.awt.Graphics graphics, java.awt.Rectangle bounds, int state, borland.jbcl.model.ItemPaintSite site)
Paints the data object within a bounding rectangle, using the passed Graphics object to paint in and the state parameter to specify the state of the data item.

Parameters:

data
The data object to be painted.
graphics
The Graphics object to paint on.
bounds
The rectangular area in which the painting occurs.
state
The current state of the data object. Use one of the ItemPainter variables to specify state.
site
The ItemPaintSite object that supplies data about the paint site such as font and margin information.