Class JGrid.JCell
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JGrid.JCell

Object
   |
   +----ICell
           |
           +----JGrid.JCell

public class JCell
extends ICell
This class defines several frequently used cell types, i.e. normal string, stock, currency.


Variable Index

 o CURRENCYCELL
currency type
 o DEFAULTBGCOLOR
default background color
 o DEFAULTFONT
default font
 o DEFAULTHLCOLOR
default highlight color
 o DEFAULTHLTEXTCOLOR
default highlight text color
 o DEFAULTTEXTCOLOR
default text color
 o NORMALCELL
normal string
 o STOCKCELL
stock type
 o alignment
text alignment
 o tailImg
Images(up & down arrows) used for the cells with stock type; they are shared globally.

Constructor Index

 o JGrid.JCell()

Method Index

 o draw(Graphics, JGrid2)
Call this method to draw the contents of the cell in the rectangle rect with default values.
 o setFeature(String)
set the features of the cell
For JCell, feature has the format "type,background color,text color,alignment"
where: type should be NORMALCELL,STOCKCELL,CURRENCYCELL
background color and text color are in hex format.
 o setValue(Object)
set a new value to the cell

Variables

 o CURRENCYCELL
public static final int CURRENCYCELL
currency type

 o DEFAULTBGCOLOR
protected static final java.awt.Color DEFAULTBGCOLOR
default background color

 o DEFAULTFONT
protected static final java.awt.Font DEFAULTFONT
default font

 o DEFAULTHLCOLOR
protected static final java.awt.Color DEFAULTHLCOLOR
default highlight color

 o DEFAULTHLTEXTCOLOR
protected static final java.awt.Color DEFAULTHLTEXTCOLOR
default highlight text color

 o DEFAULTTEXTCOLOR
protected static final java.awt.Color DEFAULTTEXTCOLOR
default text color

 o NORMALCELL
public static final int NORMALCELL
normal string

 o STOCKCELL
public static final int STOCKCELL
stock type

 o alignment
protected int alignment
text alignment

 o tailImg
public static java.awt.Image[] tailImg
Images(up & down arrows) used for the cells with stock type; they are shared globally.

Constructors

 o JCell
public JCell()

Methods

 o draw
protected void draw(Graphics g,
                    JGrid2 grid)
Call this method to draw the contents of the cell in the rectangle rect with default values.

Parameters:
rect - rectangle where the cell is drawn
g - graphics context
grid - the grid itself
Overrides:
draw in class ICell
 o setFeature
public void setFeature(String feature)
set the features of the cell
For JCell, feature has the format "type,background color,text color,alignment"
where: type should be NORMALCELL,STOCKCELL,CURRENCYCELL
background color and text color are in hex format. For example, "FFFFFF"
alignment can be Label.CENTER,Label.LEFT,Label.RIGHT

Parameters:
feature - the new feature for the cell
Overrides:
setFeature in class ICell
 o setValue
public void setValue(Object value)
set a new value to the cell

Parameters:
value - new value for the cell
Overrides:
setValue in class ICell

All Packages  Class Hierarchy  This Package  Previous  Next  Index