Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 3617:05deafdcbf39
sloppy logo placement property implementation.
flys-artifacts/trunk@5284 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 28 Aug 2012 15:53:05 +0000 |
parents | d4751be54745 |
children | b7867c03760a |
comparison
equal
deleted
inserted
replaced
3616:d4751be54745 | 3617:05deafdcbf39 |
---|---|
267 } | 267 } |
268 else { | 268 else { |
269 imageIcon = new ImageIcon("/home/felix/Downloads/bfg_logo.gif"); | 269 imageIcon = new ImageIcon("/home/felix/Downloads/bfg_logo.gif"); |
270 } | 270 } |
271 | 271 |
272 double xPos = 0d, yPos = 0d; | |
273 | |
272 // TODO placement should be decided by from other properties. | 274 // TODO placement should be decided by from other properties. |
275 String place = logoPlace(); | |
276 if (place == null || place.equals("none")) { | |
277 place = "top"; | |
278 } | |
279 if (place.equals("top")) { | |
280 xPos = ((Double)getXBounds(0).getUpper() - (Double)getXBounds(0).getLower())/2d; | |
281 yPos = (Double)getYBounds(0).getUpper(); | |
282 } | |
283 else if (place.equals("bottom")) { | |
284 xPos = ((Double)getXBounds(0).getUpper() - (Double)getXBounds(0).getLower())/2d; | |
285 yPos = (Double)getYBounds(0).getLower(); | |
286 } | |
287 else if (place.equals("left")) { | |
288 xPos = (Double)getXBounds(0).getLower(); | |
289 yPos = ((Double)getYBounds(0).getLower() - (Double)getYBounds(0).getLower())/2d; | |
290 } | |
291 else if (place.equals("right")) { | |
292 xPos = (Double)getXBounds(0).getUpper(); | |
293 yPos = ((Double)getYBounds(0).getLower() - (Double)getYBounds(0).getLower())/2d; | |
294 } | |
295 logger.debug("logo position: " + xPos + "/" + yPos); | |
296 | |
273 XYAnnotation xyannotation = | 297 XYAnnotation xyannotation = |
274 new XYImageAnnotation(10, 10, imageIcon.getImage()); | 298 new XYImageAnnotation(xPos, yPos, imageIcon.getImage()); |
275 plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); | 299 plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); |
276 } | 300 } |
277 | 301 |
278 | 302 |
279 protected NumberAxis createXAxis(String label) { | 303 protected NumberAxis createXAxis(String label) { |