changeset 1505:4967508928a2

Fixed initial values of boolean properties. flys-client/trunk@3635 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 09 Jan 2012 17:37:41 +0000
parents 02a9104c0451
children 339f8aa641b5
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java
diffstat 2 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Jan 09 17:29:56 2012 +0000
+++ b/flys-client/ChangeLog	Mon Jan 09 17:37:41 2012 +0000
@@ -1,3 +1,8 @@
+2012-01-09  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java:
+	  Fixed initial values of boolean properties.
+
 2012-01-09  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Implemented the validators more object oriented.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java	Mon Jan 09 17:29:56 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java	Mon Jan 09 17:37:41 2012 +0000
@@ -213,9 +213,15 @@
             BooleanProperty fixation =
                 (BooleanProperty)pg.getPropertyByName("fixation");
             FormItem fix = createBooleanProperty(fixation);
-            fix.setValue(
+            String fixValue =
                 ((BooleanProperty)
-                    origPg.getPropertyByName("fixation")).getValue());
+                    origPg.getPropertyByName("fixation")).getValue();
+            if(fixValue.equals("true")) {
+                fix.setValue(true);
+            }
+            else {
+                fix.setValue(false);
+            }
             fix.addChangedHandler(new ChangedHandler() {
                 public void onChanged(ChangedEvent e) {
                     if ((Boolean)e.getValue()) {
@@ -269,7 +275,13 @@
         FormItem item = new FormItem();
         if (setting instanceof BooleanProperty) {
             item = createBooleanProperty((BooleanProperty)setting);
-            item.setValue(((BooleanProperty)orig).getValue());
+            String iValue = ((BooleanProperty)orig).getValue();
+            if(iValue.equals("true")) {
+                item.setValue(true);
+            }
+            else {
+                item.setValue(false);
+            }
         }
         else if (setting instanceof DoubleProperty) {
             item = createDoubleProperty((DoubleProperty)setting);
@@ -330,12 +342,6 @@
         item.setLabelAsTitle(true);
         item.setTitleStyle("color:#000;");
         item.setTitleAlign(Alignment.LEFT);
-/*        if(bp.getValue().equals("true")) {
-            item.setValue(true);
-        }
-        else {
-            item.setValue(false);
-        }*/
         item.addChangedHandler(new ChangedHandler() {
             public void onChanged(ChangedEvent e) {
                 String val;

http://dive4elements.wald.intevation.org