de.gsi.chart.utils.TimeStringConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chartfx-chart Show documentation
Show all versions of chartfx-chart Show documentation
This charting library ${project.artifactId}- is an extension
in the spirit of Oracle's XYChart and performance/time-proven JDataViewer charting functionalities.
Emphasis was put on plotting performance for both large number of data points and real-time displays,
as well as scientific accuracies leading to error bar/surface plots, and other scientific plotting
features (parameter measurements, fitting, multiple axes, zoom, ...).
/*****************************************************************************
* *
* BI Common - convert Number <-> String *
* *
* modified: 2017-03-07 Harald Braeuning *
* *
****************************************************************************/
package de.gsi.chart.utils;
import java.util.GregorianCalendar;
import javafx.util.StringConverter;
/**
*
* @author braeun
*/
public class TimeStringConverter extends StringConverter {
private final GregorianCalendar calendar = new GregorianCalendar();
public TimeStringConverter()
{
}
@Override
public String toString(Number object)
{
calendar.setTimeInMillis(object.longValue());
return String.format("%tT",calendar);
}
@Override
public Number fromString(String string)
{
throw new UnsupportedOperationException("Converting from string not supported yet");
}
}