comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java @ 450:c8bb38115290

Enabled the discharge longitudinal section to be exported as WST. flys-artifacts/trunk@1944 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 18 May 2011 10:59:38 +0000
parents a0afdda4d4b9
children bc1e4878d7e3
comparison
equal deleted inserted replaced
449:9814d4808410 450:c8bb38115290
134 * @param wqkms The object that contains the W values. 134 * @param wqkms The object that contains the W values.
135 */ 135 */
136 protected void doWOut(WQKms wqkms) { 136 protected void doWOut(WQKms wqkms) {
137 logger.debug("DischargeLongitudinalSectionGenerator.doWOut"); 137 logger.debug("DischargeLongitudinalSectionGenerator.doWOut");
138 138
139 // TODO CREATE CORRECT SERIES NAME 139 XYSeries series = new XYSeries(getSeriesName(wqkms, "W"));
140 XYSeries series = new XYSeries("W");
141 140
142 double[] target = new double[4]; 141 double[] target = new double[4];
143 int size = wqkms.size(); 142 int size = wqkms.size();
144 143
145 for (int i = 0; i < size; i++) { 144 for (int i = 0; i < size; i++) {
158 * @param wqckms The object that contains the corrected W values. 157 * @param wqckms The object that contains the corrected W values.
159 */ 158 */
160 protected void doCorrectedWOut(WQCKms wqckms) { 159 protected void doCorrectedWOut(WQCKms wqckms) {
161 logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut"); 160 logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut");
162 161
163 // TODO CREATE CORRECT SERIES NAME 162 XYSeries series = new XYSeries(getSeriesNameForCorrected(wqckms, "W"));
164 XYSeries series = new XYSeries("Korrigiert");
165 163
166 double[] target = new double[4]; 164 double[] target = new double[4];
167 int size = wqckms.size(); 165 int size = wqckms.size();
168 166
169 for (int i = 0; i < size; i++) { 167 for (int i = 0; i < size; i++) {
174 172
175 if (series.getItemCount() > 0) { 173 if (series.getItemCount() > 0) {
176 cw.addSeries(series); 174 cw.addSeries(series);
177 } 175 }
178 } 176 }
177
178
179 protected String getSeriesNameForCorrected(WQKms wqkms, String mode) {
180 String name = wqkms.getName();
181
182 name = name.replace(
183 "Benutzerdefiniert",
184 "Benutzerdefiniert [korrigiert]");
185
186 String prefix = name != null && name.indexOf(mode) >= 0 ? null : mode;
187
188 return prefix != null && prefix.length() > 0
189 ? prefix + "(" + name +")"
190 : name;
191 }
179 } 192 }
180 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 193 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org