changeset 1341:e26088566e8a

Use images for line type and line size selection. flys-client/trunk@2991 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 17 Oct 2011 15:17:28 +0000
parents 290d5687f202
children 9bf91bce6ca4
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java flys-client/src/main/webapp/images/linestyle-1px.png flys-client/src/main/webapp/images/linestyle-2px.png flys-client/src/main/webapp/images/linestyle-3px.png flys-client/src/main/webapp/images/linestyle-4px.png flys-client/src/main/webapp/images/linestyle-5px.png flys-client/src/main/webapp/images/linestyle-6px.png flys-client/src/main/webapp/images/linestyle-7px.png flys-client/src/main/webapp/images/linestyle-8px.png flys-client/src/main/webapp/images/linestyle-dash-10-5.png flys-client/src/main/webapp/images/linestyle-dash-10.png flys-client/src/main/webapp/images/linestyle-dash-20-10.png flys-client/src/main/webapp/images/linestyle-dash-20-5-15-5.png flys-client/src/main/webapp/images/linestyle-dash-30-10.png
diffstat 15 files changed, 68 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Oct 17 15:00:12 2011 +0000
+++ b/flys-client/ChangeLog	Mon Oct 17 15:17:28 2011 +0000
@@ -1,3 +1,23 @@
+2011-10-17  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
+	  Use images for line type and line size selection.
+
+	* src/main/webapp/images/linestyle-dash-10.png,
+	  src/main/webapp/images/linestyle-dash-10-5.png,
+	  src/main/webapp/images/linestyle-1px.png,
+	  src/main/webapp/images/linestyle-2px.png,
+	  src/main/webapp/images/linestyle-3px.png,
+	  src/main/webapp/images/linestyle-4px.png,
+	  src/main/webapp/images/linestyle-5px.png,
+	  src/main/webapp/images/linestyle-dash-20-10.png,
+	  src/main/webapp/images/linestyle-6px.png,
+	  src/main/webapp/images/linestyle-dash-30-10.png,
+	  src/main/webapp/images/linestyle-7px.png,
+	  src/main/webapp/images/linestyle-8px.png,
+	  src/main/webapp/images/linestyle-dash-20-5-15-5.png:
+	  New.
+
 2011-10-17  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue253 (Diagramm: Mehrfachauswahl zum Verschieben/Löschen auf Themen)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Oct 17 15:00:12 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Oct 17 15:17:28 2011 +0000
@@ -1,5 +1,7 @@
 package de.intevation.flys.client.client.ui;
 
+import java.util.LinkedHashMap;
+
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
@@ -12,7 +14,7 @@
 import com.smartgwt.client.widgets.form.fields.CheckboxItem;
 import com.smartgwt.client.widgets.form.fields.SpinnerItem;
 import com.smartgwt.client.widgets.form.fields.ColorPickerItem;
-import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
 import com.smartgwt.client.widgets.form.fields.StaticTextItem;
 
 import com.smartgwt.client.widgets.events.ClickEvent;
@@ -162,11 +164,32 @@
 
         FormItem f;
         if(type.equals("int")) {
-            SpinnerItem s = new SpinnerItem(name, dname);
-            s.setMin(1);
-            s.setMax(10);
-            s.setValue(value);
-            f = s;
+            f = new SelectItem(name, dname);
+            LinkedHashMap<String, String> valueIcons = new LinkedHashMap<String, String>();
+            f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-");
+            f.setImageURLSuffix("px.png");
+            f.setValueIconHeight(20);
+            f.setValueIconWidth(80);
+            LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();  
+            valueMap.put("1", "");
+            valueMap.put("2", "");
+            valueMap.put("3", "");
+            valueMap.put("4", "");
+            valueMap.put("5", "");
+            valueMap.put("6", "");
+            valueMap.put("7", "");
+            valueMap.put("8", "");
+            valueIcons.put("1", "1");
+            valueIcons.put("2", "2");
+            valueIcons.put("3", "3");
+            valueIcons.put("4", "4");
+            valueIcons.put("5", "5");
+            valueIcons.put("6", "6");
+            valueIcons.put("7", "7");
+            valueIcons.put("8", "8");
+            f.setValueIcons(valueIcons);
+            f.setValueMap(valueMap);
+            f.setValue(value);
         }
         else if (type.equals("boolean")) {
             CheckboxItem c = new CheckboxItem(name, dname);
@@ -185,8 +208,25 @@
             f = c;
         }
         else if (type.equals("Dash")) {
-            f = new ComboBoxItem(name, dname);
-            f.setValueMap("10", "10,5", "20,10", "30,10", "20,5,15,5");
+            f = new SelectItem(name, dname);
+            LinkedHashMap<String, String> valueIcons = new LinkedHashMap<String, String>();
+            f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-dash-");
+            f.setImageURLSuffix(".png");
+            f.setValueIconHeight(20);
+            f.setValueIconWidth(80);
+            LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();  
+            valueMap.put("10", "");
+            valueMap.put("10,5", "");
+            valueMap.put("20,10", "");
+            valueMap.put("30,10", "");
+            valueMap.put("20,5,15,5", "");
+            valueIcons.put("10", "10");
+            valueIcons.put("10,5", "10-5");
+            valueIcons.put("20,10", "20-10");
+            valueIcons.put("30,10", "30-10");
+            valueIcons.put("20,5,15,5", "20-5-15-5");
+            f.setValueIcons(valueIcons);
+            f.setValueMap(valueMap);
             f.setValue(value);
         }
         else {
Binary file flys-client/src/main/webapp/images/linestyle-1px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-2px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-3px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-4px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-5px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-6px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-7px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-8px.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-dash-10-5.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-dash-10.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-dash-20-10.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-dash-20-5-15-5.png has changed
Binary file flys-client/src/main/webapp/images/linestyle-dash-30-10.png has changed

http://dive4elements.wald.intevation.org