|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
diamondedge.swing.grid.DelegateGridModel
public class DelegateGridModel
DelegateGridModel provides sorting and cell formatting for any TableModel. This is used internally to DsGrid.
Field Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Fields inherited from interface diamondedge.swing.grid.GridModel |
---|
DELETE_CELL |
Constructor Summary | |
---|---|
DelegateGridModel()
|
|
DelegateGridModel(TableModel model)
|
Method Summary | |
---|---|
void |
addColumn(Object columnName)
Adds a column to the model. |
int |
convertRowIndexToModel(int row)
Maps the index of the row in the view to the index of the row in the embedded table model. |
Class |
getColumnClass(int column)
|
int |
getColumnCount()
|
String |
getColumnName(int column)
|
TableModel |
getModel()
|
int |
getRowCount()
|
Object |
getValueAt(int row,
int column)
Returns an attribute value for the cell at row and column. |
void |
insertRow(int row,
Vector rowData)
Inserts a row at row in the model. |
boolean |
isCellEditable(int row,
int column)
|
void |
removeRow(int row)
Removes the row at row from the model. |
void |
setColumnCount(int val)
Sets the number of columns in the model. |
void |
setModel(TableModel model)
|
void |
setRowCount(int rowCount)
Sets the number of rows in the model. |
void |
setValueAt(Object value,
int row,
int col)
Sets the object value for the cell at column and row. |
void |
sort(int column,
int sortOrder)
Sorts the model by comparing values in the given column |
void |
tableChanged(TableModelEvent e)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, removeTableModelListener |
Constructor Detail |
---|
public DelegateGridModel()
public DelegateGridModel(TableModel model)
Method Detail |
---|
public TableModel getModel()
public void setModel(TableModel model)
public int convertRowIndexToModel(int row)
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
public Class getColumnClass(int column)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public int getRowCount()
getRowCount
in interface TableModel
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
public void setValueAt(Object value, int row, int col)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public void setRowCount(int rowCount)
GridModel
rowCount
and greater are discarded.
setRowCount
in interface GridModel
public void insertRow(int row, Vector rowData)
GridModel
row
in the model. The new row
will contain null
values unless rowData
is specified. Notification of the row being added will be generated.
insertRow
in interface GridModel
row
- the row index of the row to be insertedrowData
- optional data of the row being addedpublic void removeRow(int row)
GridModel
row
from the model. Notification
of the row being removed will be sent to all the listeners.
removeRow
in interface GridModel
row
- the row index of the row to be removedpublic void setColumnCount(int val)
GridModel
null
cell values.
If the new size is less than the current size, all columns at index
columnCount
and greater are discarded.
setColumnCount
in interface GridModel
val
- the new number of columns in the modelGridModel.setColumnCount(int)
public void addColumn(Object columnName)
GridModel
columnName
, which may be null. This method
will send a
tableChanged
notification message to all the listeners.
This method is a cover for addColumn(Object, Vector)
which
uses null
as the data vector.
addColumn
in interface GridModel
columnName
- the identifier of the column being addedpublic void sort(int column, int sortOrder)
sort
in interface GridModel
column
- column to be sortedsortOrder
- One of: DsGrid.ASCENDING, DsGrid.DESCENDING, DsGrid.ASCENDING_CASE, DsGrid.DESCENDING_CASE
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |