net.sf.jeppers.grid
Interface GridModel

All Known Implementing Classes:
AbstractGridModel

public interface GridModel

Describes a rectangular array of cells. Unlike javax.swing.table.TableModel this data model is suitable for a symmetrical grid. That is, there is no column (or row) focus.

Author:
Cameron Zemek

Method Summary
 void addGridModelListener(GridModelListener listener)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 int getColumnCount()
          Return the number of columns in the model.
 int getRowCount()
          Returns the number of rows in the model.
 Object getValueAt(int row, int column)
          Returns the value for the cell at row and column
 boolean isCellEditable(int row, int column)
          Returns true if the cell at row and column is editable.
 void removeGridModelListener(GridModelListener listener)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 void setValueAt(Object value, int row, int column)
          Sets the value for the cell at row and column to value
 

Method Detail

addGridModelListener

public void addGridModelListener(GridModelListener listener)
Adds a listener to the list that's notified each time a change to the data model occurs.

Parameters:
listener - the GridModelListener to add

removeGridModelListener

public void removeGridModelListener(GridModelListener listener)
Removes a listener from the list that's notified each time a change to the data model occurs.

Parameters:
listener - the GridModelListener to remove

getValueAt

public Object getValueAt(int row,
                         int column)
Returns the value for the cell at row and column

Parameters:
row - row index of cell
column - column index of cell
Returns:
the value of the cell

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Returns true if the cell at row and column is editable. Otherwise, setValueAt on the cell will not change the value of that cell.

Parameters:
row - row index of cell
column - column index of cell
Returns:
true if the cell is editable

setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)
Sets the value for the cell at row and column to value

Parameters:
value - new cell value
row - row index of cell
column - column index of cell

getRowCount

public int getRowCount()
Returns the number of rows in the model.

Returns:
the number of rows in the model

getColumnCount

public int getColumnCount()
Return the number of columns in the model.

Returns:
the number of columns in the model