comparison artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.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 1b35b2ddfc28
children 4fe290eddb43
comparison
equal deleted inserted replaced
7540:9344aa0fb021 7541:d20a26e96ef1
14 import org.dive4elements.river.themes.ThemeDocument; 14 import org.dive4elements.river.themes.ThemeDocument;
15 15
16 import org.jfree.data.xy.XYDataItem; 16 import org.jfree.data.xy.XYDataItem;
17 import org.jfree.data.xy.XYSeries; 17 import org.jfree.data.xy.XYSeries;
18 18
19 import java.awt.Shape;
20
19 /** 21 /**
20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
21 */ 23 */
22 public class StyledXYSeries extends XYSeries implements StyledSeries, HasLabel { 24 public class StyledXYSeries extends XYSeries implements StyledSeries, HasLabel {
23 25
28 /** If this Series is to be labelled, use this String as label. */ 30 /** If this Series is to be labelled, use this String as label. */
29 protected String label; 31 protected String label;
30 32
31 33
32 public StyledXYSeries(String key, ThemeDocument theme) { 34 public StyledXYSeries(String key, ThemeDocument theme) {
33 this(key, true, theme); 35 this(key, true, theme, (Shape)null);
34 this.label = key.toString();
35 } 36 }
36 37
37 38
38 public StyledXYSeries(String key, ThemeDocument theme, XYSeries unstyledSeries) { 39 public StyledXYSeries(String key, ThemeDocument theme, XYSeries unstyledSeries) {
39 this(key, theme); 40 this(key, theme);
40 add(unstyledSeries); 41 add(unstyledSeries);
41 } 42 }
42 43
44 public StyledXYSeries(String key, boolean sorted, ThemeDocument theme) {
45 this(key, sorted, theme, (Shape)null);
46 }
47
48
49 public StyledXYSeries(String key, ThemeDocument theme, Shape shape) {
50 this(key, true, theme, shape);
51 }
43 52
44 /** 53 /**
45 * @param sorted whether or not to sort the points. Sorting will move NANs 54 * @param sorted whether or not to sort the points. Sorting will move NANs
46 * to one extrema which can cause problems in certain 55 * to one extrema which can cause problems in certain
47 * algorithms. 56 * algorithms.
48 */ 57 */
49 public StyledXYSeries(String key, boolean sorted, ThemeDocument theme) { 58 public StyledXYSeries(String key, boolean sorted, ThemeDocument theme, Shape shape) {
50 super(key, sorted); 59 super(key, sorted);
51 setStyle(new XYStyle(theme)); 60 setStyle(new XYStyle(theme, shape));
52 this.label = key.toString(); 61 this.label = key.toString();
53 } 62 }
54 63
55 public StyledXYSeries( 64 public StyledXYSeries(
56 String key, 65 String key,
57 boolean sorted, 66 boolean sorted,
58 boolean allowDuplicateXValues, 67 boolean allowDuplicateXValues,
59 ThemeDocument theme 68 ThemeDocument theme
60 ) { 69 ) {
70 this(key, sorted, allowDuplicateXValues, theme, (Shape)null);
71 }
72
73 public StyledXYSeries(
74 String key,
75 boolean sorted,
76 boolean allowDuplicateXValues,
77 ThemeDocument theme,
78 Shape shape
79 ) {
61 super(key, sorted, allowDuplicateXValues); 80 super(key, sorted, allowDuplicateXValues);
62 setStyle(new XYStyle(theme)); 81 setStyle(new XYStyle(theme, shape));
63 this.label = key.toString(); 82 this.label = key.toString();
64 } 83 }
65
66 84
67 85
68 @Override 86 @Override
69 public void setStyle(Style style) { 87 public void setStyle(Style style) {
70 this.style = style; 88 this.style = style;

http://dive4elements.wald.intevation.org