diff options
author | Keith Packard <keithp@keithp.com> | 2013-03-01 12:34:04 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-03-01 12:34:04 -0800 |
commit | 113b1146f6ac0ecd423f3fb409e02730604b8aca (patch) | |
tree | c7594c7ec2720185b950710360c653216793c122 /altosuilib/AltosUIGraph.java | |
parent | 351e4110f519d18bb36747955578e9e5b9aeec7b (diff) |
altosuilib: Disable graph element notifies for each add()
This reduces the number of notify calls made and dramatically speeds
up graph creation.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIGraph.java')
-rw-r--r-- | altosuilib/AltosUIGraph.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/altosuilib/AltosUIGraph.java b/altosuilib/AltosUIGraph.java index 5c589c02..5f3a2eef 100644 --- a/altosuilib/AltosUIGraph.java +++ b/altosuilib/AltosUIGraph.java @@ -91,13 +91,19 @@ public class AltosUIGraph implements AltosUnitsListener { } 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) { |