com.eliad.swing
Class DefaultHeaderModel
java.lang.Object
|
+--com.eliad.model.AbstractGenericModel
|
+--com.eliad.model.AbstractGridModel
|
+--com.eliad.swing.DefaultHeaderModel
- public class DefaultHeaderModel
- extends AbstractGridModel
- implements java.beans.PropertyChangeListener
This is an implementation of GridModel
that
is suitable for a grid header.
- Version:
- 1.0 00/04/08
- Author:
- Patrick Mérissert-Coffinières
- See Also:
GridModel
, Serialized Form
Fields inherited from class com.eliad.model.AbstractGenericModel |
listeners_ |
Constructor Summary |
DefaultHeaderModel(JSmartGrid grid,
int orientation)
Builds a GridModel suitable for a given grid, along a given orientation.
|
Method Summary |
int |
getColumnCount()
Returns the number of columns in the model. |
int |
getRowCount()
Returns the number of rows in the model. |
java.lang.Object |
getValueAt(int row,
int column)
Returns the value for the cell at column and row . |
protected boolean |
isHorizontal()
Returns true if this is a model for a column header. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Overloaded to process ruler changes in the main model. |
Methods inherited from class com.eliad.model.AbstractGridModel |
addGridModelListener,
fireGridCellsChanged,
fireGridColumnsChanged,
fireGridColumnsDeleted,
fireGridColumnsInserted,
fireGridModelChanged,
fireGridRowsChanged,
fireGridRowsDeleted,
fireGridRowsInserted,
fireGridStructureChanged,
isCellEditable,
propagateDataChange,
propagateModelChange,
propagateStructureChange,
removeGridModelListener,
setValueAt |
Methods inherited from class com.eliad.model.AbstractGenericModel |
getListenerCount,
getListeners |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DefaultHeaderModel
public DefaultHeaderModel(JSmartGrid grid,
int orientation)
- Builds a GridModel suitable for a given grid, along a given orientation.
It will display standard spreadsheet headings keeping a reference on the pertinent ruler model,
rather than on the grid.
isHorizontal
protected final boolean isHorizontal()
- Returns true if this is a model for a column header.
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Overloaded to process ruler changes in the main model.
- Specified by:
- propertyChange in interface java.beans.PropertyChangeListener
getRowCount
public int getRowCount()
- Returns the number of rows in the model.
- Returns:
- the number of rows in the main model if this is the row header, otherwise 1.
- See Also:
getColumnCount()
getColumnCount
public int getColumnCount()
- Returns the number of columns in the model.
- Returns:
- the number of columns in the main model if this is the column header, otherwise 1.
- See Also:
getColumnCount()
getValueAt
public java.lang.Object getValueAt(int row,
int column)
- Returns the value for the cell at
column
and row
.
- Parameters:
row
- the row whose value is to be queriedcolumn
- the column whose value is to be queried- Returns:
- A spreadsheet-like heading string.