Mercurial > dive4elements > river
changeset 1429:16b7adc66330
Added stub for chart property editor.
flys-client/trunk@3375 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 09 Dec 2011 14:45:53 +0000 |
parents | 441b0a047c40 |
children | 6bb6d43eeb2d |
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 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java |
diffstat | 7 files changed, 164 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Fri Dec 09 11:05:48 2011 +0000 +++ b/flys-client/ChangeLog Fri Dec 09 14:45:53 2011 +0000 @@ -1,3 +1,19 @@ +2011-12-09 Raimund Renkert <raimund.renkert@intevation.de> + + Added stub for chart property editor. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: + Added button for chart properties editor. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java: + New. Create window with tabs for chart 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_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties: + Added i18n strings. + 2011-12-09 Raimund Renkert <raimund.renkert@intevation.de> Issue 377.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Fri Dec 09 11:05:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Fri Dec 09 14:45:53 2011 +0000 @@ -84,6 +84,12 @@ String chart(); + String diagram(); + + String axes(); + + String legend(); + String databasket(); String theme_top(); @@ -102,6 +108,8 @@ String zoom_back(); + String properties_ico(); + String pan(); String askThemeRemove();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Fri Dec 09 11:05:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Fri Dec 09 14:45:53 2011 +0000 @@ -35,6 +35,9 @@ minfo = MINFO map = New Map chart = New Chart +diagram = Chart +axes = Axes +legend = Legend databasket = Databasket fix = TODO FIX ANALYSE TODO next = Next @@ -68,6 +71,7 @@ markerRed = images/marker_red.png markerGreen = images/marker_green.png riverMap = images/gewkarte.png +properties_ico = images/properties.gif dpLabelFrom = From dpUnitFrom = km
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Fri Dec 09 11:05:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Fri Dec 09 14:45:53 2011 +0000 @@ -35,6 +35,9 @@ minfo = MINFO map = Neue Karte chart = Neues Diagramm +diagram = Diagramm +axes = Achsen +legend = Legende databasket = Datenkorb fix = Fixierungsanalyse next = Weiter @@ -68,6 +71,7 @@ markerRed = images/marker_red.png markerGreen = images/marker_green.png riverMap = images/gewkarte.png +properties_ico = images/properties.gif dpLabelFrom = Von dpUnitFrom = km
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Fri Dec 09 11:05:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Fri Dec 09 14:45:53 2011 +0000 @@ -35,6 +35,9 @@ minfo = MINFO map = New Map chart = New Chart +diagram = Chart +axes = Axes +legend = Legend databasket = Databasket fix = TODO FIX ANALYSE TODO next = Next @@ -68,6 +71,7 @@ markerRed = images/marker_red.png markerGreen = images/marker_green.png riverMap = images/gewkarte.png +properties_ico = images/properties.gif dpLabelFrom = From dpUnitFrom = km
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java Fri Dec 09 14:45:53 2011 +0000 @@ -0,0 +1,99 @@ +package de.intevation.flys.client.client.ui.chart; + +import java.util.LinkedHashMap; + +import com.google.gwt.core.client.GWT; + +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.tab.TabSet; +import com.smartgwt.client.widgets.tab.Tab; +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.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.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.form.events.ItemChangedEvent; +import com.smartgwt.client.widgets.form.events.ItemChangedHandler; +import com.smartgwt.client.types.Alignment; + +import de.intevation.flys.client.client.FLYSConstants; +import de.intevation.flys.client.client.ui.OutputTab; + +/** + * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> + */ +public class ChartPropertiesEditor +extends Window +implements ClickHandler +{ + /** The interface that provides i18n messages. */ + protected FLYSConstants MSG = GWT.create(FLYSConstants.class); + + /** The tab called the editor window. */ + protected OutputTab tab; + + /** The tabset for chart properties */ + protected TabSet tabs; + + /** + * Setup editor dialog. + * @param callerTab The tab called the editor window. + */ + public ChartPropertiesEditor(OutputTab callerTab) { + this.tab = callerTab; + this.tabs = new TabSet(); + + init(); + } + + /** + * Initialize the editor window and its components. + */ + protected void init() { + setTitle(MSG.properties()); + setCanDragReposition(true); + setCanDragResize(true); + + Tab diagram = new Tab(MSG.diagram()); + Tab axes = new Tab(MSG.axes()); + Tab legend = new Tab(MSG.legend()); + tabs.addTab(diagram); + tabs.addTab(axes); + tabs.addTab(legend); + + Button accept = new Button(MSG.label_ok()); + Button cancel = new Button(MSG.label_cancel()); + cancel.addClickHandler(this); + accept.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent e) { + + } + }); + + HLayout buttons = new HLayout(); + buttons.addMember(accept); + buttons.addMember(cancel); + buttons.setAlign(Alignment.CENTER); + buttons.setHeight(30); + + addItem(tabs); + addItem(buttons); + setWidth(300); + setHeight(410); + centerInPage(); + } + + /** + * This method is called when the user aborts theming. + * @param event The event. + */ + public void onClick(ClickEvent event) { + this.hide(); + } +}
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Fri Dec 09 11:05:48 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Fri Dec 09 14:45:53 2011 +0000 @@ -47,6 +47,8 @@ protected ImgButton zoomOut; + protected ImgButton chartProperties; + protected PanControl panControl; @@ -62,6 +64,7 @@ zoomOut = new ImgButton(); historyBack = new ImgButton(); panControl = new PanControl(chartTab, MSG.pan()); + chartProperties = new ImgButton(); datacage.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { @@ -149,6 +152,21 @@ } }); + chartProperties.setSrc(baseUrl + MSG.properties_ico()); + chartProperties.setWidth(20); + chartProperties.setHeight(20); + chartProperties.setShowDown(false); + chartProperties.setShowRollOver(false); + chartProperties.setShowDisabled(false); + chartProperties.setShowDisabledIcon(true); + chartProperties.setShowDownIcon(false); + chartProperties.setShowFocusedIcon(false); + chartProperties.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent event) { + openPropertiesEditor(); + } + }); + initLayout(); } @@ -179,8 +197,19 @@ addMember(zoomOut); addMember(zoombox); addMember(panControl); + addMember(chartProperties); addMember(spacer); addMember(position); } + + /** + * Open the chart property editor dialog. + */ + protected void openPropertiesEditor() { + ChartPropertiesEditor editor = + new ChartPropertiesEditor(getChartOutputTab()); + editor.show(); + } + } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :