|
TsBiff 1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.swing.table.AbstractTableModel
|
+--ts.ui.TsTableModel
A Table model with a simple set of methods for handling the model. The internal data structure for the dataset (cells) is a vector of vectors.
TsTable, Serialized Form| Field Summary | |
protected int |
hiddenColumns
|
protected boolean |
isEditable
|
protected java.util.Vector |
myColumnTitles
|
protected java.util.Vector |
myDataSet
|
protected int |
numColumns
|
protected int |
numRows
|
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
TsTableModel()
Create a new empty TsTableModel |
|
TsTableModel(java.lang.Object[] titles)
Create a new TsTableModel with titles and a empty dataset |
|
TsTableModel(java.lang.Object[] titles,
java.lang.Object[][] data)
Create a new TsTableModel with column titles and a dataset |
|
TsTableModel(java.util.Vector titles,
java.util.Vector data)
Create a new TsTableModel with column titles and a dataset |
|
| Method Summary | |
void |
clear()
Clear the dataset and notify any listeners of changes in the model. |
protected static java.lang.Object[] |
convertToArray(java.util.Vector aVector)
|
protected static java.util.Vector |
convertToVector(java.lang.Object[] anArray)
|
protected static java.util.Vector |
convertToVector(java.lang.Object[][] anArray)
|
static javax.swing.table.TableModel |
createTsTableDataModel()
TsTableModel factory method |
void |
deleteRow(int rowIndex)
Remove the row with row index from the dataset and notify any TableModel listeners of changes in the model. |
java.lang.Class |
getColumnClass(int c)
Get the lowest common denominator Class in the column. |
int |
getColumnCount()
Returns the number of columns managed by the data source object. |
java.lang.String |
getColumnName(int col)
Get the name of the column at columnIndex. |
int |
getHiddenColumnsCount()
Returns the number of hidden columns |
java.lang.Object[] |
getRow(int rowIndex)
Returns the row at the given index as an array of objects |
int |
getRowCount()
Returns the number of records in the dataset. |
java.util.Vector |
getRowVector(int rowIndex)
Returns the row at the given index as a Vector |
java.lang.Object |
getValueAt(int row,
int col)
Get an attribute value for the cell at columnIndex and rowIndex. |
void |
insertRow(java.lang.Object[] row)
Insert a row as the first row in the dataset. |
void |
insertRow(java.lang.Object[] row,
int rowIndex)
Insert a row in the dataset at the given row index. |
void |
insertRow(java.util.Vector row)
Insert a row as the first row in the dataset. |
void |
insertRow(java.util.Vector row,
int rowIndex)
Insert a row in the dataset at the given row index. |
void |
insertRows(java.lang.Object[][] rows)
Insert several rows at the begining of the dataset. |
void |
insertRows(java.lang.Object[][] rows,
int rowIndex)
Insert several rows into the dataset at the given row index. |
void |
insertRows(java.util.Vector rows)
Insert several rows at the begining of the dataset. |
void |
insertRows(java.util.Vector rows,
int rowIndex)
Insert several rows into the dataset at the given row index. |
boolean |
isCellEditable(int row,
int col)
Allow edit in cell if edit is turned on |
void |
setData(java.lang.Object[][] data)
Set a new dataset for the model |
void |
setData(java.util.Vector data)
Set a new dataset for the model |
void |
setEditable(boolean b)
Set if cells in the table could be edited. |
void |
setHiddenColumns(int hidden)
Set number of hidden columns in the model |
void |
setTitles(java.lang.Object[] titles)
Set new column titles in the model |
void |
setTitles(java.util.Vector titles)
Set new column titles in the model |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Set a new value in a cell |
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Vector myColumnTitles
protected java.util.Vector myDataSet
protected int hiddenColumns
protected boolean isEditable
protected volatile int numColumns
protected volatile int numRows
| Constructor Detail |
public TsTableModel(java.util.Vector titles,
java.util.Vector data)
titles - Column titlesdata - A dataset (vector of vector)
public TsTableModel(java.lang.Object[] titles,
java.lang.Object[][] data)
titles - Column titlesdata - A datasetpublic TsTableModel(java.lang.Object[] titles)
titles - Column titlespublic TsTableModel()
| Method Detail |
public static javax.swing.table.TableModel createTsTableDataModel()
public void setEditable(boolean b)
true - if the table will allow edit in cells else falsepublic void setTitles(java.util.Vector titles)
titles - Column titlespublic void setTitles(java.lang.Object[] titles)
titles - Column titlespublic void setData(java.util.Vector data)
data - The new dataset for this table modelpublic void setData(java.lang.Object[][] data)
data - The new dataset for this table modelpublic int getHiddenColumnsCount()
public int getColumnCount()
getColumnCount in class javax.swing.table.AbstractTableModelpublic int getRowCount()
getRowCount in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row,
int col)
getValueAt in class javax.swing.table.AbstractTableModelpublic java.lang.String getColumnName(int col)
getColumnName in class javax.swing.table.AbstractTableModelpublic java.lang.Class getColumnClass(int c)
getColumnClass in class javax.swing.table.AbstractTableModelpublic java.util.Vector getRowVector(int rowIndex)
public java.lang.Object[] getRow(int rowIndex)
public void deleteRow(int rowIndex)
rowIndex - The index of the row to removepublic void insertRow(java.util.Vector row)
row - The row to insert at the start of the listpublic void insertRow(java.lang.Object[] row)
row - The row to insert at the start of the list
public void insertRow(java.util.Vector row,
int rowIndex)
row - The row to insertindex - Where to insert the row in the dataset
public void insertRow(java.lang.Object[] row,
int rowIndex)
row - The row to insertindex - Where to insert the row in the datasetpublic void insertRows(java.util.Vector rows)
row - A dataset (vector of vector)public void insertRows(java.lang.Object[][] rows)
row - A dataset (vector of vector)
public void insertRows(java.util.Vector rows,
int rowIndex)
rows - A dataset (vector of vector)index - The row index to start adding the new rows from
public void insertRows(java.lang.Object[][] rows,
int rowIndex)
rows - A dataset (vector of vector)index - The row index to start adding the new rows frompublic void clear()
public void setHiddenColumns(int hidden)
hidden - Number of columns that should be hidden
public boolean isCellEditable(int row,
int col)
isCellEditable in class javax.swing.table.AbstractTableModel
public void setValueAt(java.lang.Object value,
int row,
int col)
setValueAt in class javax.swing.table.AbstractTableModelaValue - - the new valuerow - - the row whose value is to be changedcolumn - - the column whose value is to be changedprotected static java.lang.Object[] convertToArray(java.util.Vector aVector)
protected static java.util.Vector convertToVector(java.lang.Object[] anArray)
protected static java.util.Vector convertToVector(java.lang.Object[][] anArray)
|
TsBiff 1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||