All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.gsi.chart.utils.TimeStringConverter Maven / Gradle / Ivy

Go to download

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, ...).

There is a newer version: 11.2.7
Show newest version
/*****************************************************************************
 *                                                                           *
 * 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");
  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy