comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java @ 2408:8e2ae8813a06

'Bezugslinien': normalized reference curve is now derived from reference curve. flys-artifacts/trunk@4037 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 10 Feb 2012 16:25:27 +0000
parents dce0cc856357
children 664f97b6d48f
comparison
equal deleted inserted replaced
2407:dce0cc856357 2408:8e2ae8813a06
122 @Override 122 @Override
123 protected String getDefaultYAxisLabel(int index) { 123 protected String getDefaultYAxisLabel(int index) {
124 return msg(getInCm(1) ? I18N_Y_AXIS_IN_CM : I18N_Y_AXIS_IN_M); 124 return msg(getInCm(1) ? I18N_Y_AXIS_IN_CM : I18N_Y_AXIS_IN_M);
125 } 125 }
126 126
127 protected String facetName() {
128 return REFERENCE_CURVE;
129 }
130
127 131
128 /** 132 /**
129 * Called for each facet/them in the out mapped to this generator. 133 * Called for each facet/them in the out mapped to this generator.
130 * @param artifactFacet artifact and facet for this theme. 134 * @param artifactFacet artifact and facet for this theme.
131 * @param theme styling info. 135 * @param theme styling info.
144 if (name == null || name.length() == 0) { 148 if (name == null || name.length() == 0) {
145 logger.error("No facet given. Cannot create dataset."); 149 logger.error("No facet given. Cannot create dataset.");
146 return; 150 return;
147 } 151 }
148 152
149 if (name.equals(REFERENCE_CURVE)) { 153 if (name.equals(facetName())) {
150 doReferenceOut(artifactFacet.getData(context), theme, visible); 154 doReferenceOut(artifactFacet.getData(context), theme, visible);
151 } 155 }
152 else if (FacetTypes.IS.MANUALPOINTS(name)) { 156 else if (FacetTypes.IS.MANUALPOINTS(name)) {
153 doPoints( 157 doPoints(
154 artifactFacet.getData(context), 158 artifactFacet.getData(context),
160 else { 164 else {
161 logger.warn("Unknown facet name: " + name); 165 logger.warn("Unknown facet name: " + name);
162 } 166 }
163 } 167 }
164 168
169 protected boolean doNormalize() {
170 return false;
171 }
172
165 173
166 /** Register DataSeries with (maybe transformed) points. */ 174 /** Register DataSeries with (maybe transformed) points. */
167 public void doReferenceOut( 175 public void doReferenceOut(
168 Object data, 176 Object data,
169 Document theme, 177 Document theme,
175 183
176 WWAxisTypes wwat = obj instanceof WWAxisTypes 184 WWAxisTypes wwat = obj instanceof WWAxisTypes
177 ? (WWAxisTypes)obj 185 ? (WWAxisTypes)obj
178 : new WWAxisTypes(ww); 186 : new WWAxisTypes(ww);
179 187
180 ApplyFunctionIterator iter = wwat.transform(ww); 188 ApplyFunctionIterator iter = wwat.transform(ww, doNormalize());
181 189
182 XYSeries series = new StyledXYSeries( 190 XYSeries series = new StyledXYSeries(
183 ww.getName(), false, theme); 191 ww.getName(), false, theme);
184 192
185 double [] values = new double[2]; 193 double [] values = new double[2];

http://dive4elements.wald.intevation.org