Class LayerSelectorTool

java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.osm.LayerSelectorTool
All Implemented Interfaces:
Serializable, TableModel

public class LayerSelectorTool extends AbstractTableModel
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
Building color is also chooseable.

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:
  • Method Details

    • showLayerSelectorTool

      public static void showLayerSelectorTool(GeographicalMap frame)
      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

      public Class<?> getColumnClass(int columnIndex)
      Returns the data Class for the specified column.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      Parameters:
      columnIndex - the column being queried
      Returns:
      the Class object for the column's data
    • getColumnName

      public String getColumnName(int column)
      Returns the localized name for the column.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      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 interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
      Parameters:
      rowIndex - int rowIndex of cell to test
      columnIndex - 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

      public Object getValueAt(int rowIndex, int columnIndex)
      Returns the value for the cell at columnIndex and rowIndex.
      Parameters:
      rowIndex - the row whose value is to be queried
      columnIndex - the column whose value is to be queried
      Returns:
      the value Object at the specified cell
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Set the value for the specified cell.
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
      Parameters:
      aValue - Object value to set into the cell
      rowIndex - the row whose value is to be queried
      columnIndex - the column whose value is to be queried