| java.lang.Object javax.swing.table.AbstractTableModel org.geotools.gui.swing.referencing.CoordinateTableModel
CoordinateTableModel | public class CoordinateTableModel extends AbstractTableModel (Code) | | A table of
. All coordinates contained in this
table have the same
, which
is specified at construction time.
This table model provides a way to display invalid coordinates in a different color.
Invalide coordinates are defined here as coordinates outside the CRS
. This color display
can be enabled by the following code:
CoordinateTableModel model = new CoordinateTableModel(crs);
view = new JTable(model);
renderer = new
();
view.setDefaultRenderer(
.class, renderer);
since: 2.3 version: $Id: CoordinateTableModel.java 24925 2007-03-27 20:12:08Z jgarnett $ author: Cédric Briançon author: Hoa Nguyen author: Martin Desruisseaux |
Constructor Summary | |
public | CoordinateTableModel(CoordinateReferenceSystem crs) Creates an initially empty table model using the specified coordinate reference system. |
Method Summary | |
public void | add(DirectPosition newPosition) Adds a direct position to this table. | public void | add(Collection newPositions) Adds a collection of direct positions to this table. | public Class | getColumnClass(int columnIndex) Returns tye type of data for the specified column. | public int | getColumnCount() Returns the number of columns. | public String | getColumnName(int columnIndex) Returns the name for the specified column. | public CoordinateReferenceSystem | getCoordinateReferenceSystem() | public List | getPositions() Returns all direct positions in this table. | public int | getRowCount() Returns the number of rows in the table. | public Object | getValueAt(int rowIndex, int columnIndex) Returns the value in the table at the specified postion.
Parameters: rowIndex - Cell row number. Parameters: columnIndex - Cell column number. | public boolean | isCellEditable(int rowIndex, int colIndex) Specifies that the user can fill all rows in the table. | public boolean | isValidCoordinate(int rowIndex) Returns
true if the position at the specified row is inside the CRS
. | public void | setValueAt(Object value, int rowIndex, int columnIndex) Sets the value for the specified cell. | public String | toString() Returns a string representation of this table. |
CoordinateTableModel | public CoordinateTableModel(CoordinateReferenceSystem crs)(Code) | | Creates an initially empty table model using the specified coordinate reference system.
|
add | public void add(DirectPosition newPosition)(Code) | | Adds a direct position to this table. The position is not cloned. Any cell edited in this
table will write its change directly into the corresponding
DirectPosition object.
|
add | public void add(Collection newPositions)(Code) | | Adds a collection of direct positions to this table. The position is not cloned.
Any cell edited in this table will write its change directly into the corresponding
DirectPosition object.
|
getColumnClass | public Class getColumnClass(int columnIndex)(Code) | | Returns tye type of data for the specified column. For coordinate table,
this is always
Double.class .
|
getColumnCount | public int getColumnCount()(Code) | | Returns the number of columns.
|
getColumnName | public String getColumnName(int columnIndex)(Code) | | Returns the name for the specified column. The default implementation
returns the name of the corresponding axis in the table CRS.
|
getCoordinateReferenceSystem | public CoordinateReferenceSystem getCoordinateReferenceSystem()(Code) | | Returns the CRS for this table model
|
getRowCount | public int getRowCount()(Code) | | Returns the number of rows in the table.
|
getValueAt | public Object getValueAt(int rowIndex, int columnIndex)(Code) | | Returns the value in the table at the specified postion.
Parameters: rowIndex - Cell row number. Parameters: columnIndex - Cell column number. The ordinate value, or null if no value is available for the specified cell. |
isCellEditable | public boolean isCellEditable(int rowIndex, int colIndex)(Code) | | Specifies that the user can fill all rows in the table.
|
isValidCoordinate | public boolean isValidCoordinate(int rowIndex)(Code) | | Returns
true if the position at the specified row is inside the CRS
. This method
is invoked by
CellRenderer in order to determine if this row should
be colorized.
|
setValueAt | public void setValueAt(Object value, int rowIndex, int columnIndex)(Code) | | Sets the value for the specified cell.
Parameters: value - The new value for the cell. Parameters: rowIndex - Row number of the cell modified. Parameters: columnIndex - Column number of the cell modified. |
toString | public String toString()(Code) | | Returns a string representation of this table. The default implementation
list all coordinates.
|
|
|