summaryrefslogtreecommitdiff
path: root/altosuilib/AltosUIMarker.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-02-10 00:29:29 -0800
committerKeith Packard <keithp@keithp.com>2013-02-10 00:30:32 -0800
commit2efd3ad80d4fefa8ccc1b80a2e657dbf9ba0c60f (patch)
tree02fdd0be077d082702da5f150670437e080318e2 /altosuilib/AltosUIMarker.java
parent0169e56ad030c0096b1068d00f06957990dfb31f (diff)
altosui/altoslib/altosuilib: Switch altosui to shared graph code
This adds a configuration tab to the graph window to enable/disable various plotted values. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIMarker.java')
-rw-r--r--altosuilib/AltosUIMarker.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/altosuilib/AltosUIMarker.java b/altosuilib/AltosUIMarker.java
index 560153f2..e2eb9028 100644
--- a/altosuilib/AltosUIMarker.java
+++ b/altosuilib/AltosUIMarker.java
@@ -72,20 +72,23 @@ public class AltosUIMarker implements AltosUIGrapher {
}
public void add(AltosUIDataPoint dataPoint) {
- int id = dataPoint.id(fetch);
- if (id < 0)
- return;
- if (id == last_id)
- return;
- ValueMarker marker = new ValueMarker(dataPoint.x());
- marker.setLabel(dataPoint.id_name(fetch));
- marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
- marker.setLabelTextAnchor(TextAnchor.TOP_LEFT);
- marker.setPaint(color);
- if (enabled)
- plot.addDomainMarker(marker);
- markers.add(marker);
- last_id = id;
+ try {
+ int id = dataPoint.id(fetch);
+ if (id < 0)
+ return;
+ if (id == last_id)
+ return;
+ ValueMarker marker = new ValueMarker(dataPoint.x());
+ marker.setLabel(dataPoint.id_name(fetch));
+ marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
+ marker.setLabelTextAnchor(TextAnchor.TOP_LEFT);
+ marker.setPaint(color);
+ if (enabled)
+ plot.addDomainMarker(marker);
+ markers.add(marker);
+ last_id = id;
+ } catch (AltosUIDataMissing m) {
+ }
}
public AltosUIMarker (int fetch, Color color, XYPlot plot, boolean enable) {