Class AuxScale


  • public class AuxScale
    extends java.lang.Object
    Represents a ranged value that can differ according to the content of a plot. To calculate the range of an AuxScale it is not necessary to have detailed information about the geometry of the plot surface (the Surface object required for final plotting). That means it is not required to generate the actual plot surface geometry. However, an approximate plot surface may be required for range calculations.
    Since:
    4 Feb 2013
    Author:
    Mark Taylor
    • Field Detail

      • COLOR

        public static AuxScale COLOR
        AuxRange object used for the standard colour scaling axis.
    • Constructor Detail

      • AuxScale

        public AuxScale​(java.lang.String name)
        Constructor.
        Parameters:
        name - scale name for human consumption
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the scale name.
        Returns:
        name
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getAuxScales

        public static AuxScale[] getAuxScales​(PlotLayer[] layers)
        Utility method to acquire all the scales that are used in an array of layers. The result is unordered and contains each scale only once (like a Set).
        Parameters:
        layers - layers that may reference scales
        Returns:
        array of uses scales
      • calculateAuxRanges

        public static java.util.Map<AuxScale,​Range> calculateAuxRanges​(AuxScale[] scales,
                                                                             PlotLayer[] layers,
                                                                             Surface surface,
                                                                             java.lang.Object[] knownPlans,
                                                                             DataStore dataStore)
        Fills in range information for a submitted list of AuxScale objects from the data in a given list of layers. The supplied plot surface may be used to assess marker shape etc. It should have approximately the same behaviour as the surface on which the plot will take place, but it is usually not critical that it behaves identically.
        Parameters:
        scales - scales to calculate ranges for
        layers - plot layers
        surface - approximate plot surface
        knownPlans - array of available plan objects; may be empty
        dataStore - data repository
        Returns:
        map with a range entry for each of the scales
      • getClippedRanges

        public static java.util.Map<AuxScale,​Range> getClippedRanges​(AuxScale[] scales,
                                                                           java.util.Map<AuxScale,​Range> dataRanges,
                                                                           java.util.Map<AuxScale,​Range> fixRanges,
                                                                           java.util.Map<AuxScale,​Subrange> subranges,
                                                                           java.util.Map<AuxScale,​java.lang.Boolean> logFlags)
        Amalgamates range requirements for a set of scales to return actual ranges to be used. An array of input scales is supplied, along with several maps of optional range constraints, each of which may contain entries for zero or more of the input scales. It is not required to supply entries to any of these maps for each given scale. The returned map has one entry for each scales element.
        Parameters:
        scales - list of scales for which output ranges are required
        dataRanges - actual data ranges acquired by scanning the data, keyed by scale (optional per scale)
        fixRanges - single- or double-ended fixed data ranges, keyed by scale (optional per scale)
        subranges - subrange keyed by scale; optional per scale, if absent 0-1 is assumed
        logFlags - flags indicating logarithmic scale; optional per scale, absent equivalent to false indicates linear scaling
        Returns:
        map with one entry for each input scale giving definite ranges to use in the plot
      • clipRange

        public static Range clipRange​(Range dataRange,
                                      Range fixRange,
                                      Subrange subrange,
                                      boolean isLog)
        Amalgamates range requirements for a single scale to return the actual range to use. Any or all of the arguments may be null.
        Parameters:
        dataRange - actual data range acquired by scanning the data, or null
        fixRange - single- or double-ended fixed data range, or null
        subrange - subrange, if null 0-1 is assumed
        isLog - true for logarithmic scale, false for linear
        Returns:
        definite range for plotting