Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/jfree/AnnotationHelper.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | ebf74d92be38 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
158 // Style the text. | 158 // Style the text. |
159 if (textStyle != null) { | 159 if (textStyle != null) { |
160 textStyle.apply(ta); | 160 textStyle.apply(ta); |
161 } | 161 } |
162 ta.setY(area.above(0.05d, ta.getY())); | 162 ta.setY(area.above(0.05d, ta.getY())); |
163 plot.getRenderer().addAnnotation(ta, org.jfree.ui.Layer.FOREGROUND); | 163 plot.getRenderer().addAnnotation( |
164 ta, org.jfree.ui.Layer.FOREGROUND); | |
164 } | 165 } |
165 } | 166 } |
166 } | 167 } |
167 | 168 |
168 /** | 169 /** |
194 renderer = plot.getRenderer(); | 195 renderer = plot.getRenderer(); |
195 } | 196 } |
196 | 197 |
197 if (annotation.atX()) { | 198 if (annotation.atX()) { |
198 textAnnotation = new CollisionFreeXYTextAnnotation( | 199 textAnnotation = new CollisionFreeXYTextAnnotation( |
199 annotation.getText(), annotation.getPos(), area.ofGround(TEXT_OFF)); | 200 annotation.getText(), |
201 annotation.getPos(), | |
202 area.ofGround(TEXT_OFF)); | |
200 // OPTIMIZE externalize the calculation involving PI. | 203 // OPTIMIZE externalize the calculation involving PI. |
201 //textAnnotation.setRotationAngle(270f*Math.PI/180f); | 204 //textAnnotation.setRotationAngle(270f*Math.PI/180f); |
202 lineAnnotation = createGroundStickAnnotation( | 205 lineAnnotation = createGroundStickAnnotation( |
203 area, annotation.getPos(), lineStyle); | 206 area, annotation.getPos(), lineStyle); |
204 textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); | 207 textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); |
228 // New line annotation to hit curve. | 231 // New line annotation to hit curve. |
229 if (theme.parseShowVerticalLine()) { | 232 if (theme.parseShowVerticalLine()) { |
230 XYLineAnnotation hitLineAnnotation = | 233 XYLineAnnotation hitLineAnnotation = |
231 createStickyLineAnnotation( | 234 createStickyLineAnnotation( |
232 StickyAxisAnnotation.SimpleAxis.X_AXIS, | 235 StickyAxisAnnotation.SimpleAxis.X_AXIS, |
233 annotation.getHitPoint(), annotation.getPos(),// annotation.getHitPoint(), | 236 annotation.getHitPoint(), annotation.getPos(), |
237 // annotation.getHitPoint(), | |
234 area2, lineStyle); | 238 area2, lineStyle); |
235 renderer.addAnnotation(hitLineAnnotation, | 239 renderer.addAnnotation(hitLineAnnotation, |
236 org.jfree.ui.Layer.BACKGROUND); | 240 org.jfree.ui.Layer.BACKGROUND); |
237 } | 241 } |
238 if (theme.parseShowHorizontalLine()) { | 242 if (theme.parseShowHorizontalLine()) { |
246 } | 250 } |
247 } | 251 } |
248 } | 252 } |
249 else { // Stick to the left y-axis. | 253 else { // Stick to the left y-axis. |
250 textAnnotation = new CollisionFreeXYTextAnnotation( | 254 textAnnotation = new CollisionFreeXYTextAnnotation( |
251 annotation.getText(), area.ofLeft(TEXT_OFF), annotation.getPos()); | 255 annotation.getText(), |
256 area.ofLeft(TEXT_OFF), | |
257 annotation.getPos()); | |
252 textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); | 258 textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); |
253 textAnnotation.setTextAnchor(TextAnchor.CENTER_LEFT); | 259 textAnnotation.setTextAnchor(TextAnchor.CENTER_LEFT); |
254 lineAnnotation = createLeftStickAnnotation(area, annotation.getPos(), lineStyle); | 260 lineAnnotation = createLeftStickAnnotation( |
261 area, annotation.getPos(), lineStyle); | |
255 if (!Float.isNaN(annotation.getHitPoint()) && theme != null) { | 262 if (!Float.isNaN(annotation.getHitPoint()) && theme != null) { |
256 // New line annotation to hit curve. | 263 // New line annotation to hit curve. |
257 if (theme.parseShowHorizontalLine()) { | 264 if (theme.parseShowHorizontalLine()) { |
258 XYLineAnnotation hitLineAnnotation = | 265 XYLineAnnotation hitLineAnnotation = |
259 createStickyLineAnnotation( | 266 createStickyLineAnnotation( |