From 7004f6ef5aedd8d9f025f64606ab74f360163c69 Mon Sep 17 00:00:00 2001 From: Niclas Thobaben Date: Wed, 14 Feb 2018 12:06:33 +0100 Subject: [PATCH] added static doubleToTimeFormat method to TimePlotLabeler --- src/org/hwo/ui/diagram/TimePlotLabeler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/hwo/ui/diagram/TimePlotLabeler.java b/src/org/hwo/ui/diagram/TimePlotLabeler.java index f51047d..e683fa2 100644 --- a/src/org/hwo/ui/diagram/TimePlotLabeler.java +++ b/src/org/hwo/ui/diagram/TimePlotLabeler.java @@ -32,6 +32,10 @@ public class TimePlotLabeler implements PlotLabeler{ @Override public String getAbzisseLabel(JDiagram diagram, Double pos) { + return doubleSecToString(pos); + } + + public static String doubleSecToString(Double pos) { //pos == seconds int hour, minute, second, millisecond; hour = (int)(pos / 3600); @@ -43,8 +47,6 @@ public class TimePlotLabeler implements PlotLabeler{ sm = minute < 10? String.format("0%d", minute) : String.format("%d", minute); ss = second < 10? String.format("0%d", second) : String.format("%d", second); sms = millisecond < 10? String.format("0%d", millisecond) : String.format("%d", millisecond); - return sh + ":" + sm + ":" + ss + "." + sms; } - }