org.geotools.gui.swing.image
Class ImageTableModel.RowHeaders

Object
  extended by AbstractTableModel
      extended by ImageTableModel.RowHeaders
All Implemented Interfaces:
Serializable, EventListener, TableModelListener, TableModel
Enclosing class:
ImageTableModel

public class ImageTableModel.RowHeaders
extends AbstractTableModel
implements TableModelListener

A table model for row headers. This model has only one column, and each cell values is the row name defined in the enclosing class. A table using this model can be set as the scroll pane's row header for an image table.

Since:
2.2
Author:
Martin Desruisseaux (IRD)
See Also:
JScrollPane.setRowHeader(javax.swing.JViewport), Serialized Form

Field Summary
 
Fields inherited from class AbstractTableModel
listenerList
 
Constructor Summary
ImageTableModel.RowHeaders()
          Creates a new instance of row headers.
 
Method Summary
 Class getColumnClass(int column)
          Returns the type of row headers, which is String.class.
 int getColumnCount()
          Returns the number of columns in the model, which is 1.
 int getRowCount()
          Returns the number of rows in the model.
 Object getValueAt(int row, int column)
          Returns the row name for the given index, regardless of the column.
 void tableChanged(TableModelEvent event)
          Invoked when the enclosing ImageTableModel data changed.
 
Methods inherited from class AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageTableModel.RowHeaders

public ImageTableModel.RowHeaders()
Creates a new instance of row headers. This constructor immediately register the new instance as a listener of the enclosing ImageTableModel.

Method Detail

getRowCount

public int getRowCount()
Returns the number of rows in the model. This is identical to the number of rows in the enclosing ImageTableModel.

Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Returns the number of columns in the model, which is 1.

Specified by:
getColumnCount in interface TableModel

getColumnClass

public Class getColumnClass(int column)
Returns the type of row headers, which is String.class.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Returns the row name for the given index, regardless of the column.

Specified by:
getValueAt in interface TableModel

tableChanged

public void tableChanged(TableModelEvent event)
Invoked when the enclosing ImageTableModel data changed. This method fires an event for this model as well except if the change was not a change in the table structure.

Specified by:
tableChanged in interface TableModelListener


Copyright © 1996-2009 Geotools. All Rights Reserved.