Class StandardWrapper1D
- java.lang.Object
-
- com.metsci.glimpse.core.support.wrapped.StandardWrapper1D
-
-
Constructor Summary
Constructors Constructor Description StandardWrapper1D(double wrapMin, double wrapMax)Client code should generally NOT call this constructor, but should useWrapper1D#getWrapper(com.metsci.glimpse.axis.Axis1D)instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(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.inthashCode()doublewrapDelta(double delta)Returns the apparent distance between two values in a wrapped context.doublewrapMax()The maxinum edge of this range.doublewrapMin()The mininum edge of this range.doublewrapNear(double ref, double value)Wrapsvalueso that it is as near as possible toref.doublewrapValue(double value)Wrapsvalueinto the range specified by thisWrap.
-
-
-
Method Detail
-
wrapMin
public double wrapMin()
Description copied from interface:Wrapper1DThe mininum edge of this range. For horizontal wrapping, this is the left edge; for vertical it is the bottom.May return an infinite value.
-
wrapMax
public double wrapMax()
Description copied from interface:Wrapper1DThe maxinum edge of this range. For horizontal wrapping, this is the right edge; for vertical it is the top.May return an infinite value.
-
wrapValue
public double wrapValue(double value)
Description copied from interface:Wrapper1DWrapsvalueinto the range specified by thisWrap.
-
wrapNear
public double wrapNear(double ref, double value)Description copied from interface:Wrapper1DWrapsvalueso that it is as near as possible toref. This may or may not be inside the range specified by thisWrap. For example, ifrefis 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.)
-
wrapDelta
public double wrapDelta(double delta)
Description copied from interface:Wrapper1DReturns the apparent distance between two values in a wrapped context. For example, adeltaslightly less than the wrap-span will give a wrapped delta slightly less than zero.
-
getRenderShifts
public double[] getRenderShifts(double minValue, double maxValue)Description copied from interface:Wrapper1DFor an item occupying coordinates [minValue,maxValue], return a set of coordinate shifts at which the item should be rendered.Common cases:
- For an item that does not cross either wrapMin or wrapMax, returns { 0.0 }
- For an item that crosses wrapMin, returns { 0.0, +wrapSpan }
- 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:
getRenderShiftsin interfaceWrapper1D
-
-