org.geotools.gui.swing.table
Class ImageTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.geotools.gui.swing.table.ImageTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ImageTableModel
extends javax.swing.table.AbstractTableModel

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

Since:
2.2
Version:
$Id: ImageTableModel.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
ImageSampleValues, Serialized Form
To Do:
Should supports deferred execution: request for a new tile should wait some maximal amount of time (e.g. 0.1 seconds). If the tile is not yet available after that time, the model should returns at this time and send a "data changed" event later when the tile is finally available.

Nested Class Summary
 class ImageTableModel.RowHeaders
          A table model for row headers.
 
Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ImageTableModel()
          Creates a new table model.
ImageTableModel(java.awt.image.RenderedImage image)
          Creates a new table model for the specified image.
 
Method Summary
 int findColumn(java.lang.String name)
          Returns a column given its name.
 int getBand()
          Returns the band to display.
 java.awt.Color getColorAt(int y, int x)
          Returns the color at the specified row and column.
 java.lang.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.
 java.lang.String getColumnName(int column)
          Returns the column name.
 java.text.NumberFormat getNumberFormat()
          Returns the format to use for formatting sample values.
 java.awt.image.RenderedImage getRenderedImage()
          Returns the image to display, or if none.
 int getRowCount()
          Returns the number of rows in the model, which is the image height.
 java.lang.String getRowName(int row)
          Returns the row name.
 java.lang.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(java.text.NumberFormat format)
          Sets the format to use for formatting sample values.
 void setRenderedImage(java.awt.image.RenderedImage image)
          Sets the image to display.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.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(java.awt.image.RenderedImage image)
Creates a new table model for the specified image.

Method Detail

getRenderedImage

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


setRenderedImage

public void setRenderedImage(java.awt.image.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 java.text.NumberFormat getNumberFormat()
Returns the format to use for formatting sample values.


setNumberFormat

public void setNumberFormat(java.text.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 java.lang.String getRowName(int row)
Returns the row name. The names are the pixel row number, starting at the min y value.


getColumnName

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


findColumn

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


getColumnClass

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


getValueAt

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


getColorAt

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



Copyright © GeoTools. All Rights Reserved.