# HG changeset patch # User Raimund Renkert # Date 1317390120 0 # Node ID 95ecb98c601557704beed3b8884d2f5954ca42a5 # Parent b643622d77fed764f49b10733f245162197a5cc3 Added skeleton for editor window. flys-client/trunk@2873 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r b643622d77fe -r 95ecb98c6015 flys-client/ChangeLog --- a/flys-client/ChangeLog Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/ChangeLog Fri Sep 30 13:42:00 2011 +0000 @@ -1,3 +1,21 @@ +2011-09-30 Raimund Renkert + + Added skeleton for editor window. + + * src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java: + New. Skeleton for editor window. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java, + src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java: + Set the collection view as attribute to have a parent for the + style editor window. + + * 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 strings for the style editor window. + 2011-09-30 Raimund Renkert * src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java: diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Fri Sep 30 13:42:00 2011 +0000 @@ -224,6 +224,10 @@ String properties(); + String label_ok(); + + String label_cancel(); + // OUTPUT TYPES String discharge_curve(); diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Fri Sep 30 13:42:00 2011 +0000 @@ -49,6 +49,8 @@ search = Search discharge = FIXME(Name) properties = Properties +label_ok = Ok +label_cancel = Cancel dpLabelFrom = From dpUnitFrom = km diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Fri Sep 30 13:42:00 2011 +0000 @@ -49,6 +49,8 @@ search = Suchbegriff discharge = Kennzeichnender Abfluss properties = Eigenschaften +label_ok = Ok +label_cancel = Abbrechen dpLabelFrom = Von dpUnitFrom = km diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Fri Sep 30 13:42:00 2011 +0000 @@ -49,6 +49,8 @@ search = Search discharge = FIXME(Name) properties = Properties +label_ok = Ok +label_cancel = Cancel dpLabelFrom = From dpUnitFrom = km diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Fri Sep 30 13:42:00 2011 +0000 @@ -142,6 +142,7 @@ } else { ctp = new ChartThemePanel(collection, mode); + ctp.setCollectionView(this.view); } ctp.addRedrawRequestHandler(this); diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java Fri Sep 30 11:03:33 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java Fri Sep 30 13:42:00 2011 +0000 @@ -28,6 +28,7 @@ import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.ui.ThemePanel; import de.intevation.flys.client.client.Config; +import de.intevation.flys.client.client.ui.CollectionView; import de.intevation.flys.client.client.services.FeedService; import de.intevation.flys.client.client.services.FeedServiceAsync; @@ -45,6 +46,9 @@ /** The collection */ protected Collection collection; + /** The collection view*/ + protected CollectionView view; + /** The service used to get collection item attributes. */ protected CollectionItemAttributeServiceAsync itemAttributeService = GWT.create(CollectionItemAttributeService.class); @@ -162,8 +166,18 @@ } public void onSuccess(CollectionItemAttribute cia) { GWT.log("Successfully loaded collectionitem attributes."); + StyleEditorWindow win = new StyleEditorWindow( + collection, + cia); + win.setCollectionView(view); + win.show(); } }); } + + + public void setCollectionView (CollectionView view) { + this.view = view; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r b643622d77fe -r 95ecb98c6015 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java Fri Sep 30 13:42:00 2011 +0000 @@ -0,0 +1,93 @@ +package de.intevation.flys.client.client.ui.chart; + +import com.google.gwt.core.client.GWT; + +import com.smartgwt.client.widgets.Window; +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.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; + +import de.intevation.flys.client.shared.model.Collection; +import de.intevation.flys.client.shared.model.CollectionItemAttribute; +import de.intevation.flys.client.client.ui.CollectionView; + +import de.intevation.flys.client.client.FLYSConstants; + +/** + * @author Raimund Renkert + */ +public class StyleEditorWindow +extends Window +implements ClickHandler +{ + /** The interface that provides i18n messages. */ + protected FLYSConstants MSG = GWT.create(FLYSConstants.class); + + /** The collection */ + protected Collection collection; + + /** The parent collection view */ + protected CollectionView view; + + /** The attributes */ + protected CollectionItemAttribute attributes; + + /** Main layout */ + protected VLayout layout; + + + public StyleEditorWindow ( + Collection collection, + CollectionItemAttribute attributes) + { + this.collection = collection; + this.attributes = attributes; + this.layout = new VLayout(); + + init(); + initPanels(); + } + + + protected void init() { + setTitle(MSG.properties()); + setWidth(250); + + setCanDragReposition(true); + setCanDragResize(true); + setKeepInParentRect(true); + + layout.setWidth100(); + layout.setHeight100(); + + } + + + protected void initPanels() { + HLayout buttons = new HLayout(); + Button accept = new Button(MSG.label_ok()); + Button cancel = new Button(MSG.label_cancel()); + cancel.addClickHandler(this); + + + buttons.addMember(accept); + buttons.addMember(cancel); + layout.addMember(buttons); + + addItem(layout); + } + + + public void setCollectionView (CollectionView view) { + this.view = view; + setParentElement(this.view.getParentElement()); + } + + + public void onClick(ClickEvent event) { + this.hide(); + } +}