Class GradientTheme

All Implemented Interfaces:
Visibility, EditableTableModel, Serializable, Comparator, TableModel

public class GradientTheme extends NumericTheme
The GradientTheme class provides a continuous color gradient rendering of values. Several stretching methods are provided to map data values to the continuous color ramp.
See Also:
Serialized Form
  • Field Details

    • RAMP_SIZE

      public static final int RAMP_SIZE
      The default number of colors used to estimate a continuous range
      See Also:
      Constant Field Values
    • NONE

      public static final int NONE
      The NONE stretch method assumes 8-bit values in the range 0-255
      See Also:
      Constant Field Values
    • MINIMUM_MAXIMUM

      public static final int MINIMUM_MAXIMUM
      Minimum-Maximum uses a linear mapping of values from the actual range of data to fit the color ramp
      See Also:
      Constant Field Values
    • STANDARD_DEVIATION

      public static final int STANDARD_DEVIATION
      Standard Deviation uses a linear mapping between the lower and upper standard deviation limits.
      See Also:
      Constant Field Values
    • PERCENT_CLIP

      public static final int PERCENT_CLIP
      Percent clip sets performs a linear interpolation with clipping of the low and upper percent of values
      See Also:
      Constant Field Values
    • HISTOGRAM_EQUALIZATION

      public static final int HISTOGRAM_EQUALIZATION
      Histogram equalization provides a non-linear mapping to approximate an equal number of elements in each color gradient
      See Also:
      Constant Field Values
  • Constructor Details

    • GradientTheme

      public GradientTheme()
    • GradientTheme

      @Deprecated public GradientTheme(String fieldname, String normalize)
      Deprecated.
    • GradientTheme

      @Deprecated public GradientTheme(String fieldname)
      Deprecated.
  • Method Details

    • getP1

      public double getP1()
    • getP2

      public double getP2()
    • setStdDevLimits

      public void setStdDevLimits(double limit)
    • setClipPercent

      public void setClipPercent(double low, double high)
    • setMethod

      public void setMethod(int method)
      Overrides:
      setMethod in class NumericTheme
    • getSymbol

      public Symbol getSymbol(Object key)
      Description copied from class: Theme
      Get a symbol for a specific key. 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.
      Overrides:
      getSymbol in class NumericTheme
      Parameters:
      key - the key value used to look up the appropriate symbol
    • getSubEditor

      public ThemeEditor getSubEditor(Layer lle)
      Description copied from class: ChoroplethTheme
      Retrive an editor object that will cusomtize the theme.
      Overrides:
      getSubEditor in class NumericTheme
      Parameters:
      lle - the parent layer
    • setPalette

      public void setPalette(ColorPalette palette)
      Description copied from class: ChoroplethTheme
      Set the color palette to be used for this theme
      Overrides:
      setPalette in class ChoroplethTheme
    • compile

      public void compile(Layer layer, AttributeStore store, String fieldname) throws Exception
      Description copied from class: ChoroplethTheme
      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).

      Overrides:
      compile in class NumericTheme
      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
    • generateSymbols

      public 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. This involves rescanning the attribute table to determine the min and max range of the data values, and creating categories based on the classification parameters.
      Overrides:
      generateSymbols in class NumericTheme
      Throws:
      Exception
    • generateSymbols

      public void generateSymbols(String fieldname, Window owner, int period, Layer layer, int method, double p1, double p2) throws Exception
      This method causes the theme information to be recalulated on a new column. This involves rescanning the attribute table to determine the min and max range of the data values, and creating categories based on the classification parameters.
      Throws:
      Exception
    • updateKeys

      public void updateKeys()
      Overrides:
      updateKeys in class NumericTheme
    • clone

      public Object clone()
      Description copied from class: Theme
      Return a deep copy of the object as appropriate for each theme type
      Overrides:
      clone in class NumericTheme
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class ChoroplethTheme
    • addElement

      public void addElement(ThemeElement te, String keys)
      Overrides:
      addElement in class ChoroplethTheme
    • 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
      Overrides:
      removeRow in class ChoroplethTheme
    • 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
      Overrides:
      addRow in class ChoroplethTheme
    • 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
      Overrides:
      addRow in class ChoroplethTheme
    • 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
      Overrides:
      moveRow in class ChoroplethTheme