changeset 3536:a1610c7e4a4e

Show logos in select box. flys-client/trunk@5345 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 03 Sep 2012 10:08:37 +0000
parents 75a3a41a6e51
children 45f2b0778a3a
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java flys-client/src/main/webapp/images/logo-bfg.gif flys-client/src/main/webapp/images/logo-intevation.png
diffstat 4 files changed, 31 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Sat Sep 01 09:06:29 2012 +0000
+++ b/flys-client/ChangeLog	Mon Sep 03 10:08:37 2012 +0000
@@ -1,3 +1,15 @@
+2012-09-03	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Show logos in selectbox in chart properties such that user gets a
+	visual idea of what she selects.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java:
+	  Show icons in select box that displays the chosen logo.
+
+	* src/main/webapp/images/logo-intevation.png,
+	  src/main/webapp/images/logo-bfg.gif:
+	  Two exemplary logos (copies in flys-artifacts).
+
 2012-09-01	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/ModuleServiceImpl.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java	Sat Sep 01 09:06:29 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java	Mon Sep 03 10:08:37 2012 +0000
@@ -316,10 +316,28 @@
 
         if (choiceAttribute != null && choiceAttribute.equals("logo")) {
             SelectItem logoChooser = new SelectItem();
+            logoChooser.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/logo-");
+            logoChooser.setValueIconHeight(50);
+            logoChooser.setValueIconWidth(100);
+
             LinkedHashMap valueMap = new LinkedHashMap<String, String>();
+            LinkedHashMap<String, String> valueIcons = new LinkedHashMap<String, String>();
             valueMap.put("none", MSG.getString("none"));
-            valueMap.put("BfG", "Bfg");
+            /*
+             If you want to add images, remember to change code in these places:
+             flys-artifacts:
+             XYChartGenerator.java
+             Timeseries*Generator.java and
+             in the flys-client projects Chart*Propert*Editor.java.
+             Also, these images have to be put in
+             flys-artifacts/src/main/resources/images/
+             flys-client/src/main/webapp/images/
+             */
+            valueMap.put("BfG", "BfG");
             valueMap.put("Intevation", "Intevation");
+            valueIcons.put("BfG", "bfg.gif");
+            valueIcons.put("Intevation", "intevation.png");
+            logoChooser.setValueIcons(valueIcons);
             logoChooser.setValueMap(valueMap);
             logoChooser.setTitleStyle("color:#000;");
             logoChooser.setTitleAlign(Alignment.LEFT);
Binary file flys-client/src/main/webapp/images/logo-bfg.gif has changed
Binary file flys-client/src/main/webapp/images/logo-intevation.png has changed

http://dive4elements.wald.intevation.org