borland Packages Class Hierarchy jbcl.view Package Index
java.lang.Object +----borland.jbcl.view.TextItemPainter +----borland.jbcl.view.WrappedTextItemPainter +----borland.jbcl.view.EllipsisTextItemPainter
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
protected int alignment
protected Color background
protected Color foreground
protected ItemFormatter formatter
protected Insets margins
protected boolean paintBackground
public TextItemPainter()
Constructs a TextItemPainter with LEFT alignment, MIDDLE vertical alignment, insets (1,1,1,1), and checkDisabled = false.
public TextItemPainter(borland.jbcl.model.ItemFormatter formatter)
public TextItemPainter(int alignment)Constructs a TextItemPainter aligning the text as specified with the alignment parameter.
Parameters:
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 being false.
Parameters:
public TextItemPainter(int alignment, java.awt.Insets margins, borland.jbcl.model.ItemFormatter formatter)
Constructs a TextItemPainter.
Parameters:
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:
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 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.
public Color getForeground() public void setForeground(java.awt.Color c)The foreground text color.
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
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.
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.
protected String getText(java.lang.Object data)Returns the text string for the specified data item.
Parameters: