net.sf.jeppers.grid
Class DefaultCellStyle

java.lang.Object
  |
  +--net.sf.jeppers.grid.DefaultCellStyle
All Implemented Interfaces:
CellStyle

public class DefaultCellStyle
extends Object
implements CellStyle

Default implementation of CellStyle.

Author:
Cameron Zemek

Constructor Summary
DefaultCellStyle()
          Constructs the default CellStyle.
DefaultCellStyle(CellStyle parent)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCellStyle

public DefaultCellStyle()
Constructs the default CellStyle.


DefaultCellStyle

public DefaultCellStyle(CellStyle parent)
Method Detail

copy

public CellStyle copy()
Description copied from interface: CellStyle
Return a new object that is a duplicate of this CellStyle

Specified by:
copy in interface CellStyle
Returns:
duplicate CellStyle

getFormat

public Format getFormat()
Description copied from interface: CellStyle
Returns the formatting to use for rendering cell text.

Specified by:
getFormat in interface CellStyle
Returns:
the format to use to render text

setFormat

public void setFormat(Format format)
Description copied from interface: CellStyle
Set the format to use to render cell text.

Specified by:
setFormat in interface CellStyle
Parameters:
format - the cell format

getFont

public Font getFont()
Description copied from interface: CellStyle
Return the font to use for rendering cell text.

Specified by:
getFont in interface CellStyle
Returns:
font to render text

setFont

public void setFont(Font f)
Description copied from interface: CellStyle
Set the font to use to render cell text.

Specified by:
setFont in interface CellStyle
Parameters:
f - font to render cell text

getBorder

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

Specified by:
getBorder in interface CellStyle
Returns:
cell border

setBorder

public void setBorder(Border cellBorder)
Description copied from interface: CellStyle
Sets the border to paint around the edges of the cell.

Specified by:
setBorder in interface CellStyle
Parameters:
cellBorder - the new cell border

getForegroundColor

public Color getForegroundColor()
Description copied from interface: CellStyle
Return the color to use for rendering cell text.

Specified by:
getForegroundColor in interface CellStyle
Returns:
cell text color

setForegroundColor

public void setForegroundColor(Color c)
Description copied from interface: CellStyle
Sets the color to use for rendering cell text.

Specified by:
setForegroundColor in interface CellStyle
Parameters:
c - the new cell text color

getBackgroundColor

public Color getBackgroundColor()
Description copied from interface: CellStyle
Returns the background color of the cell.

Specified by:
getBackgroundColor in interface CellStyle
Returns:
cell background color

setBackgroundColor

public void setBackgroundColor(Color c)
Description copied from interface: CellStyle
Sets the background color of the cell.

Specified by:
setBackgroundColor in interface CellStyle
Parameters:
c - the cell background color

getHorizontalAlignment

public int getHorizontalAlignment()
Description copied from interface: CellStyle
Returns the horizontal alignment of the cell text.

Specified by:
getHorizontalAlignment in interface CellStyle
Returns:
SwingContants.LEFT || SwingConstants.CENTER || SwingConstants.RIGHT

setHorizontalAlignment

public void setHorizontalAlignment(int hAlign)
Description copied from interface: CellStyle
Set the horizontal alignment of the cell text.

Specified by:
setHorizontalAlignment in interface CellStyle
Parameters:
hAlign - one of SwingContants.LEFT, SwingConstants.CENTER, or SwingConstants.RIGHT

getVerticalAlignment

public int getVerticalAlignment()
Description copied from interface: CellStyle
Returns the vertical alignment of the cell text.

Specified by:
getVerticalAlignment in interface CellStyle
Returns:
SwingContants.TOP || SwingConstants.CENTER || SwingConstants.BOTTOM

setVerticalAlignment

public void setVerticalAlignment(int vAlign)
Description copied from interface: CellStyle
Set the vertical alignment of the cell text.

Specified by:
setVerticalAlignment in interface CellStyle

getPadding

public Insets getPadding()
Description copied from interface: CellStyle
Returns the padding to be used around the cell text.

Specified by:
getPadding in interface CellStyle
Returns:
an Insets that represents the padding

setPadding

public void setPadding(Insets padding)
Description copied from interface: CellStyle
Sets the padding to be used around the cell text.

Specified by:
setPadding in interface CellStyle
Parameters:
padding - the new cell padding