altoslib: Use symbols in AltosRomconfig instead of fixed offsets
[fw/altos] / altosuilib / AltosUIMarker.java
index 560153f285f64a53f13d6aa4958121095708f5d7..e4262abd3c77c47818301bdae7e6cce3e07ad0a8 100644 (file)
@@ -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.*;
@@ -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) {
@@ -97,6 +100,12 @@ public class AltosUIMarker implements AltosUIGrapher {
                this.enabled = enable;
        }
 
+       public void setNotify(boolean notify) {
+       }
+
+       public void fireSeriesChanged() {
+       }
+
        public AltosUIMarker (int fetch, Color color, XYPlot plot) {
                this(fetch, color, plot, true);
        }