annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/InundationWMSInputPanel.java @ 9559:ba0561906f81

Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
author gernotbelger
date Wed, 24 Oct 2018 18:40:38 +0200
parents 787fc085459b
children
rev   line source
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
2 * Software engineering by Intevation GmbH
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
3 *
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
7 */
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
8
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
9 package org.dive4elements.river.client.client.ui.uinfo;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
10
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
11 import org.dive4elements.river.client.client.FLYSConstants;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
12 import org.dive4elements.river.client.client.ui.AbstractSingleItemPanel;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
13 import org.dive4elements.river.client.shared.model.DataList;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
14
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
15 import com.smartgwt.client.widgets.Canvas;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
16 import com.smartgwt.client.widgets.Label;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
17 import com.smartgwt.client.widgets.form.DynamicForm;
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
18 import com.smartgwt.client.widgets.form.fields.StaticTextItem;
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
19 import com.smartgwt.client.widgets.form.fields.TextItem;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
20 import com.smartgwt.client.widgets.layout.VLayout;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
21
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
22 public class InundationWMSInputPanel extends AbstractSingleItemPanel {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
23
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
24 private static final long serialVersionUID = 1L;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
25 private final boolean isEditable;
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
26 private final String dataKey;
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
27 private final String appendString;
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
28
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
29 public InundationWMSInputPanel(final FLYSConstants msg, final String dataKey, final String titleForCreateOld, final String appendString,
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
30 final boolean isEditable) {
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
31 super(new UinfoInundationSingleYearEpochBehaviour(appendString, msg, titleForCreateOld));
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
32 this.isEditable = isEditable;
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
33 this.dataKey = dataKey;
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
34 this.appendString = appendString;
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
35 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
36
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
37 @Override
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
38 protected String getDatakey() {
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
39 return this.dataKey;
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
40 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
41
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
42 @Override
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
43 protected String errorForItemMsg() {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
44 return this.MSG.no_data_for_input();
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
45 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
46
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
47 @Override
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
48 public Canvas createWidget(final DataList data) {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
49 final VLayout layout = new VLayout();
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
50
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
51 final Label title = new Label(data.get(0).getDescription());
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
52 title.setHeight("25px");
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
53
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
54 final DynamicForm form = new DynamicForm();
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
55 form.setNumCols(4);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
56
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
57 final TextItem inputItem = createInputItem("INPUT");
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
58 inputItem.setWidth(250);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
59 inputItem.setCanEdit(this.isEditable);
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
60
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
61 inputItem.setShowTitle(false);
9559
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
62
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
63 if (this.appendString != null) {
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
64
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
65 final StaticTextItem fromText = new StaticTextItem("staticAppend");
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
66 fromText.setValue(this.appendString);
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
67 fromText.setShowTitle(false);
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
68 form.setFields(inputItem, fromText);
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
69 } else {
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
70 form.setFields(inputItem);
ba0561906f81 Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents: 9481
diff changeset
71 }
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
72
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
73 layout.addMember(title);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
74 layout.addMember(form);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
75
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
76 return layout;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
77 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
78
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
79 }

http://dive4elements.wald.intevation.org