Class RampKeySet

java.lang.Object
uk.ac.starlink.ttools.plot2.config.RampKeySet
All Implemented Interfaces:
KeySet<RampKeySet.Ramp>

public class RampKeySet extends Object implements KeySet<RampKeySet.Ramp>
KeySet for defining the characteristics of a colour ramp.
Since:
16 Sep 2014
Author:
Mark Taylor
  • Constructor Details

    • RampKeySet

      public RampKeySet(String axname, String axName, ClippedShader[] shaders, Scaling dfltScaling, boolean hasDataclip)
      Constructor.
      Parameters:
      axname - short form of axis name, used in text parameter names
      axName - long form of axis name, used in descriptions
      shaders - array of preset shader options
      dfltScaling - default scaling function
      hasDataclip - true iff a data subrange key is to be included
  • Method Details

    • getKeys

      public ConfigKey<?>[] getKeys()
      Description copied from interface: KeySet
      The config keys used to specify an object.
      Specified by:
      getKeys in interface KeySet<RampKeySet.Ramp>
      Returns:
      fixed list of config keys
    • createValue

      public RampKeySet.Ramp createValue(ConfigMap config)
      Description copied from interface: KeySet
      Creates a typed value based on the values in a map corresponding to this object's keys.
      Specified by:
      createValue in interface KeySet<RampKeySet.Ramp>
      Parameters:
      config - map for which the values corresponding to getKeys will be examined
      Returns:
      specified typed value
    • getShaders

      public ClippedShader[] getShaders()
      Returns an orderedlist of the shaders provided by this set.
      Returns:
      shaders
    • createShadeAxisFactory

      public static ShadeAxisFactory createShadeAxisFactory(RampKeySet.Ramp ramp, Captioner captioner, String label, double crowding, int rampWidth)
      Creates a ShadeAxisFactory for a given ramp.
      Parameters:
      ramp - ramp
      captioner - shader ramp captioner
      label - shader ramp label
      crowding - tick crowding factor (1 is normal)
      rampWidth - width of colour map ramp in pixels
      Returns:
      new factory