Package de.gsi.chart.axes.spi.format
Class DefaultTimeTickUnitSupplier
- java.lang.Object
-
- de.gsi.chart.axes.spi.format.DefaultTimeTickUnitSupplier
-
- All Implemented Interfaces:
TickUnitSupplier
public class DefaultTimeTickUnitSupplier extends java.lang.Object implements TickUnitSupplier
- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHIGHRES_FORMATstatic java.lang.StringHIGHRES_MODEstatic intHIGHRES_MODE_INDICESstatic double[]TICK_UNIT_DEFAULTSWe use these for auto ranging to pick a user friendly tick unit.static java.lang.String[]TICK_UNIT_FORMATTER_DEFAULTSThese are matching date formatter strings N.B.
-
Constructor Summary
Constructors Constructor Description DefaultTimeTickUnitSupplier()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecomputeTickUnit(double referenceTickUnit)Should return tick unit that is equal or greater to the given reference tick unit.static intgetTickIndex(double referenceTickUnit)Gets the index in the TICK_UNIT_DEFAULT list, for which the tick unit is just larger or equal to the reference tick unit.
-
-
-
Field Detail
-
HIGHRES_MODE
public static final java.lang.String HIGHRES_MODE
- See Also:
- Constant Field Values
-
HIGHRES_MODE_INDICES
public static final int HIGHRES_MODE_INDICES
- See Also:
- Constant Field Values
-
HIGHRES_FORMAT
public static final java.lang.String HIGHRES_FORMAT
- See Also:
- Constant Field Values
-
TICK_UNIT_DEFAULTS
public static final double[] TICK_UNIT_DEFAULTS
We use these for auto ranging to pick a user friendly tick unit. (must be increasingly bigger)
-
TICK_UNIT_FORMATTER_DEFAULTS
public static final java.lang.String[] TICK_UNIT_FORMATTER_DEFAULTS
These are matching date formatter strings N.B. spaces are being replaced with carriage returns '\n'
-
-
Method Detail
-
getTickIndex
public static int getTickIndex(double referenceTickUnit)
Gets the index in the TICK_UNIT_DEFAULT list, for which the tick unit is just larger or equal to the reference tick unit.- Parameters:
referenceTickUnit- pre-computed tick unit- Returns:
- index in the TICK_UNIT_DEFAULT list
-
computeTickUnit
public double computeTickUnit(double referenceTickUnit)
Should return tick unit that is equal or greater to the given reference tick unit.- Specified by:
computeTickUnitin interfaceTickUnitSupplier- Parameters:
referenceTickUnit- reference tick unit- Returns:
- the computed unit that is equal or grater to the specified one
-
-