Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixEventSelect.java @ 5861:172338b1407f
GWT client: Added copyright header.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 28 Apr 2013 14:30:15 +0200 |
parents | 5aa05a7a34b7 |
children | ea9eef426962 |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui.fixation; |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import java.util.ArrayList; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 import com.google.gwt.core.client.GWT; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 import com.smartgwt.client.widgets.Canvas; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.Label; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 import com.smartgwt.client.widgets.layout.HLayout; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 import com.smartgwt.client.widgets.layout.VLayout; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
22 import org.dive4elements.river.client.client.FLYSConstants; |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
24 import org.dive4elements.river.client.shared.model.Data; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.shared.model.DataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.shared.model.DataList; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
27 import org.dive4elements.river.client.shared.model.IntDataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.shared.model.IntegerArrayData; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.shared.model.FixingsOverviewInfo.FixEvent; |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
30 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
31 import org.dive4elements.river.client.client.services.FixingsOverviewService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.client.services.FixingsOverviewServiceAsync; |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 /** |
5334
b296d435fc69
Doc and whitespace fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3379
diff
changeset
|
35 * This UIProvider lets you select events. |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 * |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 */ |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 public class FixEventSelect |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 extends FixationPanel |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 /** The message class that provides i18n strings. */ |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 |
2919
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
45 public static final int MAX_DISPLAYED_ITEMS = 5; |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
46 |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
47 protected FixingsOverviewServiceAsync overviewService = |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
48 GWT.create(FixingsOverviewService.class); |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
49 |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 protected List<String> events; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 public FixEventSelect() { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 htmlOverview = ""; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 events = new ArrayList<String>(); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 public Canvas createWidget(DataList data) { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 instances.put(this.artifact.getUuid(), this); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 VLayout layout = new VLayout(); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 Canvas title = new Label(MESSAGES.eventselect()); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 title.setHeight("25px"); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 layout.addMember(title); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 return layout; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 @Override |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 public Canvas createOld(DataList dataList) { |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
71 List<Data> list = dataList.getAll(); |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
72 |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
73 Data data = getData(list, "events"); |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
74 |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
75 VLayout dataLayout = new VLayout(); |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
76 dataLayout.setWidth(130); |
2919
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
77 |
2537
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
78 DataItem[] items = data.getItems(); |
2919
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
79 |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
80 if (items.length > MAX_DISPLAYED_ITEMS) { |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
81 for (int i = 0; i < MAX_DISPLAYED_ITEMS-2; ++i) { |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
82 Label l = new Label(items[i].getLabel()); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
83 l.setHeight(25); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
84 dataLayout.addMember(l); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
85 } |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
86 Label l = new Label("..."); |
2537
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
87 l.setHeight(25); |
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
88 dataLayout.addMember(l); |
2919
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
89 l = new Label(items[items.length-1].getLabel()); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
90 l.setHeight(25); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
91 dataLayout.addMember(l); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
92 } |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
93 else { |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
94 for (int i = 0; i < items.length; i++) { |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
95 Label l = new Label(items[i].getLabel()); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
96 l.setHeight(25); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
97 dataLayout.addMember(l); |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
98 } |
2537
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
99 } |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
100 |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 HLayout layout = new HLayout(); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 layout.setWidth("400px"); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 Label label = new Label(dataList.getLabel()); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 label.setWidth("200px"); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 Canvas back = getBackButton(dataList.getState()); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 layout.addMember(label); |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
110 layout.addMember(dataLayout); |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 layout.addMember(back); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
112 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 return layout; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
115 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
116 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
117 /** |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 * This method returns the selected data. |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 * |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 * @return the selected/inserted data. |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 */ |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 public Data[] getData() { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 List<Data> data = new ArrayList<Data>(); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
125 if (events.size() > 0) { |
2537
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
126 IntDataItem[] arr = new IntDataItem[events.size()]; |
2919
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
127 for (int i = 0, E = events.size(); i < E; i++) { |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
128 try { |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
129 Integer v = new Integer(events.get(i)); |
2537
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
130 arr[i] = new IntDataItem("id", "id", v.intValue()); |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
131 } |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
132 catch (NumberFormatException nfe) { |
3379
0de61fc9d281
Removed some superfluous casts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2919
diff
changeset
|
133 return data.toArray(new Data[data.size()]); |
2526
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
134 } |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
135 } |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
136 |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
137 IntegerArrayData iad = |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
138 new IntegerArrayData("events", "events", arr); |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
139 |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
140 data.add(iad); |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
141 } |
a911e2968cb1
Changed some data types in states and filter and added new preprocessing state
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2517
diff
changeset
|
142 |
3379
0de61fc9d281
Removed some superfluous casts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2919
diff
changeset
|
143 return data.toArray(new Data[data.size()]); |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 @Override |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 public void setValues(String cid, boolean checked) { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 if (checked) { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 events.add(cid); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
151 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 else { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 if (events.contains(cid)) { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 events.remove(cid); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
158 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
159 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 @Override |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 public boolean renderCheckboxes() { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 return true; |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 |
2902
82043c09a659
Add all events to the list of selected events in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2899
diff
changeset
|
166 public void success() { |
2919
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
167 for (FixEvent fe: fixInfo.getEvents()) { |
0173b4498054
FixA: Limit the number of displayed selected fixings to 5.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2902
diff
changeset
|
168 events.add(fe.getCId()); |
2902
82043c09a659
Add all events to the list of selected events in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2899
diff
changeset
|
169 } |
82043c09a659
Add all events to the list of selected events in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2899
diff
changeset
|
170 } |
2517
8f528f5ae137
Added filter object class and scrollable chart to helper panel.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2505
diff
changeset
|
171 |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
172 public void dumpGWT(String cid) { |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
173 GWT.log("Setting values for cId: " + cid); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
174 GWT.log("River: " + fixInfo.getRiver()); |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
175 GWT.log("Date: " + fixInfo.getEventByCId(cid).getDate()); |
2537
cc5969df0490
New methods in UI providers for fixings states and minor protocol changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2526
diff
changeset
|
176 GWT.log("Name: " + fixInfo.getEventByCId(cid).getDescription()); |
2505
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
177 } |
87ac5c532523
First part of the UI for fixing analysis parameter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
178 } |