diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualWSPEditor.java @ 2927:f978058dc835

Nicen Manual WSP editor. flys-client/trunk@4825 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 28 Jun 2012 14:50:05 +0000
parents 6461b8dbe093
children f0c7c52203c0
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualWSPEditor.java	Thu Jun 28 14:34:54 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualWSPEditor.java	Thu Jun 28 14:50:05 2012 +0000
@@ -137,7 +137,7 @@
      * Initialize the editor window and its components.
      */
     protected void init() {
-        setTitle(MSG.addpoints());
+        setTitle(MSG.addWSP());
         setCanDragReposition(true);
         setCanDragResize(true);
 
@@ -170,18 +170,6 @@
         buttons.setAlign(Alignment.CENTER);
         buttons.setHeight(30);
 
-        DynamicForm form = new DynamicForm();
-        valueInputPanel = new TextItem();
-        valueInputPanel.setTitle("wsp");
-        valueInputPanel.setShowTitle(false);
-        nameInputPanel = new TextItem();
-        nameInputPanel.setTitle("name");
-        nameInputPanel.setShowTitle(false);
-        form.setFields(valueInputPanel, nameInputPanel);
-
-        VLayout layout = new VLayout();
-        layout.addMember(form);
-
         // Use X and Y as default fallback.
         String yAxis = "Y";
 
@@ -193,7 +181,7 @@
                 PropertyGroup pg = (PropertyGroup)p;
                 StringProperty id =
                     (StringProperty)pg.getPropertyByName("id");
-                if (yAxis.equals("Y")) {
+                if (id.getValue().equals("W")) {
                     StringProperty name =
                         (StringProperty)pg.getPropertyByName("label");
                     yAxis = name.getValue();
@@ -201,6 +189,17 @@
             }
         }
 
+        DynamicForm form = new DynamicForm();
+        valueInputPanel = new TextItem();
+        valueInputPanel.setTitle(yAxis);
+        valueInputPanel.setShowTitle(true);
+        nameInputPanel = new TextItem();
+        nameInputPanel.setTitle(MSG.pointname());
+        nameInputPanel.setShowTitle(true);
+        form.setFields(valueInputPanel, nameInputPanel);
+
+        VLayout layout = new VLayout();
+        layout.addMember(form);
 
         // Find the artifacts uuid.
         // TODO this has been called already, why call it again?
@@ -219,8 +218,8 @@
         addItem(layout);
 
         addItem(buttons);
-        setWidth(380);
-        setHeight(470);
+        setWidth(360);
+        setHeight(120);
         centerInPage();
     }
 

http://dive4elements.wald.intevation.org