diff options
| author | Keith Packard <keithp@keithp.com> | 2013-09-05 11:33:48 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-09-05 11:35:14 -0700 |
| commit | 5b976a6651f4eb05d30afc08b9e1f27c7e52ae00 (patch) | |
| tree | 3a8f38d92fdc3b3e9e62d7744ff93a0f9ca8f7dc /altosuilib/AltosUISeries.java | |
| parent | b984ff81d6b8979574e0248ffe8876634b8e1942 (diff) | |
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 <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUISeries.java')
| -rw-r--r-- | altosuilib/AltosUISeries.java | 21 |
1 files changed, 18 insertions, 3 deletions
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); } |
