org.geotools.gui.swing.image
Class ImageTableModel

Object
  extended by AbstractTableModel
      extended by ImageTableModel
All Implemented Interfaces:
Serializable, TableModel

public class ImageTableModel
extends AbstractTableModel

A table model for image sample values (or pixels). This model is serialiable if the underlying RenderedImage is serializable.

Since:
2.3
Author:
Martin Desruisseaux (IRD)
See Also:
ImageSampleValues, Serialized Form
Module:

Nested Class Summary
 class ImageTableModel.RowHeaders
          A table model for row headers.
 
Field Summary
 
Fields inherited from class AbstractTableModel
listenerList
 
Constructor Summary
ImageTableModel()
          Creates a new table model.
ImageTableModel(RenderedImage image)
          Creates a new table model for the specified image.
 
Method Summary
 int findColumn(String name)
          Returns a column given its name.
 int getBand()
          Returns the band to display.
 Color getColorAt(int y, int x)
          Returns the color at the specified row and column.
 Class getColumnClass(int column)
          Returns the type of sample values regardless of column index.
 int getColumnCount()
          Returns the number of columns in the model, which is the image width.
 String getColumnName(int column)
          Returns the column name.
 NumberFormat getNumberFormat()
          Returns the format to use for formatting sample values.
 RenderedImage getRenderedImage()
          Returns the image to display, or null if none.
 int getRowCount()
          Returns the number of rows in the model, which is the image height.
 String getRowName(int row)
          Returns the row name.
 Object getValueAt(int y, int x)
          Returns the sample value at the specified row and column.
 void setBand(int band)
          Set the band to display.
 void setNumberFormat(NumberFormat format)
          Sets the format to use for formatting sample values.
 void setRenderedImage(RenderedImage image)
          Sets the image to display.
 
Methods inherited from class AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageTableModel

public ImageTableModel()
Creates a new table model.


ImageTableModel

public ImageTableModel(RenderedImage image)
Creates a new table model for the specified image.

Method Detail

getRenderedImage

public RenderedImage getRenderedImage()
Returns the image to display, or null if none.


setRenderedImage

public void setRenderedImage(RenderedImage image)
Sets the image to display.


getBand

public int getBand()
Returns the band to display.


setBand

public void setBand(int band)
Set the band to display.


getNumberFormat

public NumberFormat getNumberFormat()
Returns the format to use for formatting sample values.


setNumberFormat

public void setNumberFormat(NumberFormat format)
Sets the format to use for formatting sample values.


getRowCount

public int getRowCount()
Returns the number of rows in the model, which is the image height.


getColumnCount

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


getRowName

public String getRowName(int row)
Returns the row name. The names are the pixel row number, starting at the min y value.


getColumnName

public String getColumnName(int column)
Returns the column name. The names are the pixel column number, starting at the min x value.

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

findColumn

public int findColumn(String name)
Returns a column given its name.

Overrides:
findColumn in class AbstractTableModel

getColumnClass

public Class getColumnClass(int column)
Returns the type of sample values regardless of column index.

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

getValueAt

public Object getValueAt(int y,
                         int x)
Returns the sample value at the specified row and column.


getColorAt

public Color getColorAt(int y,
                        int x)
Returns the color at the specified row and column.



Copyright © 1996-2009 Geotools. All Rights Reserved.