Class PerUnitConfigKey<U extends Unit>


public class PerUnitConfigKey<U extends Unit> extends OptionConfigKey<U>
ConfigKey for unit selection. The main trick this OptionConfigKey subclass has is to manage Reporting of a plot's Combiner.Type, so it can work in concert with a Combiner config key to provide a more comprehensible GUI. If the Combiner is not density-like, then this selector is irrelevant, and so the GUI component is disabled. Client PlotLayers should assemble ReportMaps with the ReportKey from this ConfigKeys' getCombinerTypeReportKey() method filled in appropriately.
Since:
25 Jan 2018
Author:
Mark Taylor
  • Constructor Details

    • PerUnitConfigKey

      public PerUnitConfigKey(ConfigMeta meta, Class<U> clazz, U[] options, U dflt)
      Constructor.
      Parameters:
      meta - metadata
      clazz - class to which all the possible options belong
      options - array of possible values for this key
      dflt - default option, should be one of options
  • Method Details

    • getCombinerTypeReportKey

      public ReportKey<Combiner.Type> getCombinerTypeReportKey()
      Returns a ReportKey that client PlotLayers should fill in when generating their ReportMap.
      Returns:
      combiner key report key
    • getXmlDescription

      public String getXmlDescription(U unit)
      Description copied from class: OptionConfigKey
      Returns a description in XML of the given option value. This, along with OptionConfigKey.valueToString(T), is used by the OptionConfigKey.getOptionsXml() method to assemble a described list of the options.
      Specified by:
      getXmlDescription in class OptionConfigKey<U extends Unit>
      Parameters:
      unit - possible value of this key
      Returns:
      short snippet of XML (not wrapped in any outer element) describing the value; may be null if no description required or available
    • createSpecifier

      public Specifier<U> createSpecifier()
      Description copied from class: ConfigKey
      Constructs a graphical control with which the user can specify a suitable value for association with this key.
      Overrides:
      createSpecifier in class OptionConfigKey<U extends Unit>
      Returns:
      new specifier