Package org.ka2ddo.yaac.gui.osm
Class LayerSelectorTool
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.osm.LayerSelectorTool
- All Implemented Interfaces:
Serializable
,TableModel
This class provides a UI for editing which map features can be seen on a map.
By default, all recognized map features are visible, but some types can be
selectively turned off with this GUI.
The information for OpenStreetMap Ways is displayed as a table with the following columns:
- layer type name
- line color
- area color(s) or pattern
- zoom level below which this is seen
- zoom level below which labels are drawn
For OpenStreetMap Nodes (also called Points Of Interest or POI), whether any given type of POI is plotted is individually selectable, or in categories of types.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
getColumnClass
(int columnIndex) Returns the data Class for the specified column.int
Returns the number of columns in the model.getColumnName
(int column) Returns the localized name for the column.int
Returns the number of rows in the model.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
isCellEditable
(int rowIndex, int columnIndex) Indicate which columns of the table are editable.void
setValueAt
(Object aValue, int rowIndex, int columnIndex) Set the value for the specified cell.static void
Display a LayerSelectorTool in a JDialog for the specified GeographicalMap frame.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Method Details
-
showLayerSelectorTool
Display a LayerSelectorTool in a JDialog for the specified GeographicalMap frame.- Parameters:
frame
- GeographicalMap to control
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model.- Returns:
- the number of columns in the model
- See Also:
-
getColumnClass
Returns the data Class for the specified column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- the Class object for the column's data
-
getColumnName
Returns the localized name for the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the name of
column
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) Indicate which columns of the table are editable.- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
rowIndex
- int rowIndex of cell to testcolumnIndex
- int columnIndex of cell to test- Returns:
- boolean true if cell can be edited by user
-
getRowCount
public int getRowCount()Returns the number of rows in the model.- Returns:
- the number of rows in the model
- See Also:
-
getValueAt
Returns the value for the cell atcolumnIndex
androwIndex
.- Parameters:
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
setValueAt
Set the value for the specified cell.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
aValue
- Object value to set into the cellrowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried
-