comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java @ 1712:7e19449d7826

#253 Modified the title creation of chart curves - titles will now equal the Facet's description. flys-artifacts/trunk@2984 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 17 Oct 2011 10:47:36 +0000
parents bdb05dc9b763
children 4cc21f0a470e
comparison
equal deleted inserted replaced
1711:f708120cb7bc 1712:7e19449d7826
54 54
55 FLYSArtifact flys = (FLYSArtifact) artifact; 55 FLYSArtifact flys = (FLYSArtifact) artifact;
56 Facet f = flys.getNativeFacet(facet); 56 Facet f = flys.getNativeFacet(facet);
57 57
58 if (name.equals(DISCHARGE_LONGITUDINAL_W)) { 58 if (name.equals(DISCHARGE_LONGITUDINAL_W)) {
59 doWOut((WQKms) f.getData(artifact, context), attr, visible); 59 doWOut((WQKms) f.getData(artifact, context), facet, attr, visible);
60 } 60 }
61 else if (name.equals(DISCHARGE_LONGITUDINAL_Q)) { 61 else if (name.equals(DISCHARGE_LONGITUDINAL_Q)) {
62 doQOut((WQKms) f.getData(artifact, context), attr, visible); 62 doQOut((WQKms) f.getData(artifact, context), facet, attr, visible);
63 } 63 }
64 else if (name.equals(DISCHARGE_LONGITUDINAL_C)) { 64 else if (name.equals(DISCHARGE_LONGITUDINAL_C)) {
65 doCorrectedWOut( 65 doCorrectedWOut(
66 (WQCKms) f.getData(artifact, context), 66 (WQCKms) f.getData(artifact, context),
67 facet,
67 attr, 68 attr,
68 visible); 69 visible);
69 } 70 }
70 else { 71 else {
71 logger.warn("Unknown facet name: " + name); 72 logger.warn("Unknown facet name: " + name);
79 * @param wqckms The object that contains the corrected W values. 80 * @param wqckms The object that contains the corrected W values.
80 * @param theme The theme that contains styling information. 81 * @param theme The theme that contains styling information.
81 */ 82 */
82 protected void doCorrectedWOut( 83 protected void doCorrectedWOut(
83 WQCKms wqckms, 84 WQCKms wqckms,
85 Facet facet,
84 Document theme, 86 Document theme,
85 boolean visible 87 boolean visible
86 ) { 88 ) {
87 logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut"); 89 logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut");
88 90
89 int size = wqckms.size(); 91 int size = wqckms.size();
90 92
91 if (size > 0) { 93 if (size > 0) {
92 XYSeries series = new StyledXYSeries( 94 XYSeries series = new StyledXYSeries(
93 getSeriesNameForCorrected(wqckms, "W"), 95 facet.getDescription(),
94 theme); 96 theme);
95 97
96 for (int i = 0; i < size; i++) { 98 for (int i = 0; i < size; i++) {
97 series.add(wqckms.getKm(i), wqckms.getC(i)); 99 series.add(wqckms.getKm(i), wqckms.getC(i));
98 } 100 }
102 104
103 if (wqckms.guessWaterIncreasing()) { 105 if (wqckms.guessWaterIncreasing()) {
104 setInverted(true); 106 setInverted(true);
105 } 107 }
106 } 108 }
107
108
109 protected String getSeriesNameForCorrected(WQKms wqkms, String mode) {
110 String name = wqkms.getName();
111
112 name = name.replace(
113 "benutzerdefiniert",
114 "benutzerdefiniert [korrigiert]");
115
116 String prefix = name.indexOf(mode) >= 0 ? null : mode;
117
118 return prefix != null && prefix.length() > 0
119 ? prefix + "(" + name + ")"
120 : name;
121 }
122 } 109 }
123 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 110 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org