borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.view
java.lang.Object +----borland.jbcl.view.TextItemPainter +----borland.jbcl.view.SelectableTextItemPainter
Variables Constructors Properties Methods
Implements ItemPainter
A text item painter for text views. Supports:
The background is obtained from the paint Graphics object. The foreground is always SystemColor.controlText.
Text can be painted in the item's reserved space using horizontal alignment of left, center, or right, and vertical alignment of top, middle, or bottom.
See also:
Overview of model package: Item formatters
protected boolean checkDisabled
Used by the checkDisabled property.
public TextItemPainter()
Constructs a TextItemPainter with LEFT alignment, MIDDLE vertical alignment, insets (1,1,1,1), and checkDisabled = false.
public TextItemPainter(int alignment)
Constructs a TextItemPainter with insets of (1,1,1,1) and checkDisabled = false.
Parameters:
public TextItemPainter(int alignment, java.awt.Insets margins)
Constructs a TextItemPainter with checkDisabled = false.
Parameters:
public TextItemPainter(int alignment, java.awt.Insets margins, boolean checkDisabled)
Constructs a TextItemPainter.
Parameters:
public TextItemPainter(int alignment, java.awt.Insets margins, borland.jbcl.model.ItemFormatter formatter)
Constructs a TextItemPainter.
Parameters:
public int getAlignment() public void setAlignment(int a)The alignment property stores the horizontal and vertical alignment of the items to be painted. Text can be painted in the item's reserved space using horizontal alignment of left, center, or right, and vertical alignment of top, middle, or bottom. For example, Alignment.LEFT. These values are defined in util.Alignment.
public boolean isCheckDisabled() public void setCheckDisabled(boolean check)The checkDisabled property controls whether to paint the item as grayed-out when the item is disabled.
public Color getForeground() public void setForeground(java.awt.Color c)The foreground text color.
public Insets getMargins() public void setMargins(java.awt.Insets m)The space between the text for an item and the rectangle reserved for the item.
protected Color getBackground(java.lang.Object object, java.awt.Graphics g, int state, borland.jbcl.model.ItemPaintSite site)Returns the painting site background color. To determine this color, calls site.getBackground(). If the site is null, returns the graphics context color by using g.getColor().
Parameters:
protected Color getForeground(java.lang.Object object, java.awt.Graphics g, int state, borland.jbcl.model.ItemPaintSite site)Returns the painting site foreground color. To determine this color, calls site.getForeground(). If the site is null, returns the color foreground.
Parameters:
protected String getText(java.lang.Object object)Returns the text string for the specified data item.
Parameters: