public class StylableCell extends CellExtension
Modifier and Type | Field and Description |
---|---|
static Color |
BACKGROUND
The default background color
|
static Border |
BORDER
The default empty border
|
static DateFormat |
DATE_FORMAT
The default date format
|
static Font |
FONT
The default font
|
static Color |
FOREGROUND
The default foreground color
|
static NumberFormat |
NUMBER_FORMAT
The default number format
|
static int |
VERTICAL_ALIGNMENT
The default vertical alignment
|
Constructor and Description |
---|
StylableCell(Cell cell)
Creates a stylable cell extension for the given cell.
|
Modifier and Type | Method and Description |
---|---|
void |
cellCleared(Cell cell)
Removes the style from the cell.
|
void |
cellCopied(Cell cell,
Cell source)
Copies the style from the source cell to this one.
|
Color |
getBackgroundColor()
Returns the background color of the cell.
|
Border |
getBorder()
Returns the border of the cell.
|
Font |
getFont()
Returns the font used when rendering the cell's content.
|
Color |
getForegroundColor()
Returns the color used when rendering the cell's content.
|
Format |
getFormat()
Returns the format applied to the cell's value before rendering.
|
int |
getHorizontalAlignment()
Returns the horizontal alignment of the cell's content.
|
int |
getVerticalAlignment()
Returns the vertical alignment of the cell's content.
|
boolean |
isFormattable()
Returns whether a format can be applied to the cell's value.
|
void |
resetStyle()
Restes the style of the cell.
|
void |
setBackgroundColor(Color bgColor)
Sets the background color of the cell.
|
void |
setBorder(Border border)
Sets the border of the cell.
|
void |
setFont(Font font)
Sets the font used when rendering the cell's content.
|
void |
setForegroundColor(Color fgColor)
Sets the color used when rendering the cell's content.
|
void |
setFormat(Format format)
Sets the format applied to the cell's value before rendering.
|
void |
setHorizontalAlignment(int hAlignment)
Sets the horizontal alignment of the cell's content.
|
void |
setVerticalAlignment(int vAlignment)
Sets the vertical alignment of the cell's content.
|
addCellListener, clear, compareTo, contentChanged, copyFrom, dependentsChanged, getAddress, getCellListeners, getContent, getDelegate, getDependents, getExtension, getFormula, getName, getPrecedents, getSpreadsheet, getValue, moveFrom, removeCellListener, setContent, toString, valueChanged
public static final NumberFormat NUMBER_FORMAT
public static final DateFormat DATE_FORMAT
public static final int VERTICAL_ALIGNMENT
public static final Color FOREGROUND
public static final Color BACKGROUND
StylableCell(Cell cell)
cell
- the cell to extendpublic boolean isFormattable()
public Format getFormat()
public Font getFont()
public int getHorizontalAlignment()
public int getVerticalAlignment()
public Color getForegroundColor()
public Color getBackgroundColor()
public void setFormat(Format format)
format
- the format applied to the cell's value before renderingpublic void setFont(Font font)
font
- the font used when rendering the cell's contentpublic void setHorizontalAlignment(int hAlignment)
hAlignment
- the horizontal alignment of the cell's contentpublic void setVerticalAlignment(int vAlignment)
vAlignment
- the vertical alignment of the cell's contentpublic void setForegroundColor(Color fgColor)
fgColor
- the color used when rendering the cell's contentpublic void setBackgroundColor(Color bgColor)
bgColor
- the background color of the cellpublic void setBorder(Border border)
border
- the border of the cellpublic void resetStyle()
public void cellCleared(Cell cell)
cellCleared
in interface CellListener
cellCleared
in class CellExtension
cell
- the cell that was modifiedpublic void cellCopied(Cell cell, Cell source)
cellCopied
in interface CellListener
cellCopied
in class CellExtension
cell
- the cell that was modifiedsource
- the cell from which data was copied