Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.java @ 4378:8eb1d6dc96a9
Add chart generation for fixings in bed differences generators
If matching fixanalysis data is loaded via the datacage the bed difference
generators are now able to display graphs for the additonal data.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 15:50:35 +0100 |
parents | 95d699c769fb |
children | 05a54b4d579d |
comparison
equal
deleted
inserted
replaced
4377:512a3af69e18 | 4378:8eb1d6dc96a9 |
---|---|
7 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 7 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
8 import de.intevation.artifactdatabase.state.Facet; | 8 import de.intevation.artifactdatabase.state.Facet; |
9 import de.intevation.flys.artifacts.model.FacetTypes; | 9 import de.intevation.flys.artifacts.model.FacetTypes; |
10 import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult; | 10 import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult; |
11 import de.intevation.flys.exports.StyledSeriesBuilder; | 11 import de.intevation.flys.exports.StyledSeriesBuilder; |
12 import de.intevation.flys.exports.XYChartGenerator; | 12 import de.intevation.flys.exports.fixings.AbstractFixGenerator; |
13 import de.intevation.flys.jfree.FLYSAnnotation; | 13 import de.intevation.flys.jfree.FLYSAnnotation; |
14 import de.intevation.flys.jfree.StyledXYSeries; | 14 import de.intevation.flys.jfree.StyledXYSeries; |
15 | 15 |
16 | 16 |
17 public class BedDiffHeightYearGenerator | 17 public class BedDiffHeightYearGenerator |
18 extends XYChartGenerator | 18 extends AbstractFixGenerator |
19 implements FacetTypes | 19 implements FacetTypes |
20 { | 20 { |
21 public enum YAXIS { | 21 public enum YAXIS { |
22 D(0); | 22 D(0), dW(1); |
23 | 23 |
24 protected int idx; | 24 protected int idx; |
25 | 25 |
26 private YAXIS(int c) { | 26 private YAXIS(int c) { |
27 idx = c; | 27 idx = c; |
76 if (name.equals(BED_DIFFERENCE_HEIGHT_YEAR)) { | 76 if (name.equals(BED_DIFFERENCE_HEIGHT_YEAR)) { |
77 doBedDifferenceYearOut( | 77 doBedDifferenceYearOut( |
78 (BedDiffYearResult) bundle.getData(context), | 78 (BedDiffYearResult) bundle.getData(context), |
79 bundle, attr, visible); | 79 bundle, attr, visible); |
80 } | 80 } |
81 else if (name.contains(FIX_SECTOR_AVERAGE_LS)) { | |
82 doSectorAverageOut( bundle, attr, visible, YAXIS.dW.idx); | |
83 } | |
84 else if (name.equals(FIX_REFERENCE_EVENTS_LS)) { | |
85 doReferenceEventsOut( bundle, attr, visible, YAXIS.dW.idx); | |
86 } | |
87 else if (name.equals(FIX_ANALYSIS_EVENTS_LS)) { | |
88 doAnalysisEventsOut( bundle, attr, visible, YAXIS.dW.idx); | |
89 } | |
81 else if (name.equals(LONGITUDINAL_ANNOTATION)) { | 90 else if (name.equals(LONGITUDINAL_ANNOTATION)) { |
82 doAnnotations( | 91 doAnnotations( |
83 (FLYSAnnotation) bundle.getData(context), | 92 (FLYSAnnotation) bundle.getData(context), |
84 bundle, | 93 bundle, |
85 attr, | 94 attr, |
97 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); | 106 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |
98 } | 107 } |
99 | 108 |
100 @Override | 109 @Override |
101 protected String getDefaultYAxisLabel(int pos) { | 110 protected String getDefaultYAxisLabel(int pos) { |
102 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); | 111 if (pos == YAXIS.D.idx) { |
112 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); | |
113 } | |
114 else if (pos == YAXIS.dW.idx) { | |
115 return msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT); | |
116 } | |
117 return "default"; | |
103 } | 118 } |
104 | 119 |
105 protected void doBedDifferenceYearOut(BedDiffYearResult data, | 120 protected void doBedDifferenceYearOut(BedDiffYearResult data, |
106 ArtifactAndFacet aandf, Document theme, boolean visible) { | 121 ArtifactAndFacet aandf, Document theme, boolean visible) { |
107 | 122 |