| java.lang.Object java.util.Observable net.sf.jga.swing.spreadsheet.Cell
Cell | public class Cell extends Observable implements Observer(Code) | | A single cell in spreadsheet. Encapsulates information about the generator
that provides the value of the cell, the cell's formatting information, and
the editor and/or renderer used to display/update the cell's contents.
Copyright © 2004-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
| Cell(Spreadsheet parent, Point addr, String formula, boolean editable) Builds a possibly editable cell at the given address, using the formula to build
a generator to retrieve the value. | | Cell(Spreadsheet parent, Class<T> type, Point addr, Generator<T> value) Builds a read-only cell at the given address, using the generator to retrieve the
value. | | Cell(Spreadsheet parent, int row, int col) |
CIRCULAR_REF_ERR | final public static String CIRCULAR_REF_ERR(Code) | | |
CLASS_CAST_ERR | final public static String CLASS_CAST_ERR(Code) | | |
EVALUATION_ERR | final public static String EVALUATION_ERR(Code) | | |
NULL_POINTER_ERR | final public static String NULL_POINTER_ERR(Code) | | |
Cell | Cell(Spreadsheet parent, Point addr, String formula, boolean editable)(Code) | | Builds a possibly editable cell at the given address, using the formula to build
a generator to retrieve the value.
|
clear | public void clear()(Code) | | Clears the contents of the cell, setting to the default type and value.
|
dependsOn | final public Iterator<Cell> dependsOn()(Code) | | returns an iterator over all cells on which this cell directly depends
|
getAddress | public Point getAddress()(Code) | | Returns the address of the cell.
|
getErrorMsg | public String getErrorMsg()(Code) | | Returns the textual description of the last error associated with cell.
The string will be used by the UI. If the cell's value can be retrieved
without error, then this field will be null.
|
getFormula | String getFormula()(Code) | | Returns the formula that describes the cell's contents.
|
getReference | public Generator getReference()(Code) | | Returns a reference to the cell's formula.
|
getType | public Class getType()(Code) | | Returns the type of values held by the cell.
|
getValue | public Object getValue()(Code) | | Returns the value of the cell. If an exception is caught while
evaluating the cell, then this will return null and the getErrorMsg()
method will return a description of the problem.
|
isEditable | public boolean isEditable()(Code) | | Returns true if the cell is editable, false if it is read-only.
|
isUndefined | public boolean isUndefined()(Code) | | Returns true if the cell's value is undefined
|
isValid | public boolean isValid()(Code) | | Returns true if the cell's value can be retrieved without error
|
notifyObservers | public void notifyObservers()(Code) | | Triggers cells (and other observers) that this cell's contents have been
changed.
|
references | public boolean references(Cell c)(Code) | | Returns true if this cell references the given cell, either directly or
indirectly. Also returns true if this cell is the given cell.
|
setEditable | public void setEditable(boolean b)(Code) | | Sets the cell as editable (or not).
|
setFormat | public void setFormat(UnaryFunctor<T, String> formatter)(Code) | | Sets the format of the cell, if formatting is supported by the cell's
renderer. If formatting is not supported, invoking this method will
have no effect.
|
setFormula | final public void setFormula(String formula) throws CircularReferenceException(Code) | | Sets the contents of the cell to the given formula.
|
setFormula | final public void setFormula(Generator formula)(Code) | | Sets the contents of the cell to the given formula, notifying all observers of
the change.
|
setValue | final public void setValue(Object value)(Code) | | Sets the contents of the cell to the given value.
|
unlink | void unlink()(Code) | | Clears the contents of the cell, and sets its state to an invalid state to
force all dependant cells to reparse.
|
|
|