|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsheets.ext.CellExtension
csheets.ext.style.StylableCell
public class StylableCell
An extension of a cell in a spreadsheet, with support for style, i.e. font, format, alignment, color and border.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
StylableCell(Cell cell)
Creates a stylable cell extension for the given cell. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class csheets.ext.CellExtension |
|---|
addCellListener, clear, compareTo, contentChanged, copyFrom, dependentsChanged, getAddress, getCellListeners, getContent, getDelegate, getDependents, getExtension, getFormula, getName, getPrecedents, getSpreadsheet, getValue, moveFrom, removeCellListener, setContent, toString, valueChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final NumberFormat NUMBER_FORMAT
public static final DateFormat DATE_FORMAT
public static final Font FONT
public static final int VERTICAL_ALIGNMENT
public static final Color FOREGROUND
public static final Color BACKGROUND
public static final Border BORDER
| Constructor Detail |
|---|
StylableCell(Cell cell)
cell - the cell to extend| Method Detail |
|---|
public boolean isFormattable()
public Format getFormat()
public Font getFont()
public int getHorizontalAlignment()
public int getVerticalAlignment()
public Color getForegroundColor()
public Color getBackgroundColor()
public Border getBorder()
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 CellListenercellCleared in class CellExtensioncell - the cell that was modified
public void cellCopied(Cell cell,
Cell source)
cellCopied in interface CellListenercellCopied in class CellExtensioncell - the cell that was modifiedsource - the cell from which data was copied
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||