Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
7540:9344aa0fb021 | 7541:d20a26e96ef1 |
---|---|
10 | 10 |
11 import org.dive4elements.river.themes.ThemeDocument; | 11 import org.dive4elements.river.themes.ThemeDocument; |
12 | 12 |
13 import java.awt.BasicStroke; | 13 import java.awt.BasicStroke; |
14 import java.awt.Color; | 14 import java.awt.Color; |
15 import java.awt.Shape; | |
15 import java.awt.geom.Ellipse2D; | 16 import java.awt.geom.Ellipse2D; |
16 | 17 |
17 import org.apache.log4j.Logger; | 18 import org.apache.log4j.Logger; |
18 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; | 19 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; |
19 | 20 |
28 | 29 |
29 protected ThemeDocument theme; | 30 protected ThemeDocument theme; |
30 | 31 |
31 protected XYLineAndShapeRenderer renderer; | 32 protected XYLineAndShapeRenderer renderer; |
32 | 33 |
34 protected Shape shape; | |
35 | |
33 | 36 |
34 public XYStyle(ThemeDocument theme) { | 37 public XYStyle(ThemeDocument theme) { |
35 this.theme = theme; | 38 this.theme = theme; |
39 } | |
40 | |
41 public XYStyle(ThemeDocument theme, Shape shape) { | |
42 this.theme = theme; | |
43 this.shape = shape; | |
36 } | 44 } |
37 | 45 |
38 | 46 |
39 /** | 47 /** |
40 * Applies line color, size and type attributes to renderer, also | 48 * Applies line color, size and type attributes to renderer, also |
41 * whether to draw lines and/or points. | 49 * whether to draw lines and/or points. |
42 */ | 50 */ |
43 @Override | 51 @Override |
44 public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx) { | 52 public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx) { |
53 this.renderer = r; | |
54 if (shape != null) { | |
55 r.setShape(shape); | |
56 } | |
45 if (theme == null) { | 57 if (theme == null) { |
46 // Hurray we already applied nothing :) | 58 // Hurray we already applied nothing :) |
47 return r; | 59 return r; |
48 } | 60 } |
49 this.renderer = r; | |
50 applyLineColor(r, idx); | 61 applyLineColor(r, idx); |
51 applyLineSize(r, idx); | 62 applyLineSize(r, idx); |
52 applyLineType(r, idx); | 63 applyLineType(r, idx); |
53 applyShowLine(r, idx); | 64 applyShowLine(r, idx); |
54 applyShowPoints(r, idx); | 65 applyShowPoints(r, idx); |