|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.swing.table.AbstractTableModel
|
+--com.rubecula.spreadsheet.SpreadsheetModel
Class to provide the underlying model for the spreadsheet application.
| Field Summary | |
(package private) java.lang.Object[][] |
_Cells
|
(package private) java.lang.String[] |
_ColumnNames
|
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
SpreadsheetModel()
Construct a new spreadsheet model. |
|
| Method Summary | |
java.lang.String |
audit()
Method to return a detailed (unlabeled) string from an object for debugging purposes. |
void |
audit(java.io.PrintStream out,
java.lang.String label)
Method to output detailed string from an object for debugging purposes. |
java.lang.String |
audit(java.lang.String label)
Method to return a detailed string from an arithmetical object for debugging purposes. |
(package private) java.lang.String |
auditCell(int row,
int col)
|
java.util.Iterator |
getCells()
|
static java.lang.String |
GetColName(int col)
Get a name for this column in the form of a letter or sequence of letters. |
int |
getColumnCount()
|
java.lang.String |
getColumnName(int col)
|
java.lang.String |
getIdentifier()
Method to get the specific identifier for an object. |
static PresentationFactoryInterface |
GetPresentationFactory()
|
int |
getRowCount()
|
static java.lang.String |
GetRowName(int row)
Get a name for this row in the form of a number. |
java.lang.Object |
getValueAt(int row,
int col)
|
boolean |
isCellEditable(int row,
int col)
Don't need to implement this method unless your table's editable. |
boolean |
isDirty()
|
void |
makeCell(Presentable value,
int row,
int col)
|
void |
makeCell(Presentable value,
int row,
int col,
java.lang.String name)
|
void |
makeCell(Presentation persentation,
int row,
int col)
|
void |
makeCell(Presentation presentation,
int row,
int col,
java.lang.String name)
|
void |
makeCell(QuantityCell cell,
int row,
int col)
|
void |
makeCell(java.lang.String value,
int row,
int col)
|
void |
makeCell(java.lang.String formula,
int row,
int col,
java.lang.String name)
|
(package private) void |
open(java.io.InputStream stream)
Method to populate a the current spreadsheet by loading the properties file referenced by stream. |
void |
removeAttribute(java.lang.String attr,
int row,
int col)
Method to unset an attribute for this cell. |
(package private) void |
save(java.io.OutputStream stream)
Method to store the current spreadsheet by creating a properties file referenced by stream. |
void |
setAttribute(java.lang.String attr,
java.lang.String value,
int row,
int col)
Method to set/reset an attribute for this cell. |
void |
setDirty(boolean dirty)
|
void |
setDirtyAll()
|
void |
setValueAt(java.lang.Object value,
int row,
int col)
Don't need to implement this method unless your table's data can change. |
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
final java.lang.String[] _ColumnNames
java.lang.Object[][] _Cells
| Constructor Detail |
public SpreadsheetModel()
| Method Detail |
void open(java.io.InputStream stream)
stream - a properties file (or null).
See http://java.sun.com/j2se/1.4/docs/api/java/util/Properties.html#loadvoid save(java.io.OutputStream stream)
stream - a properties file.
See http://java.sun.com/j2se/1.4/docs/api/java/util/Properties.html#load
public void makeCell(QuantityCell cell,
int row,
int col)
cell - a QuantityCell which is to be stored in the specified cell.row - the spreadsheet row counting from 1 up.col - the spreadsheet column counting from 1 up.
public void makeCell(Presentable value,
int row,
int col,
java.lang.String name)
value - a presentable instance which is the (fixed) value for
this new cell.name - The name of the new cell.row - the spreadsheet row counting from 1 up.col - the spreadsheet column counting from 1 up.
public void makeCell(Presentation presentation,
int row,
int col,
java.lang.String name)
throws PresentationException
presentation - a presentation instance representing the (fixed) value for
this new cell.name - The name of the new cell.row - the spreadsheet row counting from 1 up.col - the spreadsheet column counting from 1 up.
PresentationException - a problem with parsing the presentation.
public void makeCell(java.lang.String formula,
int row,
int col,
java.lang.String name)
formula - an expression defining the value of the new cell, possibly
in terms of other cells, as well as (optionally) a set of attributes
relating to this cell.name - The name of the new cell.row - the spreadsheet row counting from 1 up.col - the spreadsheet column counting from 1 up.
public void makeCell(Presentable value,
int row,
int col)
value - a presentatble object.row - the spreadsheet row counting from 1 up.col - the spreadsheet column counting from 1 up.
public void makeCell(Presentation persentation,
int row,
int col)
throws PresentationException
persentation - a presentation.row - the spreadsheet row counting from 1 up.col - the spreadsheet column counting from 1 up.
PresentationException - if the persentation cannot be parsed.
public void makeCell(java.lang.String value,
int row,
int col)
value - a stringrow - the spreadsheet row counting from 1 upcol - the spreadsheet column counting from 1 uppublic int getColumnCount()
getColumnCount in interface javax.swing.table.TableModelpublic int getRowCount()
getRowCount in interface javax.swing.table.TableModelpublic java.lang.String getColumnName(int col)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row,
int col)
getValueAt in interface javax.swing.table.TableModel
public boolean isCellEditable(int row,
int col)
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModelrow - the row starting with 0 at the top.col - the columb starting with 0 at the left.
public void setValueAt(java.lang.Object value,
int row,
int col)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelvalue - the Presentable value to show.row - the row starting with 0 at the top.col - the column starting with 0 at the left.
public void setAttribute(java.lang.String attr,
java.lang.String value,
int row,
int col)
attr - the attribute name.value - the attribute value.row - the row to which the cell belongs (0 < row <= nrows)col - the column to which the cell belongs (0 < col <= ncols)
public void removeAttribute(java.lang.String attr,
int row,
int col)
attr - the attribute name.row - the row to which the cell belongs (0 < row <= nrows)col - the column to which the cell belongs (0 < col <= ncols)public java.util.Iterator getCells()
public void setDirtyAll()
public java.lang.String getIdentifier()
getIdentifier in interface Auditablepublic java.lang.String audit(java.lang.String label)
audit in interface Auditablelabel - String: the label to associate with the data
public java.lang.String audit()
audit in interface Auditable
public void audit(java.io.PrintStream out,
java.lang.String label)
audit in interface Auditableout - the output stream.label - the label to attach to the output (may be null).
java.lang.String auditCell(int row,
int col)
public static java.lang.String GetRowName(int row)
row - row index between 1 and Nrows.
public static java.lang.String GetColName(int col)
col - column index between 1 and Ncols.
public void setDirty(boolean dirty)
public boolean isDirty()
public static PresentationFactoryInterface GetPresentationFactory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||