Class ChoroplethTheme

All Implemented Interfaces:
Visibility, EditableTableModel, Serializable, Comparator, TableModel
Direct Known Subclasses:
DefaultTheme, DitherTheme, NumericTheme, UniqueValueTheme

public abstract class ChoroplethTheme extends Theme implements Comparator
This is the parent theme for symbolizing spatial layers containing features or grid layers. Other more specialized themes will inherit from this class.
See Also:
Serialized Form
  • Method Details

    • reset

      @Deprecated public void reset(String fieldname, Window owner, int period)
      Deprecated.
      This method used to reset the classification and symbols. Now each theme will have a specialized generateSymbols method that will perform this function.
    • resetStore

      @Deprecated public void resetStore(GeoRelationalStore store)
      Deprecated.
      This method was used to change the underlying table rendered by the theme. It is now deprecated and does not do anything. Instead create a new layer specifying the data source, theme and column name.
    • generateSymbols

      public abstract void generateSymbols(String fieldname, Window owner, int period, Layer layer) throws Exception
      This method causes the theme information to be recalulated on a new column.
      Throws:
      Exception
    • compile

      public void compile(Layer layer, AttributeStore store, String fieldname) throws Exception
      Prepare the theme for use with this layer. If the theme specified a field or expression then the expression will be compiled, possibly resulting in an Exception.

      This method will not change the thematic symbols. In order to automatically build a new list of symbols use the generateSymbols method of the appropriate theme.

      The symbols for unclassified data values and selected features will be adjusted if the underlying feature type changes (e.g. from Polygon to Line).

      Parameters:
      layer - the parent layer
      store - the attribute table to compile the expression against
      fieldname - the fieldname or expression to use to lookup values for this theme
      Throws:
      Exception
    • setFieldname

      @Deprecated public abstract void setFieldname(String fieldname)
      Deprecated.
      Set the column name or expression that will categorize each feature. This method is deprecated. Associate the fieldname to use with the theme by using the GeoRelLayer(GeoRelationalStore,ChoroplethTheme,String) constructor.
    • getFieldname

      public String getFieldname()
      Get the field that is to be used to classify this theme.
    • getEditor

      public ThemeEditor getEditor(Layer lle)
      Description copied from class: Theme
      Return a ThemeEditor component appropriate for the theme type.
      Specified by:
      getEditor in class Theme
    • getSubEditor

      public abstract ThemeEditor getSubEditor(Layer layer)
      Retrive an editor object that will cusomtize the theme.
      Parameters:
      layer - the parent layer
    • getRowCount

      public int getRowCount()
      Description copied from class: Theme
      AbstractTableModel and EditableTableModel interfaces
      Specified by:
      getRowCount in interface TableModel
      Specified by:
      getRowCount in class Theme
    • getColumnCount

      public int getColumnCount()
      Specified by:
      getColumnCount in interface TableModel
      Specified by:
      getColumnCount in class Theme
    • getValueAt

      public Object getValueAt(int row, int column)
      Specified by:
      getValueAt in interface TableModel
      Specified by:
      getValueAt in class Theme
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Specified by:
      setValueAt in interface TableModel
      Specified by:
      setValueAt in class Theme
    • getColumnClass

      public Class getColumnClass(int column)
      Specified by:
      getColumnClass in interface TableModel
      Specified by:
      getColumnClass in class Theme
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Specified by:
      isCellEditable in interface TableModel
      Specified by:
      isCellEditable in class Theme
    • removeRow

      public void removeRow(int row)
      Description copied from interface: EditableTableModel
      Remove the row specified by the row number.
      Specified by:
      removeRow in interface EditableTableModel
    • addRow

      public void addRow(Object[] obj)
      Description copied from interface: EditableTableModel
      Add a row to the table. The number of items in the rowData array must match the number of columns in the table.
      Specified by:
      addRow in interface EditableTableModel
    • symbolsInitialized

      public boolean symbolsInitialized()
    • moveRow

      public void moveRow(int from, int to)
      Description copied from interface: EditableTableModel
      Move the specified row to a new location
      Specified by:
      moveRow in interface EditableTableModel
    • addRow

      public void addRow(Component comp)
      Description copied from interface: EditableTableModel
      Add a row to the table using default values. Optionally provide a reference to the parent window in case a dialog needs to be shown.
      Specified by:
      addRow in interface EditableTableModel
    • addElement

      public void addElement(ThemeElement te, String keys)
    • getSymbol

      public Symbol getSymbol(int row, int period) throws Exception
      Description copied from class: Theme
      Get a symbol for a given object id and period. This method only gets the raw symbol type, and is usually called by other methods that will take unclassified values and visibility parameters in to account.
      Specified by:
      getSymbol in class Theme
      Parameters:
      row - the row number or object id for the feature or grid value
      period - the period of interest
      Throws:
      Exception
    • getSymbol

      public Symbol getSymbol(Object key, double scale, Layer layer)
      Description copied from class: Theme
      Get a symbol for the key value
      Specified by:
      getSymbol in class Theme
      Parameters:
      key - the lookup value
      scale - the world to page scale
      layer - the parent layer
    • getSymbol

      public Symbol getSymbol(AttributeStore as, Layer layer, int row, double scale, int period) throws Exception
      Get a symbol for the given layer state
      Parameters:
      as - the underlying attribute table
      layer - the parent layer
      row - the object id
      scale - the world to page scale
      period - the period of interest
      Throws:
      Exception
    • getSelectedSymbol

      public Symbol getSelectedSymbol()
      Description copied from class: Theme
      Get the selected object symbol for this theme
      Specified by:
      getSelectedSymbol in class Theme
    • setSelectedSymbol

      public void setSelectedSymbol(Symbol selectedSymbol)
      Set the symbol to use for selected values
    • setUnclassified

      public void setUnclassified(ThemeElement te)
      Set the ThemeElement to use for unclassified or NoData features (including label and symbol).
    • getUnclassified

      public ThemeElement getUnclassified()
      Get the ThemeElement (label and symbol) used for unclassified or NoData features.
    • getUseUnclassified

      public boolean getUseUnclassified()
      A flag if unclassified values should be mapped
    • setUseUnclassified

      public void setUseUnclassified(boolean useUnclassified)
      Set if unclassified values should be mapped
    • getSymbolCount

      public int getSymbolCount()
      Get the number of symbols in this theme
    • setColorset

      public void setColorset(int colorSet)
      Set the legacy color set used for this theme.

      This method is deprecated, use the setPalette(ca.spatial.mapview.symbol.ColorPalette) method instead. See the ColorPalette class for more information about predefined color palettes.

    • setPalette

      public void setPalette(ColorPalette palette)
      Set the color palette to be used for this theme
    • getPalette

      public ColorPalette getPalette()
      Get the color palette being used by this theme
    • getDataValueAt

      public abstract Object getDataValueAt(int row, int period)
      Get the data value for the given object id and period. Themes may override this method to apply normalization or other adjustments.
    • compare

      public int compare(Object o1, Object o2)
      Specified by:
      compare in interface Comparator
    • clone

      public Object clone(ChoroplethTheme newTheme)