comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 3618:b7867c03760a

Split logo placement property in two (vertical/horizontal). flys-artifacts/trunk@5286 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 29 Aug 2012 07:58:08 +0000
parents 05deafdcbf39
children 1cd6114603d9
comparison
equal deleted inserted replaced
3617:05deafdcbf39 3618:b7867c03760a
259 logger.debug("No logo to show chosen"); 259 logger.debug("No logo to show chosen");
260 return; 260 return;
261 } 261 }
262 262
263 ImageIcon imageIcon = null; 263 ImageIcon imageIcon = null;
264 // TODO: Which logo? 264 if (logo.equals("none")) {
265 return;
266 }
265 if (logo.equals("Intevation")) { 267 if (logo.equals("Intevation")) {
266 imageIcon = new ImageIcon("/home/felix/Downloads/intevation_logo_120.png"); 268 imageIcon = new ImageIcon("/home/felix/Downloads/intevation_logo_120.png");
267 } 269 }
268 else { 270 else { // TODO else if ...
269 imageIcon = new ImageIcon("/home/felix/Downloads/bfg_logo.gif"); 271 imageIcon = new ImageIcon("/home/felix/Downloads/bfg_logo.gif");
270 } 272 }
271 273
272 double xPos = 0d, yPos = 0d; 274 double xPos = 0d, yPos = 0d;
273 275
274 // TODO placement should be decided by from other properties. 276 // TODO placement should be decided by from other properties.
275 String place = logoPlace(); 277 String placeh = logoHPlace();
276 if (place == null || place.equals("none")) { 278 String placev = logoVPlace();
277 place = "top"; 279 if (placev == null || placev.equals("none")) {
278 } 280 placev = "top";
279 if (place.equals("top")) { 281 }
280 xPos = ((Double)getXBounds(0).getUpper() - (Double)getXBounds(0).getLower())/2d; 282 if (placev.equals("top")) {
281 yPos = (Double)getYBounds(0).getUpper(); 283 yPos = (Double)getYBounds(0).getUpper();
282 } 284 }
283 else if (place.equals("bottom")) { 285 else if (placev.equals("bottom")) {
284 xPos = ((Double)getXBounds(0).getUpper() - (Double)getXBounds(0).getLower())/2d;
285 yPos = (Double)getYBounds(0).getLower(); 286 yPos = (Double)getYBounds(0).getLower();
286 } 287 }
287 else if (place.equals("left")) { 288 else if (placev.equals("center")) {
289 yPos = ((Double)getYBounds(0).getUpper() + (Double)getYBounds(0).getLower())/2d;
290 }
291 // TODO else
292
293 if (placeh == null || placeh.equals("none")) {
294 placeh = "center";
295 }
296 if (placeh.equals("left")) {
288 xPos = (Double)getXBounds(0).getLower(); 297 xPos = (Double)getXBounds(0).getLower();
289 yPos = ((Double)getYBounds(0).getLower() - (Double)getYBounds(0).getLower())/2d; 298 }
290 } 299 else if (placeh.equals("right")) {
291 else if (place.equals("right")) {
292 xPos = (Double)getXBounds(0).getUpper(); 300 xPos = (Double)getXBounds(0).getUpper();
293 yPos = ((Double)getYBounds(0).getLower() - (Double)getYBounds(0).getLower())/2d; 301 }
294 } 302 else if (placeh.equals("center")) {
303 xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d;
304 }
305 // TODO else
295 logger.debug("logo position: " + xPos + "/" + yPos); 306 logger.debug("logo position: " + xPos + "/" + yPos);
296 307
297 XYAnnotation xyannotation = 308 XYAnnotation xyannotation =
298 new XYImageAnnotation(xPos, yPos, imageIcon.getImage()); 309 new XYImageAnnotation(xPos, yPos, imageIcon.getImage());
299 plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); 310 plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND);

http://dive4elements.wald.intevation.org