Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java @ 3280:4a70525c5b0d
Removed trailing whitespace.
flys-artifacts/trunk@4933 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 11 Jul 2012 11:25:42 +0000 |
parents | c27c4e06dd87 |
children | 97ad960f5579 |
comparison
equal
deleted
inserted
replaced
3279:5a7b4f890d53 | 3280:4a70525c5b0d |
---|---|
156 // Default. | 156 // Default. |
157 logger.debug("Unknown zone type found."); | 157 logger.debug("Unknown zone type found."); |
158 return new Color(255, 0, 0); | 158 return new Color(255, 0, 0); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 @Override | 162 @Override |
163 protected void addAnnotationsToRenderer(XYPlot plot) { | 163 protected void addAnnotationsToRenderer(XYPlot plot) { |
164 super.addAnnotationsToRenderer(plot); | 164 super.addAnnotationsToRenderer(plot); |
165 | 165 |
166 // Paints for the boxes/lines. | 166 // Paints for the boxes/lines. |
167 Stroke basicStroke = new BasicStroke(1.0f); | 167 Stroke basicStroke = new BasicStroke(1.0f); |
168 | 168 |
169 Paint linePaint = new Color(255, 0,0,60); | 169 Paint linePaint = new Color(255, 0,0,60); |
170 Paint fillPaint = new Color(0, 255,0,60); | 170 Paint fillPaint = new Color(0, 255,0,60); |
172 | 172 |
173 // OPTMIMIZE: Pre-calculate positions | 173 // OPTMIMIZE: Pre-calculate positions |
174 ChartArea area = new ChartArea( | 174 ChartArea area = new ChartArea( |
175 plot.getDomainAxis(0).getRange(), | 175 plot.getDomainAxis(0).getRange(), |
176 plot.getRangeAxis().getRange()); | 176 plot.getRangeAxis().getRange()); |
177 | 177 |
178 for(FLYSAnnotation fa : this.annotations) { | 178 for(FLYSAnnotation fa : this.annotations) { |
179 | 179 |
180 // Access text styling, if any. | 180 // Access text styling, if any. |
181 Document theme = fa.getTheme(); | 181 Document theme = fa.getTheme(); |
182 ThemeAccess.TextStyle textStyle = null; | 182 ThemeAccess.TextStyle textStyle = null; |
183 ThemeAccess.LineStyle lineStyle = null; | 183 ThemeAccess.LineStyle lineStyle = null; |
184 | 184 |
185 // Get Themeing information and add legend item. | 185 // Get Themeing information and add legend item. |
186 if (theme != null) { | 186 if (theme != null) { |
187 ThemeAccess themeAccess = new ThemeAccess(theme); | 187 ThemeAccess themeAccess = new ThemeAccess(theme); |
188 textStyle = themeAccess.parseTextStyle(); | 188 textStyle = themeAccess.parseTextStyle(); |
189 lineStyle = themeAccess.parseLineStyle(); | 189 lineStyle = themeAccess.parseLineStyle(); |
199 old = lic; | 199 old = lic; |
200 } | 200 } |
201 plot.setFixedLegendItems(old); | 201 plot.setFixedLegendItems(old); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 // Hyks. | 205 // Hyks. |
206 for (HYKFactory.Zone zone: fa.getBoxes()) { | 206 for (HYKFactory.Zone zone: fa.getBoxes()) { |
207 // For each zone, create a box to fill with color, a box to draw | 207 // For each zone, create a box to fill with color, a box to draw |
208 // the lines and a text to display the type. | 208 // the lines and a text to display the type. |
209 fillPaint = colorForHYKZone(zone.getName()); | 209 fillPaint = colorForHYKZone(zone.getName()); |
210 | 210 |
211 XYBoxAnnotation boxA = new XYBoxAnnotation(zone.getFrom(), area.atGround(), | 211 XYBoxAnnotation boxA = new XYBoxAnnotation(zone.getFrom(), area.atGround(), |
212 zone.getTo(), area.ofGround(0.03f), basicStroke, tranPaint, fillPaint); | 212 zone.getTo(), area.ofGround(0.03f), basicStroke, tranPaint, fillPaint); |
213 XYBoxAnnotation boxB = new XYBoxAnnotation(zone.getFrom(), area.atGround(), | 213 XYBoxAnnotation boxB = new XYBoxAnnotation(zone.getFrom(), area.atGround(), |
214 zone.getTo(), area.atTop(), basicStroke, fillPaint, tranPaint); | 214 zone.getTo(), area.atTop(), basicStroke, fillPaint, tranPaint); |
215 | 215 |
216 XYTextAnnotation tex = new XYTextAnnotation(zone.getName(), | 216 XYTextAnnotation tex = new XYTextAnnotation(zone.getName(), |
217 zone.getFrom() + (zone.getTo() - zone.getFrom()) / 1.0d, | 217 zone.getFrom() + (zone.getTo() - zone.getFrom()) / 1.0d, |
218 area.ofGround(0.015f)); | 218 area.ofGround(0.015f)); |
219 if (textStyle != null) { | 219 if (textStyle != null) { |
220 textStyle.apply(tex); | 220 textStyle.apply(tex); |
221 } | 221 } |
222 | 222 |
223 plot.getRenderer().addAnnotation(boxA, org.jfree.ui.Layer.BACKGROUND); | 223 plot.getRenderer().addAnnotation(boxA, org.jfree.ui.Layer.BACKGROUND); |
224 plot.getRenderer().addAnnotation(boxB, org.jfree.ui.Layer.BACKGROUND); | 224 plot.getRenderer().addAnnotation(boxB, org.jfree.ui.Layer.BACKGROUND); |
225 plot.getRenderer().addAnnotation(tex, org.jfree.ui.Layer.BACKGROUND); | 225 plot.getRenderer().addAnnotation(tex, org.jfree.ui.Layer.BACKGROUND); |
226 } | 226 } |
227 } | 227 } |