jbcl.view Package
java.lang.Object +----com.borland.jbcl.view.SelectableItemPainter +----com.borland.jbcl.view.SelectableTextItemPainter
Variables Constructors Properties Methods
Implements ItemPainter, ItemPaintSite, Serializable
An item painter for selectable items. SelectableItemPainter
fills the passed rectangle to
it with background and foreground colors based on state information and passes the paint calls on
to its contained item painter. This item painter overrides the background and foreground properties
of the ItemPaintSite
, thus allowing
the nested item painter to use the correct selection colors.
With the deprecation of the SelectableTextItemPainter
class in JBuilder 2.0,
code that used to call the SelectableTextItemPainter
class should call the API from this
and the TextItemPainter
classes.
Code that used the SelectableTextItemPainter
class previously looked similar to:
new SelectableTextItemPainter(arg1, arg2, ...) ...whereas code using the new
SelectableItemPainter
and TextItemPainter
classes
looks like:
new SelectableItemPainter(new TextItemPainter(arg1, arg2, ...)) ...
protected Color inactiveSelectedBgThe background color of the selected item when the control is inactive.
protected Color inactiveSelectedFgThe foreground color of the selected item when the control is inactive.
protected boolean paintBackgroundDetermines whether the background is painted.
protected transient ItemPainter painterThe nested item painter.
protected Color selectedBgThe background color of a selected item.
protected Color selectedFgThe foreground color of a selected item.
protected transient ItemPaintSite siteThe
ItemPaintSite
for this item painter.
protected int stateContains the state of the item.
public SelectableItemPainter()Constructs a
SelectableItemPainter
using the default settings.
public SelectableItemPainter(ItemPainter painter)Constructs a
SelectableItemPainter
with a nested ItemPainter
.
Parameters:
painter
public SelectableItemPainter(ItemPainter painter, boolean paintBackground)Constructs a
SelectableItemPainter
with a nested ItemPainter
.
Parameters:
painter
ItemPainter
.
drawBackground
public int getAlignment()Returns the alignment value from the
ItemPaintSite
. The alignment value is one of the values of the Alignment variables.
public Color getBackground()Returns the background color of the item.
public Font getFont()Returns the font of the item.
public Color getForeground()Returns the foreground color of the item.
public Color getInactiveSelectedBackground() public void setInactiveSelectedBackground(Color c)The
inactiveSelectedBackground
property defines the color to paint the background when the item is selected and its window is inactive.
public Color getInactiveSelectedForeground() public void setInactiveSelectedForeground(Color c)The
inactiveSelectedForeground
property defines the color to paint the text when the item is selected and its window is inactive.
public Insets getItemMargins()Returns the
Insets
object that defines the margins around the item.
public boolean isPaintBackground() public void setPaintBackground(boolean paintBackground)The
paintBackground
property defines whether the background is filled before passing the paint()
method call on to the nested item painter. By default, this property is false, and the proper colors are passed via the ItemPaintSite
interface to the nested item painter. If set to true, this item painter paints the background, then passes the paint call to the nested item painter (which may or may not also paint the background).
public ItemPainter getPainter() public void setPainter(ItemPainter painter)The
painter
property defines the nested item painter(s) that receive all item painter method calls after the SelectableItemPainter
has drawn the appropriate background.
public Color getSelectedBackground() public void setSelectedBackground(Color c)The
selectedBackground
property defines the color to paint the background when the item is selected and its window is active.
public Color getSelectedForeground() public void setSelectedForeground(Color c)The
selectedForeground
property defines the color to paint the text when the item is selected and its window is active.
public Component getSiteComponent()Returns the
ItemPaintSite
component for this item painter.
public boolean isTransparent()Returns whether the item is transparent. If true, the item is transparent.