comparison flys-artifacts/src/main/java/de/intevation/flys/exports/StyledXYSeries.java @ 2017:e384d78ff78b

Cosmetics. flys-artifacts/trunk@3472 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 20 Dec 2011 06:26:25 +0000
parents 6c24ffe946a5
children 4cdd9c4896f6
comparison
equal deleted inserted replaced
2016:796dfe96b6b2 2017:e384d78ff78b
12 import org.jfree.data.xy.XYSeries; 12 import org.jfree.data.xy.XYSeries;
13 13
14 import de.intevation.flys.utils.ThemeUtil; 14 import de.intevation.flys.utils.ThemeUtil;
15 15
16 /** 16 /**
17 * Dataset in two dimensions with additional theme-document. 17 * Dataseries in two dimensions with additional theme-document and further
18 * display options.
18 * The theme-document will later "style" the graphical representation. 19 * The theme-document will later "style" the graphical representation.
20 * The display options can be used to control the z-order and the axis of the
21 * dataseries.
19 */ 22 */
20 public class StyledXYSeries extends XYSeries { 23 public class StyledXYSeries extends XYSeries {
21 24
22 protected Document theme; 25 protected Document theme;
23 26
38 super(key, sorted); 41 super(key, sorted);
39 this.theme = theme; 42 this.theme = theme;
40 } 43 }
41 44
42 45
46 /**
47 * Applies line color, size and type attributes to renderer, also
48 * whether to draw lines and/or points.
49 */
43 public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx){ 50 public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx){
44 applyLineColor(r, idx); 51 applyLineColor(r, idx);
45 applyLineSize(r, idx); 52 applyLineSize(r, idx);
46 applyLineType(r, idx); 53 applyLineType(r, idx);
47 applyShowLine(r, idx); 54 applyShowLine(r, idx);
49 56
50 return r; 57 return r;
51 } 58 }
52 59
53 60
61 /** Set line color to renderer. */
54 protected void applyLineColor(XYLineAndShapeRenderer r, int idx) { 62 protected void applyLineColor(XYLineAndShapeRenderer r, int idx) {
55 Color c = ThemeUtil.parseLineColorField(theme); 63 Color c = ThemeUtil.parseLineColorField(theme);
56 r.setSeriesPaint(idx, c); 64 r.setSeriesPaint(idx, c);
57 } 65 }
58 66
83 dashes, 91 dashes,
84 0.0f)); 92 0.0f));
85 } 93 }
86 94
87 95
96 /**
97 * Sets form and visibility of points.
98 */
88 protected void applyShowPoints(XYLineAndShapeRenderer r, int idx) { 99 protected void applyShowPoints(XYLineAndShapeRenderer r, int idx) {
89 boolean show = ThemeUtil.parseShowPoints(theme); 100 boolean show = ThemeUtil.parseShowPoints(theme);
90 int size = ThemeUtil.parseLineWidth(theme); 101 int size = ThemeUtil.parseLineWidth(theme);
91 r.setSeriesShape(idx, new Ellipse2D.Double(- size, 102 r.setSeriesShape(idx, new Ellipse2D.Double(- size,
92 - size, 103 - size,

http://dive4elements.wald.intevation.org