changeset 1355:b9b4d27bcf63

Display selected WQ values in single rows - named main values need a lot of space. flys-client/trunk@3036 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 19 Oct 2011 15:35:27 +0000
parents 5327ca0f13d1
children db1bf06012db
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java
diffstat 2 files changed, 63 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Oct 19 14:39:21 2011 +0000
+++ b/flys-client/ChangeLog	Wed Oct 19 15:35:27 2011 +0000
@@ -1,3 +1,9 @@
+2011-10-19  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java:
+	  Modified the visual result of createOld() which will now display each W
+	  or Q in a single row.
+
 2011-10-19  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Wed Oct 19 14:39:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Wed Oct 19 15:35:27 2011 +0000
@@ -274,7 +274,7 @@
         Label label  = new Label(dataList.getLabel());
         label.setWidth("200px");
 
-        String text = null;
+        VLayout vLabel = null;
 
         DataItem[] selItem = dSelection.getItems();
         String     sel     = selItem != null
@@ -284,7 +284,7 @@
         if (sel.equals("single")) {
             DataItem[] single = dSingle.getItems();
 
-            text = wMode
+            vLabel = wMode
                 ? createWString(single[0])
                 : createQString(single[0]);
         }
@@ -293,7 +293,7 @@
             DataItem[] to   = dTo.getItems();
             DataItem[] step = dStep.getItems();
 
-            text = wMode
+            vLabel = wMode
                 ? createWString(from[0], to[0], step[0])
                 : createQString(from[0], to[0], step[0]);
         }
@@ -309,11 +309,8 @@
         }
 
         Label mLabel = new Label(wqMode);
-        Label vLabel = new Label(text);
         mLabel.setWidth(175);
         mLabel.setHeight(20);
-        vLabel.setWidth(175);
-        vLabel.setHeight(20);
 
         selectedLayout.addMember(mLabel);
         selectedLayout.addMember(vLabel);
@@ -508,7 +505,9 @@
     }
 
 
-    protected String createWString(DataItem from, DataItem to, DataItem step) {
+    protected VLayout createWString(DataItem from, DataItem to, DataItem step) {
+        VLayout v = new VLayout();
+
         StringBuilder sb = new StringBuilder();
         sb.append(from.getLabel());
         sb.append(" " + MESSAGE.unitWFrom() + " ");
@@ -517,16 +516,39 @@
         sb.append(step.getLabel());
         sb.append(" " + MESSAGE.unitWStep());
 
-        return sb.toString();
+        v.addMember(new Label(sb.toString()));
+
+        return v;
     }
 
 
-    protected String createWString(DataItem single) {
-        return single.getLabel().replace(" ", " " + MESSAGE.unitWSingle() + " ");
+    protected VLayout createWString(DataItem single) {
+        String  label = single.getLabel();
+        String[] cols = null;
+
+        if (label.indexOf(",") > 0) {
+            cols = label.split(",");
+        }
+        else {
+            cols = label.split(" ");
+        }
+
+        VLayout v = new VLayout();
+
+        for (String col: cols) {
+            Label l = new Label(col + " " + MESSAGE.unitWSingle());
+            l.setHeight(20);
+
+            v.addMember(l);
+        }
+
+        return v;
     }
 
 
-    protected String createQString(DataItem from, DataItem to, DataItem step) {
+    protected VLayout createQString(DataItem from, DataItem to, DataItem step) {
+        VLayout v = new VLayout();
+
         StringBuilder sb = new StringBuilder();
         sb.append(from.getLabel());
         sb.append(" " + MESSAGE.unitQFrom() + " ");
@@ -535,12 +557,33 @@
         sb.append(step.getLabel());
         sb.append(" " + MESSAGE.unitQStep());
 
-        return sb.toString();
+        v.addMember(new Label(sb.toString()));
+
+        return v;
     }
 
 
-    protected String createQString(DataItem single) {
-        return single.getLabel().replace(" ", " " + MESSAGE.unitQSingle() + " ");
+    protected VLayout createQString(DataItem single) {
+        String  label = single.getLabel();
+        String[] cols = null;
+
+        if (label.indexOf(",") > 0) {
+            cols = label.split(",");
+        }
+        else {
+            cols = label.split(" ");
+        }
+
+        VLayout v = new VLayout();
+
+        for (String col: cols) {
+            Label l = new Label(col + " " + MESSAGE.unitQSingle());
+            l.setHeight(20);
+
+            v.addMember(l);
+        }
+
+        return v;
     }
 
 

http://dive4elements.wald.intevation.org