jbcl.view Package
java.lang.Object +----com.borland.jbcl.view.TextItemPainter +----com.borland.jbcl.view.EllipsisTextItemPainter +----com.borland.jbcl.view.WrappedTextItemPainter
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.
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(ItemFormatter formatter)
public TextItemPainter(int alignment)Constructs a
TextItemPainter
aligning the text as specified with the alignment
parameter.
Parameters:
alignment
Constructs a TextItemPainter
with insets of (1,1,1,1) and checkDisabled
= false.
Parameters:
alignment
util.Alignment
.
public TextItemPainter(int alignment, Insets margins)
Constructs a TextItemPainter
with checkDisabled being false.
Parameters:
alignment
util.Alignment
.
margins
public TextItemPainter(int alignment, Insets margins, ItemFormatter formatter)
Constructs a TextItemPainter
.
Parameters:
alignment
util.Alignment
.
margins
formatter
public TextItemPainter(Insets margins)Constructs a
TextItemPainter
placing the amount of space between the text and the borders specified with the margins
parameter.
Parameters:
margins
Insets
object that contains the required spacing.
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(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(Color c)The foreground text color.
public ItemFormatter getFormatter() public void setFormatter(ItemFormatter formatter)The
formatter
property defines the ItemFormatter
to use to format the text passed in the getPreferredSize()
and paint()
methods.
See Also: com.borland.dx.text.ItemFormatter
public Insets getMargins() public void setMargins(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(Object data)Returns the text string for the specified data item.
Parameters:
object