diff flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 3615:f84854eba0b3

Preparations for logo inclusion in charts. flys-artifacts/trunk@5278 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 28 Aug 2012 12:47:11 +0000
parents dd6e25980c91
children 05deafdcbf39
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Tue Aug 28 11:45:23 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Tue Aug 28 12:47:11 2012 +0000
@@ -752,6 +752,8 @@
         chartSection.setTitle(getChartTitle());
         chartSection.setSubtitle(getChartSubtitle());
         chartSection.setDisplayGrid(isGridVisible());
+        // TODO default to: "none"
+        chartSection.setDisplayLogo(showLogo());
         return chartSection;
     }
 
@@ -1028,6 +1030,30 @@
     }
 
 
+    /** Return the logo id from settings. */
+    protected String showLogo(ChartSettings chartSettings) {
+        if (chartSettings != null) {
+            ChartSection cs   = chartSettings.getChartSection();
+            String       logo = cs.getDisplayLogo();
+
+            return logo;
+        }
+        // TODO "none" instead of null?
+        return null;
+    }
+
+
+    /**
+     * This method is used to determine if a logo should be added to the plot.
+     *
+     * @return logo name (null if none).
+     */
+    protected String showLogo() {
+        ChartSettings chartSettings = getChartSettings();
+        return showLogo(chartSettings);
+    }
+
+
     /**
      * This method is used to determine the font size of the chart's legend. If
      * a <i>settings</i> instance is set, this instance determines the font

http://dive4elements.wald.intevation.org