From 60f4d69592c440ab7bb67a04f4c07fc7279d2c20 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 10 May 2016 22:46:58 -0700 Subject: altoslib: Switch distance from m/ft to km/miles for large values This adds lots of infrastructure to deal with making the unit used depend on the value itself, and then uses it only for distances. Signed-off-by: Keith Packard --- altosuilib/AltosUISeries.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'altosuilib/AltosUISeries.java') diff --git a/altosuilib/AltosUISeries.java b/altosuilib/AltosUISeries.java index b16f046b..c9401be0 100644 --- a/altosuilib/AltosUISeries.java +++ b/altosuilib/AltosUISeries.java @@ -69,7 +69,7 @@ public class AltosUISeries extends XYSeries implements AltosUIGrapher { String example = units.graph_format(7); ttg = new StandardXYToolTipGenerator(String.format("{1}s: {2}%s ({0})", - units.show_units()), + units.graph_units()), new java.text.DecimalFormat(time_example), new java.text.DecimalFormat(example)); renderer.setBaseToolTipGenerator(ttg); @@ -85,7 +85,7 @@ public class AltosUISeries extends XYSeries implements AltosUIGrapher { public void add(AltosUIDataPoint dataPoint) { try { - super.add(dataPoint.x(), units.value(dataPoint.y(fetch))); + super.add(dataPoint.x(), units.graph_value(dataPoint.y(fetch))); } catch (AltosUIDataMissing dm) { } } -- cgit v1.2.3