|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractTableModel
CoordinateTableModel
public class CoordinateTableModel
A table of direct positions. All coordinates contained in this table have the same coordinate reference system, 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 valid area. This color display can be enabled by the following code:
CoordinateTableModel model = new CoordinateTableModel(crs); JTable view = new JTable(model); TableCellRenderer renderer = new CoordinateTableModel.CellRenderer(); view.setDefaultRenderer(Double.class, renderer);
Nested Class Summary | |
---|---|
static class |
CoordinateTableModel.CellRenderer
A cell renderer for the coordinate table model. |
Field Summary |
---|
Fields inherited from class AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
CoordinateTableModel(CoordinateReferenceSystem crs)
Creates an initially empty table model using the specified coordinate reference system. |
Method Summary | |
---|---|
void |
add(Collection newPositions)
Adds a collection of direct positions to this table. |
void |
add(DirectPosition newPosition)
Adds a direct position to this table. |
Class |
getColumnClass(int columnIndex)
Returns tye type of data for the specified column. |
int |
getColumnCount()
Returns the number of columns. |
String |
getColumnName(int columnIndex)
Returns the name for the specified column. |
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the CRS for this table model |
List |
getPositions()
Returns all direct positions in this table. |
int |
getRowCount()
Returns the number of rows in the table. |
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value in the table at the specified postion. |
boolean |
isCellEditable(int rowIndex,
int colIndex)
Specifies that the user can fill all rows in the table. |
boolean |
isValidCoordinate(int rowIndex)
Returns true if the position at the specified row is inside the CRS
valid area. |
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
Sets the value for the specified cell. |
String |
toString()
Returns a string representation of this table. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CoordinateTableModel(CoordinateReferenceSystem crs)
Method Detail |
---|
public CoordinateReferenceSystem getCoordinateReferenceSystem()
public List getPositions()
add(DirectPosition)
,
add(Collection)
public int getRowCount()
public int getColumnCount()
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public Class getColumnClass(int columnIndex)
Double.class
.
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public void add(DirectPosition newPosition)
DirectPosition
object.
public void add(Collection newPositions)
DirectPosition
object.
public Object getValueAt(int rowIndex, int columnIndex)
rowIndex
- Cell row number.columnIndex
- Cell column number.
null
if no value is available for the specified cell.public void setValueAt(Object value, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
value
- The new value for the cell.rowIndex
- Row number of the cell modified.columnIndex
- Column number of the cell modified.public boolean isCellEditable(int rowIndex, int colIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public boolean isValidCoordinate(int rowIndex)
true
if the position at the specified row is inside the CRS
valid area. This method
is invoked by CoordinateTableModel.CellRenderer
in order to determine if this row should
be colorized.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |