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[]
dateFormat
protected int
formatterIndex
protected int
oldIndex
protected 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.String
formatHighResString(java.lang.Number utcValueSeconds)
java.lang.Number
fromString(java.lang.String string)
Converts the string provided into an object defined by the specific converter.java.lang.String
getCurrentLocalDateTimeStamp()
java.time.ZoneOffset
getTimeZoneOffset()
protected void
rangeUpdated()
void
setTimeZoneOffset(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.String
toString(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(Axis axis)
Construct a DefaultFormatter for the given NumberAxis- Parameters:
axis
- The axis to format tick marks for
-
DefaultTimeFormatter
public DefaultTimeFormatter()
Construct a DefaultFormatter for the given NumberAxis
-
-
Method Detail
-
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
-
getTimeZoneOffset
public java.time.ZoneOffset getTimeZoneOffset()
- Returns:
- Returns the A time-zone offset from Greenwich/UTC, such as
+02:00
.
-
setTimeZoneOffset
public void setTimeZoneOffset(java.time.ZoneOffset newOffset)
- Parameters:
newOffset
- the ZoneOffset to be taken into account (UTC if 'null'.
-
rangeUpdated
protected void rangeUpdated()
- Specified by:
rangeUpdated
in classAbstractFormatter
-
getCurrentLocalDateTimeStamp
public java.lang.String getCurrentLocalDateTimeStamp()
-
formatHighResString
public java.lang.String formatHighResString(java.lang.Number utcValueSeconds)
-
toString
public java.lang.String toString(java.lang.Number utcValueSeconds)
Description copied from interface:AxisLabelFormatter
Converts the object provided into its string form. Format of the returned string is defined by the specific converter.- Specified by:
toString
in interfaceAxisLabelFormatter
- Specified by:
toString
in classjavafx.util.StringConverter<java.lang.Number>
- Parameters:
utcValueSeconds
- the number to be converted- Returns:
- a string representation of the object passed in.
-
fromString
public java.lang.Number fromString(java.lang.String string)
Description copied from interface:AxisLabelFormatter
Converts 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:
fromString
in interfaceAxisLabelFormatter
- Specified by:
fromString
in 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.
-
-