borland Packages  Class Hierarchy  jbcl.view Package  Index 

TextItemPainter component

java.lang.Object
   +----borland.jbcl.view.TextItemPainter
           +----borland.jbcl.view.WrappedTextItemPainter
           +----borland.jbcl.view.EllipsisTextItemPainter

About the TextItemPainter component

Variables  Constructors  Properties  Methods  

Implements ItemPainter, Serializable

A text item painter for text views. TextItemPainter 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 regarding 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

alignment

  protected int alignment

background

  protected Color background

foreground

  protected Color foreground

formatter

  protected ItemFormatter formatter

margins

  protected Insets margins

paintBackground

  protected boolean paintBackground

TextItemPainter constructors

TextItemPainter()

  public TextItemPainter()

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

TextItemPainter(borland.jbcl.model.ItemFormatter)

  public TextItemPainter(borland.jbcl.model.ItemFormatter formatter)

TextItemPainter(int)

  public TextItemPainter(int alignment)
Constructs a TextItemPainter aligning the text as specified with the alignment parameter.

Parameters:

alignment
Use one or more of the borland.jbcl.util.Alignment variables.

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 being 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, 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(java.awt.Insets)

  public TextItemPainter(java.awt.Insets margins)
Constructs a TextItemPainter placing the amount of space between the text and the borders specified with the margins parameter.

Parameters:

margins
The Insets object that contains the required spacing.

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.

background

 public Color getBackground()
 public void setBackground(java.awt.Color background)
The background property defines the default background color for the TextItemPainter. If the ItemPaintSite passed into the getPreferredSize() or paint() methods has a valid background color setting, it overrides this one.

See Also: java.awt.Color

foreground

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

formatter

 public ItemFormatter getFormatter()
 public void setFormatter(borland.jbcl.model.ItemFormatter formatter)
The formatter property defines the ItemFormatter to use to format the text passed in the getPreferredSize() and paint() methods.

See Also: borland.jbcl.model.ItemFormatter

margins

 public Insets getMargins()
 public void setMargins(java.awt.Insets margins)
Determines the space between the text for an item and the rectangle reserved for the item.

paintBackground

 public boolean isPaintBackground()
 public void setPaintBackground(boolean paintBackground)
The paintBackground property defines whether the background is filled before drawing the text in the paint() method.

TextItemPainter methods

getText(java.lang.Object)

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

Parameters:

object
The text item to get the text from.