net.sf.jeppers.grid
Interface CellStyle

All Known Implementing Classes:
DefaultCellStyle

public interface CellStyle

Provides rendering information about a cell.

Author:
Cameron Zemek

Method Summary
 CellStyle copy()
          Return a new object that is a duplicate of this CellStyle
 Color getBackgroundColor()
          Returns the background color of the cell.
 Border getBorder()
          Returns the border to paint around the cell.
 Font getFont()
          Return the font to use for rendering cell text.
 Color getForegroundColor()
          Return the color to use for rendering cell text.
 Format getFormat()
          Returns the formatting to use for rendering cell text.
 int getHorizontalAlignment()
          Returns the horizontal alignment of the cell text.
 Insets getPadding()
          Returns the padding to be used around the cell text.
 int getVerticalAlignment()
          Returns the vertical alignment of the cell text.
 void setBackgroundColor(Color c)
          Sets the background color of the cell.
 void setBorder(Border cellBorder)
          Sets the border to paint around the edges of the cell.
 void setFont(Font f)
          Set the font to use to render cell text.
 void setForegroundColor(Color c)
          Sets the color to use for rendering cell text.
 void setFormat(Format format)
          Set the format to use to render cell text.
 void setHorizontalAlignment(int hAlign)
          Set the horizontal alignment of the cell text.
 void setPadding(Insets padding)
          Sets the padding to be used around the cell text.
 void setVerticalAlignment(int vAlign)
          Set the vertical alignment of the cell text.
 

Method Detail

getFormat

public Format getFormat()
Returns the formatting to use for rendering cell text.

Returns:
the format to use to render text

setFormat

public void setFormat(Format format)
Set the format to use to render cell text.

Parameters:
format - the cell format

getFont

public Font getFont()
Return the font to use for rendering cell text.

Returns:
font to render text

setFont

public void setFont(Font f)
Set the font to use to render cell text.

Parameters:
f - font to render cell text

getBorder

public Border getBorder()
Returns the border to paint around the cell. Painting of the cell border is handled by JGrid since borders are shared with adjancent cells.

Returns:
cell border

setBorder

public void setBorder(Border cellBorder)
Sets the border to paint around the edges of the cell.

Parameters:
cellBorder - the new cell border

getForegroundColor

public Color getForegroundColor()
Return the color to use for rendering cell text.

Returns:
cell text color

setForegroundColor

public void setForegroundColor(Color c)
Sets the color to use for rendering cell text.

Parameters:
c - the new cell text color

getBackgroundColor

public Color getBackgroundColor()
Returns the background color of the cell.

Returns:
cell background color

setBackgroundColor

public void setBackgroundColor(Color c)
Sets the background color of the cell.

Parameters:
c - the cell background color

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment of the cell text.

Returns:
SwingContants.LEFT || SwingConstants.CENTER || SwingConstants.RIGHT

setHorizontalAlignment

public void setHorizontalAlignment(int hAlign)
Set the horizontal alignment of the cell text.

Parameters:
hAlign - one of SwingContants.LEFT, SwingConstants.CENTER, or SwingConstants.RIGHT

getVerticalAlignment

public int getVerticalAlignment()
Returns the vertical alignment of the cell text.

Returns:
SwingContants.TOP || SwingConstants.CENTER || SwingConstants.BOTTOM

setVerticalAlignment

public void setVerticalAlignment(int vAlign)
Set the vertical alignment of the cell text.


getPadding

public Insets getPadding()
Returns the padding to be used around the cell text.

Returns:
an Insets that represents the padding

setPadding

public void setPadding(Insets padding)
Sets the padding to be used around the cell text.

Parameters:
padding - the new cell padding

copy

public CellStyle copy()
Return a new object that is a duplicate of this CellStyle

Returns:
duplicate CellStyle