|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractTableModel
ListTableModel<Tile>
MosaicTableModel
public class MosaicTableModel
A table model for a list of tiles. The default implementation provides one row for each tile added to this model and one column for each tile property listed below. This table model does not allows cell edition but allows row insertion and removal, assuming that the list of tiles is modifiable. The default columns are:
External list of tiles
A list of tiles is given to the constructor and retained by direct reference - the list is
not cloned, because it may contains millions of tiles, sometime through a
custom List implementation fetching the information on-the-fly from a database.
Consequently if the content of the list is modified externally, then a fireXXX
method (inherited from AbstractTableModel must be invoked explicitly. Note that
the fireXXX methods don't need to be invoked if the list is modified through the
methods provided in this class.
Multi-threading
Unless otherwise specified, every methods in this class must be invoked from the Swing
thread. The main exceptions are the methods listed below, which should actually be invoked
from a background thread rather than the Swing thread:
Serialization
This model is serialiable if the underlying list of tiles is serializable.
MosaicChooser,
Serialized Form
| display/geotk-widgets-swing (download) | View source code for this class |
| Field Summary |
|---|
| Fields inherited from class ListTableModel |
|---|
elements |
| Fields inherited from class AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
MosaicTableModel()
Creates a new table model backed by an ArrayList of tiles. |
|
MosaicTableModel(List<Tile> tiles)
Creates a new table model for the given list of tiles. |
|
| Method Summary | |
|---|---|
TableModel |
add(ImageReaderSpi provider,
File[] files,
ProgressController progress)
Adds tiles to be constructed from the given array of files. |
Class<?> |
getColumnClass(int column)
Returns the class of values at the given column. |
int |
getColumnCount()
Returns the number of columns in the table. |
String |
getColumnName(int column)
Returns the name of the given column. |
TileManager[] |
getTileManager()
Returns a tile manager for the current list of tiles. |
Object |
getValueAt(int row,
int column)
Returns the value at the given index. |
| Methods inherited from class ListTableModel |
|---|
add, getElements, getElements, getElements, getRowCount, insert, remove, remove, removeDuplicates, setElements, sort |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MosaicTableModel()
ArrayList of tiles.
public MosaicTableModel(List<Tile> tiles)
fireXXX method inherited from
AbstractTableModel must be invoked explicitly.
tiles - The list of tiles to display in a table.| Method Detail |
|---|
public int getColumnCount()
public String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelcolumn - The column.
public Class<?> getColumnClass(int column)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelcolumn - The column.
public Object getValueAt(int row,
int column)
null if the
value at the given cell can not be obtained, for example because of an I/O error.
row - The row, which is also the index of the tile.column - The column.
null.
public TableModel add(ImageReaderSpi provider,
File[] files,
ProgressController progress)
throws UnsupportedOperationException
".tfw" extension (for TIFF images) or
".jgw" extension (for JPEG images).
This method loads the World Files and fetches the image sizes immediately. The world file applies to the first image in the file. If the file contains more than one image, then each additional image is assumed to represent the same data than the first image at a different resolution.
This method may be slow and should be invoked in a background thread. After having built
the collection of tiles, this method invokes ListTableModel.add(Collection) in the Swing thread,
removes duplicates and sorts the result.
On success, this method returns null. If this method failed to constructs some
tiles, then the successful tiles are added as explained above and the unused files are
returned in a new table model.
provider - The image reader provider to use for reading image data, or null
for attempting an automatic detection.files - The files from which to creates tiles.progress - An optional controller for reporting progresses, or null if none.
null on success, or a list of files that failed otherwise.
UnsupportedOperationException - if the underlying list of tiles
is not modifiable.
public TileManager[] getTileManager()
throws IOException
Consider invoking ListTableModel.removeDuplicates() before this method, since duplicated
tiles are likely to produce erroneous tile manager. Consider also invoking this
getTileManager() method from a background thread, since it may be slow
(it is safe to invoke this particular method from non-Swing thread).
IOException - if an error occurred while reading a tile.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||