borland Packages  Class Hierarchy  jbcl.view Package  Index 

CustomItemPainter component

java.lang.Object
   +----borland.jbcl.view.CustomItemPainter

About the CustomItemPainter component

Variables  Constructors  Properties  Methods  

Implements CustomPaintSite, ItemPainter, ItemPaintSite, Serializable

CustomItemPainter is an item painter you can subclass to create your own specialized item painter. The painter property allows you to specify an item painter to use to do the painting.

CustomItemPainter implements CustomPaintSite so you can customize the paint site with the background and foreground colors, font, alignment, and margin settings of your choosing. Custom item painters are especially useful for painting items in the cells of a grid. For example, you might want negative numbers in grid cells to be painted red while the others are painted black.

See also: CustomItemListener, CustomItemEditor


CustomItemPainter variables

Variables implemented in this class

CustomItemPainter constructors

CustomItemPainter properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

CustomItemPainter methods

Methods implemented in this class

Methods implemented in java.lang.Object


CustomItemPainter variables

alignment

  protected int alignment

background

  protected Color background

font

  protected Font font

foreground

  protected Color foreground

margins

  protected Insets margins

painter

  protected transient ItemPainter painter

paintSite

  protected transient ItemPaintSite paintSite

CustomItemPainter constructors

CustomItemPainter()

  public CustomItemPainter()
Creates a CustomItemPainter class.

CustomItemPainter(borland.jbcl.model.ItemPainter)

  public CustomItemPainter(borland.jbcl.model.ItemPainter painter)
Creates a CustomItemPainter class using the specified ItemPainter.

Parameters:

painter
The painter to use for your CustomItemPainter.

CustomItemPainter properties

alignment

 public int getAlignment()
 public void setAlignment(int alignment)
Determines the alignment of the item being painted. Use one or some combination of the Alignment variables.

background

 public Color getBackground()
 public void setBackground(java.awt.Color color)
Determines the background color of the item being painted.

font

 public Font getFont()
 public void setFont(java.awt.Font font)
Determines the font of the item being painted.

foreground

 public Color getForeground()
 public void setForeground(java.awt.Color color)
Determines the foreground color of the item being painted.

itemMargins

 public Insets getItemMargins()
 public void setItemMargins(java.awt.Insets margins)
Determines the margins that surround the item being painted.

painter

 public ItemPainter getPainter()
 public void setPainter(borland.jbcl.model.ItemPainter painter)
Determines the item painter used to do the painting.

siteComponent

 public Component getSiteComponent()
Returns the component used as the item paint site.

transparent

 public boolean isTransparent()
Determines whether the background of the item being painted is transparent so objects behind it show through. If it returns true, the item is painted with a transparent background.