Diamond Control Suite 3.0

diamondedge.swing.grid
Interface GridModel

All Superinterfaces:
TableModel
All Known Implementing Classes:
DefaultGridModel, DelegateGridModel

public interface GridModel
extends TableModel


Field Summary
static Integer DELETE_CELL
          A value that indicates the intention to remove a DsCell (value and style properties) from the grid.
 
Method Summary
 void addColumn(Object columnName)
          Adds a column to the model.
 void insertRow(int row, Vector rowData)
          Inserts a row at row in the model.
 void removeRow(int row)
          Removes the row at row from the model.
 void setColumnCount(int columnCount)
          Sets the number of columns in the model.
 void setRowCount(int rowCount)
          Sets the number of rows in the model.
 void sort(int column, int sortOrder)
          Sorts the model by comparing values in the given column
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Field Detail

DELETE_CELL

static final Integer DELETE_CELL
A value that indicates the intention to remove a DsCell (value and style properties) from the grid. Pass this in as the value to DsGrid.setValueAt to remove the DsCell properties.

Method Detail

setRowCount

void setRowCount(int rowCount)
Sets the number of rows in the model. If the new size is greater than the current size, new rows are added to the end of the model If the new size is less than the current size, all rows at index rowCount and greater are discarded.


insertRow

void insertRow(int row,
               Vector rowData)
Inserts a row at row in the model. The new row will contain null values unless rowData is specified. Notification of the row being added will be generated.

Parameters:
row - the row index of the row to be inserted
rowData - optional data of the row being added
Throws:
ArrayIndexOutOfBoundsException - if the row was invalid

removeRow

void removeRow(int row)
Removes the row at row from the model. Notification of the row being removed will be sent to all the listeners.

Parameters:
row - the row index of the row to be removed
Throws:
ArrayIndexOutOfBoundsException - if the row was invalid

setColumnCount

void setColumnCount(int columnCount)
Sets the number of columns in the model. If the new size is greater than the current size, new columns are added to the end of the model with null cell values. If the new size is less than the current size, all columns at index columnCount and greater are discarded.

Parameters:
columnCount - the new number of columns in the model
See Also:
setColumnCount(int)

addColumn

void addColumn(Object columnName)
Adds a column to the model. The new column will have the identifier 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.

Parameters:
columnName - the identifier of the column being added

sort

void sort(int column,
          int sortOrder)
Sorts the model by comparing values in the given column

Parameters:
column - column to be sorted
sortOrder - One of: DsGrid.ASCENDING, DsGrid.DESCENDING, DsGrid.ASCENDING_CASE, DsGrid.DESCENDING_CASE

Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.