jbcl.model Package
com.borland.jbcl.model.ItemPainter
Variables Methods
Implemented by BorderItemPainter, ButtonItemPainter, CheckboxItemPainter, CheckboxStateItemPainter, ColorItemPainter, CompositeItemPainter, CustomItemPainter, EllipsisTextItemPainter, FocusableItemPainter, ImageArrayItemPainter, ImageButtonItemPainter, ImageItemPainter, SelectableItemPainter, SelectableTextItemPainter, StateImageItemPainter, StateItemPainter, TextItemPainter, WrappedTextItemPainter
The ItemPainter
interface defines a single item painter for painting a data item.
public static final int DEFAULT = 0x0000This is the default state for the item.
public static final int DISABLED = 0x0001Used to indicate that the item is disabled and should therefore appear dimmed.
public static final int FOCUSED = 0x0002Used to indicate that the item has the input focus.
public static final int INACTIVE = 0x0020Used to indicate the item's owning window is not focused and is therefore inactive.
public static final int INDETERMINATE = 0x0008Used to indicate the item is in a unknown selected state. This setting overrides the selected state.
public static final int NOT_FOCUS_OWNER = 0x0080Set if this item's containing component is not the current focus owner.
public static final int OPENED = 0x0010Used to indicate that the item's contents are open. If the contents are not opened, then they are closed.
public static final int ROLLOVER = 0x0040Set if this item is in a rollover state (mouse over).
public static final int SELECTED = 0x0004Used to indicate if the item is selected.
static String[] stateNames = new String[] { "DEFAULT", // NORES "DISABLED", // NORES "FOCUSED", // NORES "SELECTED", // NORES "INDETERMINATE", // NORES "OPENED", // NORES "INACTIVE", // NORES "ROLLOVER", // NORES "NOT_FOCUS_OWNER" // NORES }
static int[] states = new int[] { DEFAULT, DISABLED, FOCUSED, SELECTED, INDETERMINATE, OPENED, INACTIVE, ROLLOVER, NOT_FOCUS_OWNER }
public Dimension getPreferredSize(Object data, Graphics graphics, int state, ItemPaintSite site)Returns the preferred size of the
ItemPainter
object as a Dimension
object.
Parameters:
data
graphics
Graphics
object to use for the size calculation.
state
ItemPainter
variables to specify state
.
site
ItemPaintSite
object where the item is painted.
public void paint(Object data, Graphics graphics, Rectangle rect, int state, 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
graphics
Graphics
object to paint on.
bounds
state
ItemPainter
variables to specify state
.
site
ItemPaintSite
object that supplies data about the paint site such as font and margin information.