comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java @ 1684:bdb05dc9b763

Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained. flys-artifacts/trunk@2902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 07 Oct 2011 10:51:09 +0000
parents 0cb1a70b8b92
children 7e19449d7826
comparison
equal deleted inserted replaced
1683:acb4d20b130e 1684:bdb05dc9b763
32 super(); 32 super();
33 } 33 }
34 34
35 35
36 @Override 36 @Override
37 public void doOut(Artifact artifact, Facet facet, Document attr) { 37 public void doOut(
38 Artifact artifact,
39 Facet facet,
40 Document attr,
41 boolean visible
42 ) {
38 logger.debug("DischargeLongitudinalSectionGenerator.doOut"); 43 logger.debug("DischargeLongitudinalSectionGenerator.doOut");
39 44
40 if (facet == null) { 45 if (facet == null) {
41 return; 46 return;
42 } 47 }
49 54
50 FLYSArtifact flys = (FLYSArtifact) artifact; 55 FLYSArtifact flys = (FLYSArtifact) artifact;
51 Facet f = flys.getNativeFacet(facet); 56 Facet f = flys.getNativeFacet(facet);
52 57
53 if (name.equals(DISCHARGE_LONGITUDINAL_W)) { 58 if (name.equals(DISCHARGE_LONGITUDINAL_W)) {
54 doWOut((WQKms) f.getData(artifact, context), attr); 59 doWOut((WQKms) f.getData(artifact, context), attr, visible);
55 } 60 }
56 else if (name.equals(DISCHARGE_LONGITUDINAL_Q)) { 61 else if (name.equals(DISCHARGE_LONGITUDINAL_Q)) {
57 doQOut((WQKms) f.getData(artifact, context), attr); 62 doQOut((WQKms) f.getData(artifact, context), attr, visible);
58 } 63 }
59 else if (name.equals(DISCHARGE_LONGITUDINAL_C)) { 64 else if (name.equals(DISCHARGE_LONGITUDINAL_C)) {
60 doCorrectedWOut((WQCKms) f.getData(artifact, context), attr); 65 doCorrectedWOut(
66 (WQCKms) f.getData(artifact, context),
67 attr,
68 visible);
61 } 69 }
62 else { 70 else {
63 logger.warn("Unknown facet name: " + name); 71 logger.warn("Unknown facet name: " + name);
64 } 72 }
65 } 73 }
69 * Adds a new series for the corrected W curve. 77 * Adds a new series for the corrected W curve.
70 * 78 *
71 * @param wqckms The object that contains the corrected W values. 79 * @param wqckms The object that contains the corrected W values.
72 * @param theme The theme that contains styling information. 80 * @param theme The theme that contains styling information.
73 */ 81 */
74 protected void doCorrectedWOut(WQCKms wqckms, Document theme) { 82 protected void doCorrectedWOut(
83 WQCKms wqckms,
84 Document theme,
85 boolean visible
86 ) {
75 logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut"); 87 logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut");
76 88
77 int size = wqckms.size(); 89 int size = wqckms.size();
78 90
79 if (size > 0) { 91 if (size > 0) {
83 95
84 for (int i = 0; i < size; i++) { 96 for (int i = 0; i < size; i++) {
85 series.add(wqckms.getKm(i), wqckms.getC(i)); 97 series.add(wqckms.getKm(i), wqckms.getC(i));
86 } 98 }
87 99
88 addFirstAxisSeries(series); 100 addFirstAxisSeries(series, visible);
89 } 101 }
90 102
91 if (wqckms.guessWaterIncreasing()) { 103 if (wqckms.guessWaterIncreasing()) {
92 setInverted(true); 104 setInverted(true);
93 } 105 }

http://dive4elements.wald.intevation.org