changeset 1431:987f95ceb623

Added property fields to the chart properties editor dialog. flys-client/trunk@3385 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 12 Dec 2011 09:02:13 +0000
parents 6bb6d43eeb2d
children 40f4137a2c31
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java
diffstat 6 files changed, 300 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Dec 12 07:23:24 2011 +0000
+++ b/flys-client/ChangeLog	Mon Dec 12 09:02:13 2011 +0000
@@ -1,3 +1,14 @@
+2011-12-12  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java:
+	  Filled the window with property fields.
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
+	  Added i18n strings for property fields.
+
 2011-12-12	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Cosmetics.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Mon Dec 12 07:23:24 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Mon Dec 12 09:02:13 2011 +0000
@@ -90,6 +90,34 @@
 
     String legend();
 
+    String chart_title();
+
+    String chart_subtitle();
+
+    String grid();
+
+    String antialiasing();
+
+    String axis_name();
+
+    String chart_start();
+
+    String chart_end();
+
+    String x_axis();
+
+    String y1_axis();
+
+    String y2_axis();
+
+    String y3_axis();
+
+    String legend_name();
+
+    String show_legend();
+
+    String scale();
+
     String databasket();
 
     String theme_top();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Mon Dec 12 07:23:24 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Mon Dec 12 09:02:13 2011 +0000
@@ -38,6 +38,20 @@
 diagram = Chart
 axes = Axes
 legend = Legend
+chart_title = Title
+chart_subtitle = Subtitle
+grid = Grid
+antialiasing = Antialiasing
+axis_name = Name
+chart_start = start
+chart_end = end
+x_axis = X-Axis
+y1_axis = Y1-Axis
+y2_axis = Y2-Axis
+y3_axis = Y3-Axis
+legend_name = Name
+show_legend = Show
+scale = Scale
 databasket = Databasket
 fix = TODO FIX ANALYSE TODO
 next = Next
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Mon Dec 12 07:23:24 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Mon Dec 12 09:02:13 2011 +0000
@@ -38,6 +38,20 @@
 diagram = Diagramm
 axes = Achsen
 legend = Legende
+chart_title = Titel
+chart_subtitle = Untertitel
+grid = Gitternetz
+antialiasing = Kantenglättung
+axis_name = Name
+chart_start = von
+chart_end = bis
+x_axis = X-Achse
+y1_axis = Y1-Achse
+y2_axis = Y2-Achse
+y3_axis = Y3-Achse
+legend_name = Name
+show_legend = Anzeigen
+scale = Skalierung
 databasket = Datenkorb
 fix = Fixierungsanalyse
 next = Weiter
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Mon Dec 12 07:23:24 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Mon Dec 12 09:02:13 2011 +0000
@@ -38,6 +38,20 @@
 diagram = Chart
 axes = Axes
 legend = Legend
+chart_title = Title
+chart_subtitle = Subtitle
+grid = Grid
+antialiasing = Antialiasing
+axis_name = Name
+chart_start = Start
+chart_end = End
+x_axis = X-Axis
+y1_axis = Y1-Axis
+y2_axis = Y2-Axis
+y3_axis = Y3-Axis
+legend_name = Name
+show_legend = Show
+scale = Scale
 databasket = Databasket
 fix = TODO FIX ANALYSE TODO
 next = Next
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java	Mon Dec 12 07:23:24 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java	Mon Dec 12 09:02:13 2011 +0000
@@ -10,11 +10,12 @@
 import com.smartgwt.client.widgets.layout.VLayout;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.Button;
+import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.form.DynamicForm;
 import com.smartgwt.client.widgets.form.fields.FormItem;
 import com.smartgwt.client.widgets.form.fields.CheckboxItem;
 import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
 
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
@@ -82,10 +83,14 @@
         buttons.setAlign(Alignment.CENTER);
         buttons.setHeight(30);
 
+        initChartPropertiesTab(diagram);
+        initAxesPropertiesTab(axes);
+        initLegendPropertiesTab(legend);
+
         addItem(tabs);
         addItem(buttons);
-        setWidth(300);
-        setHeight(410);
+        setWidth(340);
+        setHeight(470);
         centerInPage();
     }
 
@@ -96,4 +101,215 @@
     public void onClick(ClickEvent event) {
         this.hide();
     }
+
+    /**
+     * Initializes the tab for general chart properties.
+     */
+    protected void initChartPropertiesTab(Tab t) {
+        VLayout properties = new VLayout();
+        DynamicForm form = new DynamicForm();
+
+        TextItem title = new TextItem ();
+        title.setTitle(MSG.chart_title());
+        title.setTitleAlign(Alignment.LEFT);
+
+        TextItem subTitle = new TextItem();
+        subTitle.setTitle(MSG.chart_subtitle());
+        subTitle.setTitleAlign(Alignment.LEFT);
+
+        CheckboxItem grid = new CheckboxItem("grid", MSG.grid());
+        grid.setLabelAsTitle(true);
+        grid.setTitleStyle("color:#000;");
+        grid.setTitleAlign(Alignment.LEFT);
+
+        CheckboxItem antialiasing = new CheckboxItem("antialiasing",
+                                                     MSG.antialiasing());
+        antialiasing.setLabelAsTitle(true);
+        antialiasing.setTitleStyle("color:#000;");
+        antialiasing.setTitleAlign(Alignment.LEFT);
+
+        form.setFields(new FormItem[] {title, subTitle, grid, antialiasing});
+        properties.addMember(form);
+        t.setPane(properties);
+    }
+
+    /**
+     * Initializes the tab for axes properties.
+     */
+    protected void initAxesPropertiesTab(Tab t) {
+        VLayout properties = new VLayout();
+        Label scale = new Label(MSG.scale() + " :");
+        Label scale1 = new Label(MSG.scale() + " :");
+        Label scale2 = new Label(MSG.scale() + " :");
+        Label scale3 = new Label(MSG.scale() + " :");
+        scale.setHeight(25);
+        scale1.setHeight(25);
+        scale2.setHeight(25);
+        scale3.setHeight(25);
+
+        DynamicForm xform1 = new DynamicForm();
+        DynamicForm xform2 = new DynamicForm();
+        xform2.setNumCols(6);
+
+        Label x_axis = new Label (MSG.x_axis());
+        x_axis.setHeight(30);
+        HLayout x_scale = new HLayout();
+        TextItem xname = new TextItem ();
+        xname.setTitle(MSG.axis_name());
+        xname.setTitleAlign(Alignment.LEFT);
+
+        TextItem xrange1 = new TextItem();
+        xrange1.setTitle(MSG.chart_start());
+        xrange1.setTitleAlign(Alignment.LEFT);
+        xrange1.setWidth(50);
+
+        TextItem xrange2 = new TextItem();
+        xrange2.setTitle(MSG.chart_end());
+        xrange2.setTitleAlign(Alignment.LEFT);
+        xrange2.setWidth(50);
+
+        CheckboxItem xfix = new CheckboxItem("xfix", "Fix");
+        xfix.setLabelAsTitle(true);
+        xfix.setTitleStyle("color:#000;");
+        xfix.setTitleAlign(Alignment.LEFT);
+
+        xform1.setFields(xname);
+        xform2.setFields(xrange1, xrange2, xfix);
+        x_scale.addMember(scale);
+        x_scale.addMember(xform2);
+
+
+        DynamicForm y1form1 = new DynamicForm();
+        DynamicForm y1form2 = new DynamicForm();
+        y1form2.setNumCols(6);
+
+        Label y1_axis = new Label (MSG.y1_axis());
+        y1_axis.setHeight(30);
+        HLayout y1_scale = new HLayout();
+        TextItem y1name = new TextItem ();
+        y1name.setTitle(MSG.axis_name());
+        y1name.setTitleAlign(Alignment.LEFT);
+
+        TextItem y1range1 = new TextItem();
+        y1range1.setTitle(MSG.chart_start());
+        y1range1.setTitleAlign(Alignment.LEFT);
+        y1range1.setWidth(50);
+
+        TextItem y1range2 = new TextItem();
+        y1range2.setTitle(MSG.chart_end());
+        y1range2.setTitleAlign(Alignment.LEFT);
+        y1range2.setWidth(50);
+
+        CheckboxItem y1fix = new CheckboxItem("y1fix", "Fix");
+        y1fix.setLabelAsTitle(true);
+        y1fix.setTitleStyle("color:#000;");
+        y1fix.setTitleAlign(Alignment.LEFT);
+
+        y1form1.setFields(y1name);
+        y1form2.setFields(y1range1, y1range2, y1fix);
+        y1_scale.addMember(scale1);
+        y1_scale.addMember(y1form2);
+
+
+        DynamicForm y2form1 = new DynamicForm();
+        DynamicForm y2form2 = new DynamicForm();
+        y2form2.setNumCols(6);
+
+        Label y2_axis = new Label (MSG.y2_axis());
+        y2_axis.setHeight(30);
+        HLayout y2_scale = new HLayout();
+        TextItem y2name = new TextItem ();
+        y2name.setTitle(MSG.axis_name());
+        y2name.setTitleAlign(Alignment.LEFT);
+
+        TextItem y2range1 = new TextItem();
+        y2range1.setTitle(MSG.chart_start());
+        y2range1.setTitleAlign(Alignment.LEFT);
+        y2range1.setWidth(50);
+
+        TextItem y2range2 = new TextItem();
+        y2range2.setTitle(MSG.chart_end());
+        y2range2.setTitleAlign(Alignment.LEFT);
+        y2range2.setWidth(50);
+
+        CheckboxItem y2fix = new CheckboxItem("y2fix", "Fix");
+        y2fix.setLabelAsTitle(true);
+        y2fix.setTitleStyle("color:#000;");
+        y2fix.setTitleAlign(Alignment.LEFT);
+
+        y2form1.setFields(y2name);
+        y2form2.setFields(y2range1, y2range2, y2fix);
+        y2_scale.addMember(scale2);
+        y2_scale.addMember(y2form2);
+
+
+        DynamicForm y3form1 = new DynamicForm();
+        DynamicForm y3form2 = new DynamicForm();
+        y3form2.setNumCols(6);
+
+        Label y3_axis = new Label (MSG.y3_axis());
+        y3_axis.setHeight(30);
+        HLayout y3_scale = new HLayout();
+        TextItem y3name = new TextItem ();
+        y3name.setTitle(MSG.axis_name());
+        y3name.setTitleAlign(Alignment.LEFT);
+
+        TextItem y3range1 = new TextItem();
+        y3range1.setTitle(MSG.chart_start());
+        y3range1.setTitleAlign(Alignment.LEFT);
+        y3range1.setWidth(50);
+
+        TextItem y3range2 = new TextItem();
+        y3range2.setTitle(MSG.chart_end());
+        y3range2.setTitleAlign(Alignment.LEFT);
+        y3range2.setWidth(50);
+
+        CheckboxItem y3fix = new CheckboxItem("y3fix", "Fix");
+        y3fix.setLabelAsTitle(true);
+        y3fix.setTitleStyle("color:#000;");
+        y3fix.setTitleAlign(Alignment.LEFT);
+
+        y3form1.setFields(y3name);
+        y3form2.setFields(y3range1, y3range2, y3fix);
+        y3_scale.addMember(scale3);
+        y3_scale.addMember(y3form2);
+
+
+        properties.addMember(x_axis);
+        properties.addMember(xform1);
+        properties.addMember(x_scale);
+        properties.addMember(y1_axis);
+        properties.addMember(y1form1);
+        properties.addMember(y1_scale);
+        properties.addMember(y2_axis);
+        properties.addMember(y2form1);
+        properties.addMember(y2_scale);
+        properties.addMember(y3_axis);
+        properties.addMember(y3form1);
+        properties.addMember(y3_scale);
+
+        t.setPane(properties);
+    }
+
+    /**
+     * Initializes the tab for legend properties.
+     */
+    protected void initLegendPropertiesTab(Tab t) {
+        VLayout properties = new VLayout();
+        DynamicForm form = new DynamicForm();
+
+        TextItem name = new TextItem ();
+        name.setTitle(MSG.legend_name());
+        name.setTitleAlign(Alignment.LEFT);
+
+        CheckboxItem show = new CheckboxItem("show", MSG.show_legend());
+        show.setLabelAsTitle(true);
+        show.setTitleStyle("color:#000;");
+        show.setTitleAlign(Alignment.LEFT);
+
+        form.setFields(name, show);
+        properties.addMember(form);
+        t.setPane(properties);
+    }
+
 }

http://dive4elements.wald.intevation.org