X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosuilib%2FAltosUIGraph.java;h=870c4e9356de5fd82d468ba2b0e6b4f200900424;hp=5c589c02555070637c7d3055cb9c91087f70c848;hb=c8078d352a7f54a4a97d25af080155d3f875536a;hpb=bf88c5f829ea5d32043431945e862a9f6c96740a diff --git a/altosuilib/AltosUIGraph.java b/altosuilib/AltosUIGraph.java index 5c589c02..870c4e93 100644 --- a/altosuilib/AltosUIGraph.java +++ b/altosuilib/AltosUIGraph.java @@ -15,14 +15,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_1; +package org.altusmetrum.altosuilib_3; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_1.*; +import org.altusmetrum.altoslib_5.*; import org.jfree.ui.*; import org.jfree.chart.*; @@ -82,22 +82,26 @@ public class AltosUIGraph implements AltosUnitsListener { public void addSeries(String label, int fetch, AltosUnits units, Color color) { addSeries(label, fetch, units, color, true, newAxis(label, units, color)); } - + public void addMarker(String label, int fetch, Color color) { AltosUIMarker marker = new AltosUIMarker(fetch, color, plot); - if (enable != null) - enable.add(label, marker, true); this.graphers.add(marker); } public void resetData() { - for (AltosUIGrapher g : graphers) + for (AltosUIGrapher g : graphers) { g.clear(); + g.setNotify(false); + } if (dataSet != null) { for (AltosUIDataPoint dataPoint : dataSet.dataPoints()) for (AltosUIGrapher g : graphers) g.add(dataPoint); } + for (AltosUIGrapher g : graphers) { + g.setNotify(true); + g.fireSeriesChanged(); + } } public void units_changed(boolean imperial_units) { @@ -125,7 +129,7 @@ public class AltosUIGraph implements AltosUnitsListener { this.axis_index = 0; xAxis = new NumberAxis("Time (s)"); - + xAxis.setAutoRangeIncludesZero(true); plot = new XYPlot(); @@ -152,4 +156,4 @@ public class AltosUIGraph implements AltosUnitsListener { AltosPreferences.register_units_listener(this); } -} \ No newline at end of file +}