Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java @ 3715:8d3e48f189d2
Add first draft for the gauge overview info ui
flys-client/trunk@5472 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 14 Sep 2012 14:07:48 +0000 |
parents | 08f8524a81ad |
children | 4e33aa341e51 |
comparison
equal
deleted
inserted
replaced
3714:60544e37783b | 3715:8d3e48f189d2 |
---|---|
11 | 11 |
12 import com.smartgwt.client.types.VerticalAlignment; | 12 import com.smartgwt.client.types.VerticalAlignment; |
13 import com.smartgwt.client.types.VisibilityMode; | 13 import com.smartgwt.client.types.VisibilityMode; |
14 import com.smartgwt.client.util.SC; | 14 import com.smartgwt.client.util.SC; |
15 import com.smartgwt.client.widgets.Canvas; | 15 import com.smartgwt.client.widgets.Canvas; |
16 import com.smartgwt.client.widgets.Label; | |
16 import com.smartgwt.client.widgets.layout.HLayout; | 17 import com.smartgwt.client.widgets.layout.HLayout; |
17 import com.smartgwt.client.widgets.layout.SectionStack; | 18 import com.smartgwt.client.widgets.layout.SectionStack; |
18 import com.smartgwt.client.widgets.layout.SectionStackSection; | 19 import com.smartgwt.client.widgets.layout.SectionStackSection; |
19 import com.smartgwt.client.widgets.layout.VLayout; | 20 import com.smartgwt.client.widgets.layout.VLayout; |
20 import com.smartgwt.client.widgets.tab.Tab; | 21 import com.smartgwt.client.widgets.tab.Tab; |
21 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; | 22 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
22 | 23 |
23 import de.intevation.flys.client.shared.model.Artifact; | 24 import de.intevation.flys.client.shared.model.Artifact; |
25 import de.intevation.flys.client.shared.model.WINFOArtifact; | |
24 import de.intevation.flys.client.shared.model.ArtifactDescription; | 26 import de.intevation.flys.client.shared.model.ArtifactDescription; |
25 import de.intevation.flys.client.shared.model.Collection; | 27 import de.intevation.flys.client.shared.model.Collection; |
26 import de.intevation.flys.client.shared.model.Data; | 28 import de.intevation.flys.client.shared.model.Data; |
27 import de.intevation.flys.client.shared.model.DataItem; | 29 import de.intevation.flys.client.shared.model.DataItem; |
28 import de.intevation.flys.client.shared.model.DataList; | 30 import de.intevation.flys.client.shared.model.DataList; |
107 protected VLayout currentItems; | 109 protected VLayout currentItems; |
108 protected VLayout exportModes; | 110 protected VLayout exportModes; |
109 protected VLayout report; | 111 protected VLayout report; |
110 protected VLayout helperPanel; | 112 protected VLayout helperPanel; |
111 protected VLayout tablePanel; | 113 protected VLayout tablePanel; |
114 protected GaugePanel gaugePanel; | |
112 protected Canvas reportPanel; | 115 protected Canvas reportPanel; |
113 | 116 |
114 public ParameterList(FLYS flys, CollectionView cView, String title) { | 117 public ParameterList(FLYS flys, CollectionView cView, String title) { |
115 super(title); | 118 super(title); |
116 | 119 |
205 final SectionStack stack = new SectionStack(); | 208 final SectionStack stack = new SectionStack(); |
206 stack.setHeight100(); | 209 stack.setHeight100(); |
207 stack.setCanResizeSections(true); | 210 stack.setCanResizeSections(true); |
208 stack.setVisibilityMode(VisibilityMode.MULTIPLE); | 211 stack.setVisibilityMode(VisibilityMode.MULTIPLE); |
209 | 212 |
213 final SectionStackSection gaugeSection = new SectionStackSection(); | |
214 gaugeSection.setExpanded(false); | |
215 gaugeSection.setTitle(MSG.gaugePanelTitle()); | |
216 gaugePanel = new GaugePanel(gaugeSection) { | |
217 public void addMember(Canvas component) { | |
218 super.addMember(component); | |
219 gaugeSection.setExpanded(true); | |
220 } | |
221 | |
222 public void removeMembers(Canvas[] components) { | |
223 super.removeMembers(components); | |
224 gaugeSection.setExpanded(false); | |
225 } | |
226 }; | |
227 gaugePanel.setWidth100(); | |
228 gaugePanel.setHeight("20%"); | |
229 | |
210 // This canvas is used to render helper widgets. | 230 // This canvas is used to render helper widgets. |
211 final SectionStackSection helperSection = new SectionStackSection(); | 231 final SectionStackSection helperSection = new SectionStackSection(); |
212 helperSection.setExpanded(false); | 232 helperSection.setExpanded(false); |
213 helperSection.setTitle(MSG.helperPanelTitle()); | 233 helperSection.setTitle(MSG.helperPanelTitle()); |
214 helperPanel = new VLayout() { | 234 helperPanel = new VLayout() { |
243 }; | 263 }; |
244 tablePanel.setHeight100(); | 264 tablePanel.setHeight100(); |
245 tablePanel.setWidth100(); | 265 tablePanel.setWidth100(); |
246 tableSection.setItems(tablePanel); | 266 tableSection.setItems(tablePanel); |
247 | 267 |
248 stack.setSections(helperSection, tableSection); | 268 stack.setSections(gaugeSection, helperSection, tableSection); |
249 | 269 |
250 return stack; | 270 return stack; |
251 } | 271 } |
252 | 272 |
253 | 273 |
680 Canvas[] c = helperPanel.getMembers(); | 700 Canvas[] c = helperPanel.getMembers(); |
681 if (c != null && c.length > 0) { | 701 if (c != null && c.length > 0) { |
682 helperPanel.removeMembers(c); | 702 helperPanel.removeMembers(c); |
683 } | 703 } |
684 | 704 |
705 c = gaugePanel.getMembers(); | |
706 if (c != null && c.length > 0) { | |
707 gaugePanel.removeMembers(c); | |
708 } | |
709 | |
685 Artifact art = event.getNewValue(); | 710 Artifact art = event.getNewValue(); |
686 ArtifactDescription desc = art.getArtifactDescription(); | 711 ArtifactDescription desc = art.getArtifactDescription(); |
687 | 712 |
688 DataList currentData = desc.getCurrentData(); | 713 DataList currentData = desc.getCurrentData(); |
689 if (currentData != null) { | 714 if (currentData != null) { |
721 else { | 746 else { |
722 // we have reached a final state with no more user input | 747 // we have reached a final state with no more user input |
723 setCurrentData(null, null); | 748 setCurrentData(null, null); |
724 } | 749 } |
725 } | 750 } |
751 if (art instanceof WINFOArtifact) { | |
752 renderGaugeInfo(desc.getRiver()); | |
753 gaugePanel.show(); | |
754 } | |
726 | 755 |
727 addOldDatas( | 756 addOldDatas( |
728 desc.getOldData(), | 757 desc.getOldData(), |
729 event.getType() == ParameterChangeEvent.Type.BACK); | 758 event.getType() == ParameterChangeEvent.Type.BACK); |
730 } | 759 } |
893 | 922 |
894 | 923 |
895 protected void unlockUI() { | 924 protected void unlockUI() { |
896 cView.unlockUI(); | 925 cView.unlockUI(); |
897 } | 926 } |
927 | |
928 | |
929 private void renderGaugeInfo(String river) { | |
930 gaugePanel.setRiver(river); | |
931 gaugePanel.show(); | |
932 } | |
933 | |
898 } | 934 } |
899 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 935 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |