diff artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java @ 7541:d20a26e96ef1

issue1585: Part 1/2 of patch from Sascha Teichmann to define shape for datapoints. Just a tiny fix done by me.
author sascha.teichmann@intevation.de
date Fri, 08 Nov 2013 11:57:37 +0100
parents 2d690611d110
children 4dbbdf0c8b2c
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java	Fri Nov 08 10:38:37 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java	Fri Nov 08 11:57:37 2013 +0100
@@ -12,6 +12,7 @@
 
 import java.awt.BasicStroke;
 import java.awt.Color;
+import java.awt.Shape;
 import java.awt.geom.Ellipse2D;
 
 import org.apache.log4j.Logger;
@@ -30,11 +31,18 @@
 
     protected XYLineAndShapeRenderer renderer;
 
+    protected Shape shape;
+
 
     public XYStyle(ThemeDocument theme) {
         this.theme = theme;
     }
 
+    public XYStyle(ThemeDocument theme, Shape shape) {
+        this.theme = theme;
+        this.shape = shape;
+    }
+
 
     /**
      * Applies line color, size and type attributes to renderer, also
@@ -42,11 +50,14 @@
      */
     @Override
     public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx) {
+        this.renderer = r;
+        if (shape != null) {
+            r.setShape(shape);
+        }
         if (theme == null) {
             // Hurray we already applied nothing :)
             return r;
         }
-        this.renderer = r;
         applyLineColor(r, idx);
         applyLineSize(r, idx);
         applyLineType(r, idx);

http://dive4elements.wald.intevation.org