borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.view 

TextItemPainter component

java.lang.Object
   +----borland.jbcl.view.TextItemPainter
           +----borland.jbcl.view.SelectableTextItemPainter

About the TextItemPainter component

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


TextItemPainter variables

Variables implemented in this class

TextItemPainter constructors

TextItemPainter properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

TextItemPainter methods

Methods implemented in this class

Methods implemented in java.lang.Object


TextItemPainter variables

checkDisabled

  protected boolean checkDisabled

Used by the checkDisabled property.


TextItemPainter constructors

TextItemPainter()

  public TextItemPainter()

Constructs a TextItemPainter with LEFT alignment, MIDDLE vertical alignment, insets (1,1,1,1), and checkDisabled = false.

TextItemPainter(int)

  public TextItemPainter(int alignment)

Constructs a TextItemPainter with insets of (1,1,1,1) and checkDisabled = false.

Parameters:

alignment
The horizontal and vertical alignment of the items to be painted. Defined in util.Alignment.

TextItemPainter(int, java.awt.Insets)

  public TextItemPainter(int alignment, java.awt.Insets margins)

Constructs a TextItemPainter with checkDisabled = false.

Parameters:

alignment
The horizontal and vertical alignment of the items to be painted. Defined in util.Alignment.
margins
The insets between the text for an item and the item's reserved space.

TextItemPainter(int, java.awt.Insets, boolean)

  public TextItemPainter(int alignment, java.awt.Insets margins, boolean checkDisabled)

Constructs a TextItemPainter.

Parameters:

alignment
The horizontal and vertical alignment of the items to be painted. Defined in util.Alignment.
margins
The insets between the text for an item and the item's reserved space.
checkDisabled
Whether to paint the item as greyed-out when the item is disabled.

TextItemPainter(int, java.awt.Insets, borland.jbcl.model.ItemFormatter)

  public TextItemPainter(int alignment, java.awt.Insets margins, borland.jbcl.model.ItemFormatter formatter)

Constructs a TextItemPainter.

Parameters:

alignment
The horizontal and vertical alignment of the items to be painted. Defined in util.Alignment.
margins
The insets between the text for an item and the item's reserved space.
formatter
The item formatter to use. See Overview of model package: Item formatters.


TextItemPainter properties

alignment

 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.

checkDisabled

 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.

foreground

 public Color getForeground()
 public void setForeground(java.awt.Color c)
The foreground text color.

margins

 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.


TextItemPainter methods

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

  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:

object
The item to be painted.
g
The graphics context.
state
Stores whether the item to be painted is selected or disabled. Also stores the focus state.
site
The screen rectangle to be painted.

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

  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:

object
The item to be painted.
g
The graphics context.
state
Stores whether the item to be painted is selected or disabled. Also stores the focus state.
site
The screen rectangle to be painted.

getText(java.lang.Object)

  protected String getText(java.lang.Object object)
Returns the text string for the specified data item.

Parameters:

object
The text item to get the text from.