Package de.gsi.chart.axes.spi.format
Class DefaultTimeFormatter
- java.lang.Object
-
- javafx.util.StringConverter<java.lang.Number>
-
- de.gsi.chart.axes.spi.format.AbstractFormatter
-
- de.gsi.chart.axes.spi.format.DefaultTimeFormatter
-
- All Implemented Interfaces:
AxisLabelFormatter
public class DefaultTimeFormatter extends AbstractFormatter
- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected java.time.format.DateTimeFormatter[]dateFormatprotected intformatterIndexprotected intoldIndexprotected javafx.beans.property.ObjectProperty<java.time.ZoneOffset>timeZone-
Fields inherited from class de.gsi.chart.axes.spi.format.AbstractFormatter
labelCache, localSchmidtTriggerThreshold, majorTickMarksCopy, rangeMax, rangeMin, schmittTriggerThreshold, unitScaling
-
-
Constructor Summary
Constructors Constructor Description DefaultTimeFormatter()Construct a DefaultFormatter for the given NumberAxisDefaultTimeFormatter(Axis axis)Construct a DefaultFormatter for the given NumberAxis
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringformatHighResString(java.lang.Number utcValueSeconds)java.lang.NumberfromString(java.lang.String string)Converts the string provided into an object defined by the specific converter.java.lang.StringgetCurrentLocalDateTimeStamp()java.time.ZoneOffsetgetTimeZoneOffset()protected voidrangeUpdated()voidsetTimeZoneOffset(java.time.ZoneOffset newOffset)javafx.beans.property.ObjectProperty<java.time.ZoneOffset>timeZoneOffsetProperty()A time-zone offset from Greenwich/UTC, such as+02:00.java.lang.StringtoString(java.lang.Number utcValueSeconds)Converts the object provided into its string form.-
Methods inherited from class de.gsi.chart.axes.spi.format.AbstractFormatter
getLogRange, getRange, getTickUnitSupplier, schmittTriggerThresholdProperty, setTickUnitSupplier, tickUnitSupplierProperty, updateFormatter
-
-
-
-
Constructor Detail
-
DefaultTimeFormatter
public DefaultTimeFormatter()
Construct a DefaultFormatter for the given NumberAxis
-
DefaultTimeFormatter
public DefaultTimeFormatter(Axis axis)
Construct a DefaultFormatter for the given NumberAxis- Parameters:
axis- The axis to format tick marks for
-
-
Method Detail
-
formatHighResString
public java.lang.String formatHighResString(java.lang.Number utcValueSeconds)
-
fromString
public java.lang.Number fromString(java.lang.String string)
Description copied from interface:AxisLabelFormatterConverts the string provided into an object defined by the specific converter. Format of the string and type of the resulting object is defined by the specific converter.- Specified by:
fromStringin interfaceAxisLabelFormatter- Specified by:
fromStringin classjavafx.util.StringConverter<java.lang.Number>- Parameters:
string- the string to be converted back into a number- Returns:
- an object representation of the string passed in.
-
getCurrentLocalDateTimeStamp
public java.lang.String getCurrentLocalDateTimeStamp()
-
getTimeZoneOffset
public java.time.ZoneOffset getTimeZoneOffset()
- Returns:
- Returns the A time-zone offset from Greenwich/UTC, such as
+02:00.
-
rangeUpdated
protected void rangeUpdated()
- Specified by:
rangeUpdatedin classAbstractFormatter
-
setTimeZoneOffset
public void setTimeZoneOffset(java.time.ZoneOffset newOffset)
- Parameters:
newOffset- the ZoneOffset to be taken into account (UTC if 'null'.
-
timeZoneOffsetProperty
public javafx.beans.property.ObjectProperty<java.time.ZoneOffset> timeZoneOffsetProperty()
A time-zone offset from Greenwich/UTC, such as+02:00.A time-zone offset is the amount of time that a time-zone differs from Greenwich/UTC. This is usually a fixed number of hours and minutes.
- Returns:
- ZoneOffset property that is being used to compute the local time axis
-
toString
public java.lang.String toString(java.lang.Number utcValueSeconds)
Description copied from interface:AxisLabelFormatterConverts the object provided into its string form. Format of the returned string is defined by the specific converter.- Specified by:
toStringin interfaceAxisLabelFormatter- Specified by:
toStringin classjavafx.util.StringConverter<java.lang.Number>- Parameters:
utcValueSeconds- the number to be converted- Returns:
- a string representation of the object passed in.
-
-