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
-
GridAttributes(Component, Font, Color, Color, int)
- Constructs and creates a new GridAttributes Object using the passed in parameters.
-
GridAttributes(Component, Font, Color, Color, int, int)
- Constructs and creates a new GridAttributes Object using the passed in parameters.
-
beginDrawing(Graphics)
- Saves the Graphics objects drawing state (Font and Color).
-
clone()
- Clones the GridAttributes object.
-
endDrawing(Graphics)
- Restores the Graphics objects drawing state (Font and Color).
-
finalize()
-
-
getAscent()
- Get the Font ascent.
-
getBackColor()
- Get the cell background color.
-
getCellType()
- Get the cell type.
-
getDescent()
- Get the Font descent.
-
getFont()
- Get the Font.
-
getFontMetrics()
- Get the FontMetrics.
-
getHeight()
- Get the Font height.
-
getJustification()
- Get the Justification style.
-
getLeading()
- Get the Font leading.
-
getTextColor()
- Get the cell text color.
-
setBackColor(Color)
- Set the cell background color.
-
setCellType(int)
- Set the cell type.
-
setFont(Font)
- Set the Font.
-
setJustification(int)
- Set the Justification style.
-
setTextColor(Color)
- Set the cell text color.
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
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
finalize
protected void finalize()
- Overrides:
- finalize in class Object
clone
public synchronized Object clone()
- Clones the GridAttributes object.
- Overrides:
- clone in class Object
getHeight
public final int getHeight()
- Get the Font height.
- Returns:
- the Font height, based on the FontMetrics
getAscent
public final int getAscent()
- Get the Font ascent.
- Returns:
- the Font ascent, based on the FontMetrics
getDescent
public final int getDescent()
- Get the Font descent.
- Returns:
- the Font descent, based on the FontMetrics
getLeading
public final int getLeading()
- Get the Font leading.
- Returns:
- the Font leading, based on the FontMetrics
getFont
public final Font getFont()
- Get the Font.
- Returns:
- the Font
setFont
public final void setFont(Font aFont)
- Set the Font.
- Parameters:
- aFont - the Font
getFontMetrics
public final FontMetrics getFontMetrics()
- Get the FontMetrics.
- Returns:
- the FontMetrics
getJustification
public final int getJustification()
- Get the Justification style.
- Returns:
- the Justification style
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
getCellType
public final int getCellType()
- Get the cell type.
- Returns:
- the cell type
setCellType
public final void setCellType(int cellType)
- Set the cell type.
- Parameters:
- cellType - the cell type
getBackColor
public final Color getBackColor()
- Get the cell background color.
- Returns:
- the background color
setBackColor
public final void setBackColor(Color backColor)
- Set the cell background color.
- Parameters:
- backColor - the background color
getTextColor
public final Color getTextColor()
- Get the cell text color.
- Returns:
- the text color
setTextColor
public final void setTextColor(Color textColor)
- Set the cell text color.
- Parameters:
- textColor - the text color
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
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