This Package  Previous  Next  Index

Class CoffeeTable.Grid.GridAttributes

java.lang.Object
   |
   +----CoffeeTable.Grid.GridAttributes

public class GridAttributes
extends Object
implements Cloneable
GridAttributes is a class that encapsulates the drawing attributes for a grid's cells, row, columns and header. It contains a Font, text Color, background Color and justification information that will be used by the GridPanel while drawing.

Version:
1.2.10 of September 15, 1999 Copyright © 1996-1999 3magic
Author:
Anil Bajaj

Constructor Index

 o GridAttributes(Component, Font, Color, Color, int)
Constructs and creates a new GridAttributes Object using the passed in parameters.
 o GridAttributes(Component, Font, Color, Color, int, int)
Constructs and creates a new GridAttributes Object using the passed in parameters.

Method Index

 o beginDrawing(Graphics)
Saves the Graphics objects drawing state (Font and Color).
 o clone()
Clones the GridAttributes object.
 o endDrawing(Graphics)
Restores the Graphics objects drawing state (Font and Color).
 o finalize()
 o getAscent()
Get the Font ascent.
 o getBackColor()
Get the cell background color.
 o getCellType()
Get the cell type.
 o getDescent()
Get the Font descent.
 o getFont()
Get the Font.
 o getFontMetrics()
Get the FontMetrics.
 o getHeight()
Get the Font height.
 o getJustification()
Get the Justification style.
 o getLeading()
Get the Font leading.
 o getTextColor()
Get the cell text color.
 o setBackColor(Color)
Set the cell background color.
 o setCellType(int)
Set the cell type.
 o setFont(Font)
Set the Font.
 o setJustification(int)
Set the Justification style.
 o setTextColor(Color)
Set the cell text color.

Constructors

 o GridAttributes
 public GridAttributes(Component itsComponent,
                       Font aFont,
                       Color textColor,
                       Color backColor,
                       int justification)
Constructs and creates a new GridAttributes Object using the passed in parameters. If a Font is specified it gets the FontMetrics for that font as well.

Parameters:
itsComponent - a component used to get the font metrics, can pass a reference to the Applet
aFont - the Font
textColor - the text Color
backColor - the background Color
justification - the justification style (GridPanel.JUST_LEFT, GridPanel.JUST_CENTER, GridPanel.JUST_RIGHT), you can specify word wrapping by doing a bitwise OR with GridPanel.WORD_WRAP or truncate (with ellipsis) by by doing a bitwise OR with GridPanel.TRUNC_STRING
 o GridAttributes
 public GridAttributes(Component itsComponent,
                       Font aFont,
                       Color textColor,
                       Color backColor,
                       int justification,
                       int cellType)
Constructs and creates a new GridAttributes Object using the passed in parameters. If a Font is specified it gets the FontMetrics for that font as well.

Parameters:
itsComponent - a component used to get the font metrics, can pass a reference to the Applet
aFont - the Font
textColor - the text Color
backColor - the background Color
justification - the justification style (GridPanel.JUST_LEFT, GridPanel.JUST_CENTER, GridPanel.JUST_RIGHT), you can specify word wrapping by doing a bitwise OR with GridPanel.WORD_WRAP or truncate (with ellipsis) by by doing a bitwise OR with GridPanel.TRUNC_STRING
cellType - the cell type

Methods

 o finalize
 protected void finalize()
Overrides:
finalize in class Object
 o clone
 public synchronized Object clone()
Clones the GridAttributes object.

Overrides:
clone in class Object
 o getHeight
 public final int getHeight()
Get the Font height.

Returns:
the Font height, based on the FontMetrics
 o getAscent
 public final int getAscent()
Get the Font ascent.

Returns:
the Font ascent, based on the FontMetrics
 o getDescent
 public final int getDescent()
Get the Font descent.

Returns:
the Font descent, based on the FontMetrics
 o getLeading
 public final int getLeading()
Get the Font leading.

Returns:
the Font leading, based on the FontMetrics
 o getFont
 public final Font getFont()
Get the Font.

Returns:
the Font
 o setFont
 public final void setFont(Font aFont)
Set the Font.

Parameters:
aFont - the Font
 o getFontMetrics
 public final FontMetrics getFontMetrics()
Get the FontMetrics.

Returns:
the FontMetrics
 o getJustification
 public final int getJustification()
Get the Justification style.

Returns:
the Justification style
 o setJustification
 public final void setJustification(int justification)
Set the Justification style.

Parameters:
justification - the justification style (GridPanel.JUST_LEFT, GridPanel.JUST_CENTER, GridPanel.JUST_RIGHT), you can specify word wrapping by doing a bitwise OR with GridPanel.WORD_WRAP or truncate (with ellipsis) by by doing a bitwise OR with GridPanel.TRUNC_STRING
 o getCellType
 public final int getCellType()
Get the cell type.

Returns:
the cell type
 o setCellType
 public final void setCellType(int cellType)
Set the cell type.

Parameters:
cellType - the cell type
 o getBackColor
 public final Color getBackColor()
Get the cell background color.

Returns:
the background color
 o setBackColor
 public final void setBackColor(Color backColor)
Set the cell background color.

Parameters:
backColor - the background color
 o getTextColor
 public final Color getTextColor()
Get the cell text color.

Returns:
the text color
 o setTextColor
 public final void setTextColor(Color textColor)
Set the cell text color.

Parameters:
textColor - the text color
 o beginDrawing
 public final void beginDrawing(Graphics g)
Saves the Graphics objects drawing state (Font and Color). This is used by the GridPanel drawing methods before changing any setting for drawing. You should call endDrawing after finishing all drawing.

Parameters:
g - the Graphics object
See Also:
endDrawing
 o endDrawing
 public final void endDrawing(Graphics g)
Restores the Graphics objects drawing state (Font and Color). This is used by the GridPanel drawing methods after finishing the drawing. You should call this method after finishing all drawing.

See Also:
beginDrawing

This Package  Previous  Next  Index