From 5b976a6651f4eb05d30afc08b9e1f27c7e52ae00 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 5 Sep 2013 11:33:48 -0700 Subject: altoslib: Finish AltosState changes. Update version number. Removes all of the AltosRecord bits, changes the monitor idle bits to have per-object state updaters. Signed-off-by: Keith Packard --- altosuilib/AltosUISeries.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'altosuilib/AltosUISeries.java') diff --git a/altosuilib/AltosUISeries.java b/altosuilib/AltosUISeries.java index ac09a3cc..ff430d1a 100644 --- a/altosuilib/AltosUISeries.java +++ b/altosuilib/AltosUISeries.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_1.*; +import org.altusmetrum.altoslib_2.*; import org.jfree.ui.*; import org.jfree.chart.*; @@ -34,6 +34,20 @@ import org.jfree.chart.labels.*; import org.jfree.data.xy.*; import org.jfree.data.*; +class AltosUITime extends AltosUnits { + public double value(double v) { return v; } + public String show_units() { return "s"; } + public String say_units() { return "seconds"; } + + public int show_fraction(int width) { + if (width < 5) + return 0; + return width - 5; + } + + public int say_fraction() { return 0; } +} + public class AltosUISeries extends XYSeries implements AltosUIGrapher { AltosUIAxis axis; String label; @@ -47,11 +61,12 @@ public class AltosUISeries extends XYSeries implements AltosUIGrapher { axis.set_units(); StandardXYToolTipGenerator ttg; - String example = units.graph_format(4); + String time_example = (new AltosUITime()).graph_format(7); + String example = units.graph_format(7); ttg = new StandardXYToolTipGenerator(String.format("{1}s: {2}%s ({0})", units.show_units()), - new java.text.DecimalFormat(example), + new java.text.DecimalFormat(time_example), new java.text.DecimalFormat(example)); renderer.setBaseToolTipGenerator(ttg); } -- cgit v1.2.3 From eee9b3ce1e5adae5aa4566050b6d6048344e92c4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 7 Dec 2013 09:54:17 -0800 Subject: altosuilib: Deal with AltosUnits API change The abstract methods in AltosUnits now pass the 'imperial_units' flag explicitly, so deal with that in AltosUnits itself Signed-off-by: Keith Packard --- altosuilib/AltosUISeries.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'altosuilib/AltosUISeries.java') diff --git a/altosuilib/AltosUISeries.java b/altosuilib/AltosUISeries.java index ff430d1a..441eba2b 100644 --- a/altosuilib/AltosUISeries.java +++ b/altosuilib/AltosUISeries.java @@ -35,17 +35,21 @@ import org.jfree.data.xy.*; import org.jfree.data.*; class AltosUITime extends AltosUnits { - public double value(double v) { return v; } - public String show_units() { return "s"; } - public String say_units() { return "seconds"; } + public double value(double v, boolean imperial_units) { return v; } - public int show_fraction(int width) { + public double inverse(double v, boolean imperial_unis) { return v; } + + public String show_units(boolean imperial_units) { return "s"; } + + public String say_units(boolean imperial_units) { return "seconds"; } + + public int show_fraction(int width, boolean imperial_units) { if (width < 5) return 0; return width - 5; } - public int say_fraction() { return 0; } + public int say_fraction(boolean imperial_units) { return 0; } } public class AltosUISeries extends XYSeries implements AltosUIGrapher { -- cgit v1.2.3