# HG changeset patch # User Björn Ricks # Date 1350396638 -7200 # Node ID bbc49d9450c8ed5595860707d8f2d63ee4b5979b # Parent bbae306fcb4f8914a42f3ea6c6d85b19585d7bac Add a new panel to show settings of a gauge discharge curve diff -r bbae306fcb4f -r bbc49d9450c8 flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Oct 16 15:51:27 2012 +0200 +++ b/flys-client/ChangeLog Tue Oct 16 16:10:38 2012 +0200 @@ -1,3 +1,9 @@ +2012-10-16 Björn Ricks + + * src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java, + src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java: + Add a new panel to show settings of a gauge discharge curve. + 2012-10-16 Björn Ricks * src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java: diff -r bbae306fcb4f -r bbc49d9450c8 flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java Tue Oct 16 16:10:38 2012 +0200 @@ -0,0 +1,76 @@ +package de.intevation.flys.client.client.ui; + +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; + +import com.google.gwt.core.client.GWT; + +import com.smartgwt.client.types.VerticalAlignment; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; + +import de.intevation.flys.client.shared.model.Data; +import de.intevation.flys.client.shared.model.DataItem; +import de.intevation.flys.client.shared.model.DataList; +import de.intevation.flys.client.shared.model.DefaultData; +import de.intevation.flys.client.shared.model.DefaultDataItem; + +import de.intevation.flys.client.client.FLYSConstants; + + +/** + * This UIProvider displays the old DataItems of GaugeDischargeCurveArtifact + * + * @author Björn Ricks + */ +public class GaugeDischargeCurvePanel +extends AbstractUIProvider +{ + /** The message class that provides i18n strings.*/ + protected FLYSConstants messages = GWT.create(FLYSConstants.class); + + /** The combobox.*/ + protected DynamicForm form; + + @Override + public Canvas create(DataList data) { + VLayout layout = new VLayout(); + return layout; + } + + @Override + public Canvas createOld(DataList dataList) { + HLayout layout = new HLayout(); + VLayout vLayout = new VLayout(); + vLayout.setWidth("400px"); + + int size = dataList.size(); + for (int i = 0; i < size; i++) { + Data data = dataList.get(i); + DataItem[] items = data.getItems(); + + for (DataItem item: items) { + HLayout hLayout = new HLayout(); + + hLayout.addMember(new Label(item.getLabel())); + hLayout.addMember(new Label(item.getStringValue())); + + vLayout.addMember(hLayout); + vLayout.setWidth("130px"); + } + } + + return vLayout; + } + + @Override + protected Data[] getData() { + return null; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r bbae306fcb4f -r bbc49d9450c8 flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java Tue Oct 16 15:51:27 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java Tue Oct 16 16:10:38 2012 +0200 @@ -152,6 +152,9 @@ else if (uiProvider.equals("minfo.bed.char_diameter")) { return new CheckboxPanel(); } + else if (uiProvider.equals("gauge_discharge_curve")) { + return new GaugeDischargeCurvePanel(); + } else { //GWT.log("Picked default provider."); return new SelectProvider();