|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable net.sf.jga.swing.spreadsheet.Cell
public class Cell
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
Field Summary | |
---|---|
static java.lang.String |
CIRCULAR_REF_ERR
|
static java.lang.String |
CLASS_CAST_ERR
|
static java.lang.String |
EVALUATION_ERR
|
static java.lang.String |
NULL_POINTER_ERR
|
static java.lang.String |
PARSER_ERR
|
static java.lang.String |
REFERENCE_ERR
|
static java.lang.String |
UNDEFINED_ERR
|
Method Summary | ||
---|---|---|
void |
clear()
Clears the contents of the cell, setting to the default type and value. |
|
java.util.Iterator<Cell> |
dependsOn()
returns an iterator over all cells on which this cell directly depends |
|
java.awt.Point |
getAddress()
Returns the address of the cell. |
|
javax.swing.table.TableCellEditor |
getEditor()
Returns the component used to edit the cell |
|
java.lang.String |
getErrorMsg()
Returns the textual description of the last error associated with cell. |
|
java.lang.String |
getName()
|
|
Generator<?> |
getReference()
Returns a reference to the cell's formula. |
|
javax.swing.table.TableCellRenderer |
getRenderer()
Returns the renderer used to paint the cell |
|
java.lang.Class<?> |
getType()
Returns the type of values held by the cell. |
|
java.lang.Object |
getValue()
Returns the value of the cell. |
|
boolean |
isEditable()
Returns true if the cell is editable, false if it is read-only. |
|
boolean |
isUndefined()
Returns true if the cell's value is undefined |
|
boolean |
isValid()
Returns true if the cell's value can be retrieved without error |
|
void |
notifyObservers()
Triggers cells (and other observers) that this cell's contents have been changed. |
|
boolean |
references(Cell c)
Returns true if this cell references the given cell, either directly or indirectly. |
|
void |
setEditable(boolean b)
Sets the cell as editable (or not). |
|
void |
setEditor(javax.swing.table.TableCellEditor editor)
Sets the component used to edit the cell |
|
|
setFormat(UnaryFunctor<T,java.lang.String> formatter)
Sets the format of the cell, if formatting is supported by the cell's renderer. |
|
void |
setFormula(Generator<?> formula)
Sets the contents of the cell to the given formula, notifying all observers of the change. |
|
void |
setFormula(java.lang.String formula)
Sets the contents of the cell to the given formula. |
|
void |
setRenderer(javax.swing.table.TableCellRenderer renderer)
Sets the component used to paint the cell |
|
|
setValue(V value)
Sets the contents of the cell to the given value. |
|
java.lang.String |
toString()
|
|
void |
update(java.util.Observable observable,
java.lang.Object object)
|
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_CAST_ERR
public static final java.lang.String EVALUATION_ERR
public static final java.lang.String CIRCULAR_REF_ERR
public static final java.lang.String NULL_POINTER_ERR
public static final java.lang.String REFERENCE_ERR
public static final java.lang.String UNDEFINED_ERR
public static final java.lang.String PARSER_ERR
Method Detail |
---|
public java.lang.String getName()
public java.lang.Class<?> getType()
public boolean isEditable()
public void setEditable(boolean b)
public java.awt.Point getAddress()
public javax.swing.table.TableCellRenderer getRenderer()
public void setRenderer(javax.swing.table.TableCellRenderer renderer)
public javax.swing.table.TableCellEditor getEditor()
public void setEditor(javax.swing.table.TableCellEditor editor)
public boolean isValid()
public boolean isUndefined()
public java.lang.String getErrorMsg()
public java.lang.Object getValue()
public void clear()
public final <V> void setValue(V value)
public final void setFormula(java.lang.String formula) throws net.sf.jga.swing.spreadsheet.CircularReferenceException
net.sf.jga.swing.spreadsheet.CircularReferenceException
public final void setFormula(Generator<?> formula)
public <T> void setFormat(UnaryFunctor<T,java.lang.String> formatter)
java.lang.ClassCastException
- if the generic type of the formatter is not
compatable with the generic type of the cell's rendererpublic Generator<?> getReference()
public boolean references(Cell c)
public final java.util.Iterator<Cell> dependsOn()
public java.lang.String toString()
toString
in class java.lang.Object
public void update(java.util.Observable observable, java.lang.Object object)
update
in interface java.util.Observer
public void notifyObservers()
notifyObservers
in class java.util.Observable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |