borland Packages  Class Hierarchy  jbcl.view Package  Index 

SelectableItemPainter component

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

About the SelectableItemPainter component

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, ...)) ...

SelectableItemPainter variables

Variables implemented in this class

SelectableItemPainter constructors

SelectableItemPainter properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

SelectableItemPainter methods

Methods implemented in this class

Methods implemented in java.lang.Object


SelectableItemPainter variables

inactiveSelectedBg

  protected Color inactiveSelectedBg
The background color of the selected item when the control is inactive.

inactiveSelectedFg

  protected Color inactiveSelectedFg
The foreground color of the selected item when the control is inactive.

paintBackground

  protected boolean paintBackground
Determines whether the background is painted.

painter

  protected transient ItemPainter painter
The nested item painter.

selectedBg

  protected Color selectedBg
The background color of a selected item.

selectedFg

  protected Color selectedFg
The foreground color of a selected item.

site

  protected transient ItemPaintSite site
The ItemPaintSite for this item painter.

state

  protected int state
Contains the state of the item.

SelectableItemPainter constructors

SelectableItemPainter()

  public SelectableItemPainter()
Constructs a SelectableItemPainter using the default settings.

SelectableItemPainter(borland.jbcl.model.ItemPainter)

  public SelectableItemPainter(borland.jbcl.model.ItemPainter painter)
Constructs a SelectableItemPainter with a nested ItemPainter.

Parameters:

painter
The nested item painter.

SelectableItemPainter(borland.jbcl.model.ItemPainter, boolean)

  public SelectableItemPainter(borland.jbcl.model.ItemPainter painter, boolean paintBackground)
Constructs a SelectableItemPainter with a nested ItemPainter.

Parameters:

painter
The nested ItemPainter.
drawBackground
If true, the background is painted before paint calls are passed to the nested ItemPainter. The default value is false.

SelectableItemPainter properties

alignment

 public int getAlignment()
Returns the alignment value from the ItemPaintSite. The alignment value is one of the values of the Alignment variables.

background

 public Color getBackground()
Returns the background color of the item.

font

 public Font getFont()
Returns the font of the item.

foreground

 public Color getForeground()
Returns the foreground color of the item.

inactiveSelectedBackground

 public Color getInactiveSelectedBackground()
 public void setInactiveSelectedBackground(java.awt.Color c)
The inactiveSelectedBackground property defines the color to paint the background when the item is selected and its window is inactive.

inactiveSelectedForeground

 public Color getInactiveSelectedForeground()
 public void setInactiveSelectedForeground(java.awt.Color c)
The inactiveSelectedForeground property defines the color to paint the text when the item is selected and its window is inactive.

itemMargins

 public Insets getItemMargins()
Returns the Insets object that defines the margins around the item.

paintBackground

 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).

painter

 public ItemPainter getPainter()
 public void setPainter(borland.jbcl.model.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.

selectedBackground

 public Color getSelectedBackground()
 public void setSelectedBackground(java.awt.Color c)
The selectedBackground property defines the color to paint the background when the item is selected and its window is active.

selectedForeground

 public Color getSelectedForeground()
 public void setSelectedForeground(java.awt.Color c)
The selectedForeground property defines the color to paint the text when the item is selected and its window is active.

siteComponent

 public Component getSiteComponent()
Returns the ItemPaintSite component for this item painter.

transparent

 public boolean isTransparent()
Returns whether the item is transparent. If true, the item is transparent.