Class StandardWrapper1D

    • Field Summary

      Fields 
      Modifier and Type Field Description
      double wrapMax  
      double wrapMin  
    • Constructor Summary

      Constructors 
      Constructor Description
      StandardWrapper1D​(double wrapMin, double wrapMax)
      Client code should generally NOT call this constructor, but should use Wrapper1D#getWrapper(com.metsci.glimpse.axis.Axis1D) instead.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object o)  
      double[] getRenderShifts​(double minValue, double maxValue)
      For an item occupying coordinates [minValue,maxValue], return a set of coordinate shifts at which the item should be rendered.
      int hashCode()  
      double wrapDelta​(double delta)
      Returns the apparent distance between two values in a wrapped context.
      double wrapMax()
      The maxinum edge of this range.
      double wrapMin()
      The mininum edge of this range.
      double wrapNear​(double ref, double value)
      Wraps value so that it is as near as possible to ref.
      double wrapValue​(double value)
      Wraps value into the range specified by this Wrap.
    • Field Detail

      • wrapMin

        public final double wrapMin
      • wrapMax

        public final double wrapMax
    • Constructor Detail

      • StandardWrapper1D

        public StandardWrapper1D​(double wrapMin,
                                 double wrapMax)
        Client code should generally NOT call this constructor, but should use Wrapper1D#getWrapper(com.metsci.glimpse.axis.Axis1D) instead.
    • Method Detail

      • wrapMin

        public double wrapMin()
        Description copied from interface: Wrapper1D
        The mininum edge of this range. For horizontal wrapping, this is the left edge; for vertical it is the bottom.

        May return an infinite value.

        Specified by:
        wrapMin in interface Wrapper1D
      • wrapMax

        public double wrapMax()
        Description copied from interface: Wrapper1D
        The maxinum edge of this range. For horizontal wrapping, this is the right edge; for vertical it is the top.

        May return an infinite value.

        Specified by:
        wrapMax in interface Wrapper1D
      • wrapValue

        public double wrapValue​(double value)
        Description copied from interface: Wrapper1D
        Wraps value into the range specified by this Wrap.
        Specified by:
        wrapValue in interface Wrapper1D
      • wrapNear

        public double wrapNear​(double ref,
                               double value)
        Description copied from interface: Wrapper1D
        Wraps value so that it is as near as possible to ref. This may or may not be inside the range specified by this Wrap. For example, if ref is near the right edge of the range, then the returned value may be beyond the right edge.

        This is useful when drawing an item in a wrapped context without getting ugly retrace artifacts if the item crosses the edge of the wrap range. (The typical approach is to draw the item twice: once straddling the max edge, and once straddling the min edge.)

        Specified by:
        wrapNear in interface Wrapper1D
      • wrapDelta

        public double wrapDelta​(double delta)
        Description copied from interface: Wrapper1D
        Returns the apparent distance between two values in a wrapped context. For example, a delta slightly less than the wrap-span will give a wrapped delta slightly less than zero.
        Specified by:
        wrapDelta in interface Wrapper1D
      • getRenderShifts

        public double[] getRenderShifts​(double minValue,
                                        double maxValue)
        Description copied from interface: Wrapper1D
        For an item occupying coordinates [minValue,maxValue], return a set of coordinate shifts at which the item should be rendered.

        Common cases:

        1. For an item that does not cross either wrapMin or wrapMax, returns { 0.0 }
        2. For an item that crosses wrapMin, returns { 0.0, +wrapSpan }
        3. For an item that crosses wrapMax, returns { 0.0, -wrapSpan }

        An item may cross both wrapMin and wrapMax. It may also cross the wrap range more than once.

        Specified by:
        getRenderShifts in interface Wrapper1D
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object