[PATCH] FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/

Wald Commits scm-commit at wald.intevation.org
Tue Aug 20 19:50:47 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1377021037 -7200
# Node ID a071f0a8088308094cdf93cf90bc506387fa4954
# Parent  437856cec419d7d4b1b9a3b0036c105c20c67da1
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/

diff -r 437856cec419 -r a071f0a80883 artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Tue Aug 20 19:24:26 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Tue Aug 20 19:50:37 2013 +0200
@@ -314,13 +314,13 @@
             return;
         }
 
-        XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc);
+        XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, true, doc);
         List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
 
         DateFormat dateFormat = DateFormat.getDateInstance(
                 DateFormat.SHORT);
 
-        series.add(qwd.getQ(), qwd.getW());
+        series.add(qwd.getQ(), qwd.getW(), false);
 
         XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
                 dateFormat.format(qwd.getDate()),
@@ -351,7 +351,7 @@
         double[] kms = wqkms.getKms();
         for (int i = 0 ; i< kms.length; i++) {
             if (Math.abs(kms[i] - ckm) <= EPSILON) {
-                series.add(wqkms.getQ(i), wqkms.getW(i));
+                series.add(wqkms.getQ(i), wqkms.getW(i), false);
                 addAxisSeries(series, YAXIS.W.idx, visible);
                 if(visible && ThemeUtil.parseShowPointLabel(theme)) {
                     List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
@@ -598,7 +598,7 @@
             logger.debug("FixWQCurveGenerator: doWQOut: double[][]");
             double [][] data = (double [][]) wqkms;
 
-            XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
+            XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, true, theme);
             StyledSeriesBuilder.addPoints(series, data, true);
 
             addAxisSeries(series, YAXIS.W.idx, visible);
@@ -616,7 +616,11 @@
             return;
         }
 
-        XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
+        XYSeries series = new StyledXYSeries(
+            aaf.getFacetDescription(),
+            false, true,
+            theme);
+
         List<XYTextAnnotation> textAnnos =
                 new ArrayList<XYTextAnnotation>(qws.length);
 
@@ -624,7 +628,7 @@
                 DateFormat.SHORT);
 
         for (QWI qw: qws) {
-            series.add(qw.getQ(), qw.getW());
+            series.add(qw.getQ(), qw.getW(), false);
 
             XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
                     dateFormat.format(qw.getDate()),
diff -r 437856cec419 -r a071f0a80883 artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.java
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.java	Tue Aug 20 19:24:26 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.java	Tue Aug 20 19:50:37 2013 +0200
@@ -53,6 +53,18 @@
         this.label = key.toString();
     }
 
+    public StyledXYSeries(
+        String  key,
+        boolean sorted,
+        boolean allowDuplicateXValues,
+        Document theme
+    ) {
+        super(key, sorted, allowDuplicateXValues);
+        setStyle(new XYStyle(theme));
+        this.label = key.toString();
+    }
+
+
 
     @Override
     public void setStyle(Style style) {


More information about the Dive4elements-commits mailing list