X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosuilib%2FAltosUIMarker.java;h=9d8dde6062d135678c04eaf021a1f9f84e312180;hb=a37b687670dd1ccb0274e5fe6bf6145c4fc5acc8;hp=560153f285f64a53f13d6aa4958121095708f5d7;hpb=0169e56ad030c0096b1068d00f06957990dfb31f;p=fw%2Faltos diff --git a/altosuilib/AltosUIMarker.java b/altosuilib/AltosUIMarker.java index 560153f2..9d8dde60 100644 --- a/altosuilib/AltosUIMarker.java +++ b/altosuilib/AltosUIMarker.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_1; +package org.altusmetrum.altosuilib_11; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_1.*; +import org.altusmetrum.altoslib_11.*; import org.jfree.ui.*; import org.jfree.chart.*; @@ -41,7 +42,7 @@ public class AltosUIMarker implements AltosUIGrapher { boolean enabled; int fetch; Color color; - + private void remove_markers() { for (ValueMarker marker : markers) plot.removeDomainMarker(marker); @@ -72,20 +73,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 +101,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); }