Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartThemePanel.java @ 9416:05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
author | gernotbelger |
---|---|
date | Thu, 16 Aug 2018 16:28:03 +0200 |
parents | 5e38e2924c07 |
children |
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 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
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 |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
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.chart; |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
11 import org.dive4elements.river.client.client.Config; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
12 import org.dive4elements.river.client.client.services.FeedServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
13 import org.dive4elements.river.client.client.services.LoadArtifactService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
14 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
15 import org.dive4elements.river.client.client.ui.CollectionView; |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
16 import org.dive4elements.river.client.client.ui.IThemeRecordHandler; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
17 import org.dive4elements.river.client.client.ui.ThemePanel; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
18 import org.dive4elements.river.client.shared.model.Artifact; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
19 import org.dive4elements.river.client.shared.model.Data; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
20 import org.dive4elements.river.client.shared.model.DefaultArtifact; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
21 import org.dive4elements.river.client.shared.model.DefaultData; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
22 import org.dive4elements.river.client.shared.model.FacetRecord; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
23 import org.dive4elements.river.client.shared.model.OutputMode; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
24 import org.dive4elements.river.client.shared.model.Recommendation; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.shared.model.Theme; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.shared.model.ThemeList; |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
28 import com.google.gwt.core.client.GWT; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
29 import com.google.gwt.user.client.rpc.AsyncCallback; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
30 import com.smartgwt.client.types.ListGridFieldType; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
31 import com.smartgwt.client.util.SC; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
32 import com.smartgwt.client.widgets.grid.CellFormatter; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
33 import com.smartgwt.client.widgets.grid.ListGridField; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
34 import com.smartgwt.client.widgets.grid.ListGridRecord; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
35 import com.smartgwt.client.widgets.layout.VLayout; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
36 import com.smartgwt.client.widgets.menu.Menu; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
37 import com.smartgwt.client.widgets.menu.MenuItem; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
38 import com.smartgwt.client.widgets.menu.events.ClickHandler; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
39 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
40 |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 /** |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
42 * ThemePanel on the left in CollectionView. |
8856 | 43 * Contains control widgets for "themes", which are plotted |
44 * in a diagram (chart). | |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
45 * |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 */ |
805
f43d06d6a4a2
Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
804
diff
changeset
|
48 public class ChartThemePanel extends ThemePanel { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
49 /** Artifact Clone/Creation service. */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
50 private final LoadArtifactServiceAsync loadService = GWT.create(LoadArtifactService.class); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
52 protected static final String GRID_FIELD_ACTIVE = "active"; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
53 protected static final String GRID_FIELD_NAME = "name"; |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
54 protected static final String GRID_FIELD_ACTIONS = "actions"; |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
55 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
56 protected final FeedServiceAsync feedService = GWT.create(org.dive4elements.river.client.client.services.FeedService.class); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
58 /** Constructor for a ChartThemePanel. |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
59 * @param recordHandler */ |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
60 public ChartThemePanel(final OutputMode mode, final CollectionView view, final IThemeRecordHandler recordHandler) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
61 super(mode, view, recordHandler); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
62 |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
63 initGrid(recordHandler); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 initLayout(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 updateGrid(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 } |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
1514
b6af10d5f3da
Partial flys/issue441.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
69 /** Creates Layout with theme list and navigation bar inside. */ |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
70 protected VLayout createLayout() { |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
71 final VLayout layout = new VLayout(); |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
72 layout.setWidth100(); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
73 layout.setHeight100(); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
74 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
75 layout.addMember(this.list); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
76 layout.addMember(this.navigation); |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
77 |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
78 return layout; |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
79 } |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
80 |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 /** |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 * Initializes the layout of this panel. |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
84 private void initLayout() { |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 setWidth100(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 setHeight100(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
88 addChild(createLayout()); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 /** |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 * Initializes the components (columns) of the theme grid. |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
93 * @param recordHandler |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
95 protected void initGrid( final IThemeRecordHandler recordHandler ) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
96 this.list.setCanEdit(true); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
97 this.list.setCanSort(false); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
98 this.list.setShowRecordComponents(false); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
99 this.list.setShowRecordComponentsByCell(true); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
100 this.list.setShowHeader(true); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
101 this.list.setShowHeaderContextMenu(false); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
102 this.list.setWidth100(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
103 this.list.setHeight100(); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
105 this.list.addEditCompleteHandler(this); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
107 final ListGridField active = new ListGridField(GRID_FIELD_ACTIVE, " ", 20); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 active.setType(ListGridFieldType.BOOLEAN); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
110 final ListGridField name = new ListGridField(GRID_FIELD_NAME, this.MSG.chart_themepanel_header_themes()); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 name.setType(ListGridFieldType.TEXT); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
113 if( recordHandler instanceof CellFormatter) |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
114 name.setCellFormatter((CellFormatter) recordHandler); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
115 |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
116 this.list.setFields(active, name); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 } |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
1460
dfe884cc24a4
Allow other.wkms facets to be created areas with.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1457
diff
changeset
|
119 /** Set theme active/inactive. */ |
805
f43d06d6a4a2
Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
804
diff
changeset
|
120 @Override |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
121 public void activateTheme(final Theme theme, final boolean active) { |
805
f43d06d6a4a2
Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
804
diff
changeset
|
122 theme.setActive(active ? 1 : 0); |
527
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
526
diff
changeset
|
123 } |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
124 |
1457
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
125 /** Returns name of longitudinal section area facets. */ |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
126 protected String getAreaFacetName() { |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
127 return "longitudinal_section.area"; |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
128 } |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
129 |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
130 /** Create the DataProvider ('Blackboard') key for a theme. */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
131 public static String areaKey(final Theme theme) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
132 return theme.getArtifact() + ":" + theme.getFacet() + ":" + theme.getIndex(); |
1514
b6af10d5f3da
Partial flys/issue441.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
133 } |
b6af10d5f3da
Partial flys/issue441.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
134 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
135 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
136 * Tell an area artifact where to get the upper and lower curve from. |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
137 * |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
138 * @param artifact |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
139 * UUID of area-artifact. |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
140 */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
141 public void feedTellArea(final String artifact, final Theme under, final Theme over, final boolean between) { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
142 Data[] feedData; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
143 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
144 if (over != null && under != null) { |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
145 feedData = new Data[] { DefaultData.createSimpleStringData("area.curve_under", areaKey(under)), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
146 DefaultData.createSimpleStringData("area.curve_over", areaKey(over)), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
147 DefaultData.createSimpleStringData("area.name", over.getDescription() + " / " + under.getDescription()), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
148 DefaultData.createSimpleStringData("area.facet", getAreaFacetName()), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
149 DefaultData.createSimpleStringData("area.between", (between) ? "true" : "false") }; |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
150 GWT.log("Have 'over' and 'under' curve"); |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
151 } else if (over == null && under != null) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
152 feedData = new Data[] { DefaultData.createSimpleStringData("area.curve_under", areaKey(under)), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
153 DefaultData.createSimpleStringData("area.name", under.getDescription() + " / " + this.MSG.getString("x_axis")), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
154 DefaultData.createSimpleStringData("area.facet", getAreaFacetName()), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
155 DefaultData.createSimpleStringData("area.between", (between) ? "true" : "false") }; |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
156 GWT.log("Have 'under' curve only"); |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
157 } else if (over != null && under == null) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
158 feedData = new Data[] { DefaultData.createSimpleStringData("area.curve_over", areaKey(over)), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
159 DefaultData.createSimpleStringData("area.name", this.MSG.getString("x_axis") + " / " + over.getDescription()), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
160 DefaultData.createSimpleStringData("area.facet", getAreaFacetName()), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
161 DefaultData.createSimpleStringData("area.between", (between) ? "true" : "false") }; |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
162 GWT.log("Have 'over' curve only"); |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
163 } else { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
164 GWT.log("Missing Data for area painting."); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
165 return; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
166 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
167 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
168 this.feedService.feed(Config.getInstance().getLocale(), new DefaultArtifact(artifact, "TODO:hash"), feedData, new AsyncCallback<Artifact>() { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
169 @Override |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
170 public void onFailure(final Throwable caught) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
171 GWT.log("Could not feed artifact (" + artifact + ") with area info: " + caught.getMessage()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
172 SC.warn(ChartThemePanel.this.MSG.getString(caught.getMessage())); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
173 enable(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
174 } |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
175 |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
176 @Override |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
177 public void onSuccess(final Artifact fartifact) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
178 GWT.log("Successfully set area params to " + artifact); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
179 requestRedraw(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
180 updateCollection(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
181 updateGrid(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
182 enable(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
183 } |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
184 }); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
185 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
186 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
187 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
188 * Create and parameterize a new area artifact. |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
189 * |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
190 * @param under |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
191 * @param over |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
192 * if null, against axis. |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
193 * @param between |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
194 * if true, ignore under/over order. |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
195 */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
196 public void createAreaArtifact(final Theme over, final Theme under, final boolean between) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
197 final Config config = Config.getInstance(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
198 final String locale = config.getLocale(); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
199 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
200 final Recommendation area = new Recommendation("area", "", "", null); |
7679
66c362b998c8
issue1574: Set target out for area artifact at creation time.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
201 |
66c362b998c8
issue1574: Set target out for area artifact at creation time.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
202 // Set target out dynamically. |
66c362b998c8
issue1574: Set target out for area artifact at creation time.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
203 area.setTargetOut(getMode().getName()); |
66c362b998c8
issue1574: Set target out for area artifact at creation time.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
204 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
205 final Recommendation[] recommendations = new Recommendation[] { area }; |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
206 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
207 this.loadService.loadMany(this.getCollection(), recommendations, null, // use individual factories. |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
208 locale, new AsyncCallback<Artifact[]>() { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
209 @Override |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
210 public void onFailure(final Throwable caught) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
211 GWT.log("Failed, no area artifact: " + caught.getMessage()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
212 enable(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
213 // TODO i18n |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
214 SC.warn("Failed, no area artifact: " + caught.getMessage()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
215 } |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
216 |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
217 @Override |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
218 public void onSuccess(final Artifact[] artifacts) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
219 GWT.log("Success, created area artifact: " + artifacts[0].getUuid()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
220 // Now, feed the artifact with the relevant data. |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
221 feedTellArea(artifacts[0].getUuid(), under, over, between); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
222 } |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
223 }); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
224 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
225 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
226 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
227 * Return true if two themes are canditates for an area being |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
228 * rendered between them. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
229 * TODO join with canArea, generalize to allow easier modification |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
230 * in subclasses. |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
231 */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
232 protected boolean areAreaCompatible(final Theme a, final Theme b) { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
233 if (a.equals(b)) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
234 return false; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
235 } |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
236 if (a.getFacet().equals("w_differences") && b.getFacet().equals("w_differences")) { |
7712
27578853bf24
(issue1622) Allow areas with w_differences
Andre Heinecke <aheinecke@intevation.de>
parents:
7681
diff
changeset
|
237 return true; |
27578853bf24
(issue1622) Allow areas with w_differences
Andre Heinecke <aheinecke@intevation.de>
parents:
7681
diff
changeset
|
238 } |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
239 if (a.getFacet().equals("longitudinal_section.w") || a.getFacet().equals("other.wqkms.w") || a.getFacet().equals("other.wqkms") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
240 || a.getFacet().equals("discharge_longitudinal_section.w") || a.getFacet().equals("discharge_longitudinal_section.c") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
241 || a.getFacet().equals("other.wkms")) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
242 return b.getFacet().equals("longitudinal_section.w") || b.getFacet().equals("other.wqkms") || b.getFacet().equals("other.wqkms.w") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
243 || b.getFacet().equals("discharge_longitudinal_section.w") || b.getFacet().equals("discharge_longitudinal_section.c") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
244 || b.getFacet().equals("other.wkms"); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
245 } else if (a.getFacet().equals("longitudinal_section.q") || a.getFacet().equals("discharge_longitudinal_section.q") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
246 || a.getFacet().equals("other.wqkms.q")) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
247 return b.getFacet().equals("longitudinal_section.q") || b.getFacet().equals("discharge_longitudinal_section.q") |
7680
8fe646d9d4ee
issue1547: Add more facets to lists of facets with which areas can be created.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7679
diff
changeset
|
248 || b.getFacet().equals("other.wqkms.q"); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
249 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
250 return false; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
251 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
252 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
253 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
254 * True if context menu should contain 'create area' submenu on |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
255 * this theme. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
256 */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
257 protected boolean canArea(final Theme a) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
258 return a.getFacet().equals("longitudinal_section.q") || a.getFacet().equals("longitudinal_section.w") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
259 || a.getFacet().equals("discharge_longitudinal_section.w") || a.getFacet().equals("discharge_longitudinal_section.q") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
260 || a.getFacet().equals("discharge_longitudinal_section.c") || a.getFacet().startsWith("other.wqkms") || a.getFacet().equals("other.wkms") |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
261 || a.getFacet().equals("w_differences"); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
262 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
263 |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
264 /** Attach menu/item to open editor for Manual Points. */ |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
265 protected void attachManualPointsMenu(final Menu menu) { |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
266 menu.addItem(createSeparator()); |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
267 final MenuItem editManualPoints = new MenuItem(this.MSG.editpoints()); |
2905
51ed89b754ae
FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2483
diff
changeset
|
268 |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
269 editManualPoints.addClickHandler(new ClickHandler() { |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
270 @Override |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
271 public void onClick(final MenuItemClickEvent evt) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
272 if (ChartThemePanel.this.mode.getName().equals("historical_discharge")) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
273 new ManualDatePointsEditor(ChartThemePanel.this.view.getCollection(), ChartThemePanel.this.redrawRequestHandlers.get(0), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
274 ChartThemePanel.this.mode.getName()).show(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
275 } else { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
276 new ManualPointsEditor(ChartThemePanel.this.view.getCollection(), ChartThemePanel.this.redrawRequestHandlers.get(0), |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
277 ChartThemePanel.this.mode.getName()).show(); |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
278 } |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
279 } |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
280 }); |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
281 menu.addItem(editManualPoints); |
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
282 } |
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
283 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
284 /** |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
285 * Include area specific menu items and manual point editor, depending |
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
286 * on facet. |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
287 */ |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
288 @Override |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
289 protected Menu getSingleContextMenu(final ListGridRecord[] records) { |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
290 final Menu menu = super.getSingleContextMenu(records); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
291 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
292 final Theme facetTheme = ((FacetRecord) records[0]).getTheme(); |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
293 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
294 if (!canArea(facetTheme)) { |
1607
64e3d4b024b1
Added Change accidentally ommitted to commit in rev 3960.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1588
diff
changeset
|
295 if (facetTheme.getFacet().endsWith("manualpoints")) { |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
296 attachManualPointsMenu(menu); |
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
297 return menu; |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
298 } else { |
1559
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
299 return menu; |
d738132d64b9
Added translateable context menu to open manual point editor from themepanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
300 } |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
301 } |
2905
51ed89b754ae
FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2483
diff
changeset
|
302 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
303 menu.addItem(createSeparator()); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
304 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
305 final MenuItem areaMenuItem = new MenuItem(this.MSG.chart_themepanel_new_area()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
306 final Menu areaMenu = new Menu(); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
307 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
308 final ThemeList themes = getThemeList(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
309 final int nThemes = themes.getThemeCount(); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
310 |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
311 // Create the "under..." submenu. |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
312 final MenuItem underMenuItem = new MenuItem(this.MSG.chart_themepanel_area_under()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
313 final Menu underMenu = new Menu(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
314 for (int i = 0; i < nThemes; i++) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
315 final Theme theme = themes.getThemeAt(i + 1); |
2442
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
316 |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
317 if (theme.getVisible() == 0) { |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
318 continue; |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
319 } |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
320 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
321 if (!areAreaCompatible(facetTheme, theme)) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
322 continue; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
323 } |
2442
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
324 |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
325 final MenuItem againster = new MenuItem(theme.getDescription()); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
326 underMenu.addItem(againster); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
327 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
328 againster.addClickHandler(new ClickHandler() { |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
329 @Override |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
330 public void onClick(final MenuItemClickEvent evt) { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
331 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
332 createAreaArtifact(theme, facetTheme, false); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
333 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
334 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
335 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
336 |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
337 // Create the "over..." submenu. |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
338 final MenuItem overMenuItem = new MenuItem(this.MSG.chart_themepanel_area_over()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
339 final Menu overMenu = new Menu(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
340 for (int i = 0; i < nThemes; i++) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
341 final Theme theme = themes.getThemeAt(i + 1); |
2442
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
342 if (theme.getVisible() == 0) { |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
343 continue; |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
344 } |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
345 if (!areAreaCompatible(facetTheme, theme)) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
346 continue; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
347 } |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
348 final MenuItem againster = new MenuItem(theme.getDescription()); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
349 overMenu.addItem(againster); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
350 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
351 againster.addClickHandler(new ClickHandler() { |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
352 @Override |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
353 public void onClick(final MenuItemClickEvent evt) { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
354 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
355 createAreaArtifact(facetTheme, theme, false); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
356 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
357 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
358 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
359 overMenu.addItem(createSeparator()); |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
360 final MenuItem againstAxis = new MenuItem(this.MSG.getString("x_axis")); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
361 againstAxis.addClickHandler(new ClickHandler() { |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
362 @Override |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
363 public void onClick(final MenuItemClickEvent evt) { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
364 disable(); |
1469
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
365 createAreaArtifact(null, facetTheme, false); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
366 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
367 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
368 overMenu.addItem(againstAxis); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
369 |
1517
a9388fba0b46
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1514
diff
changeset
|
370 // Create the "between..." submenu. |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
371 final MenuItem betweenMenuItem = new MenuItem(this.MSG.chart_themepanel_area_between()); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
372 final Menu betweenMenu = new Menu(); |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
373 for (int i = 0; i < nThemes; i++) { |
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
374 final Theme theme = themes.getThemeAt(i + 1); |
2442
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
375 if (theme.getVisible() == 0) { |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
376 continue; |
49ca36baf4ab
Fix issue621 (areas against removed themes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1607
diff
changeset
|
377 } |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
378 if (!areAreaCompatible(facetTheme, theme)) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
379 continue; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
380 } |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
381 final MenuItem againster = new MenuItem(theme.getDescription()); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
382 betweenMenu.addItem(againster); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
383 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
384 againster.addClickHandler(new ClickHandler() { |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
385 @Override |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
386 public void onClick(final MenuItemClickEvent evt) { |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
387 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
388 createAreaArtifact(facetTheme, theme, true); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
389 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
390 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
391 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
392 betweenMenu.addItem(createSeparator()); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
393 betweenMenu.addItem(againstAxis); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
394 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
395 overMenuItem.setSubmenu(overMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
396 underMenuItem.setSubmenu(underMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
397 betweenMenuItem.setSubmenu(betweenMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
398 |
1469
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
399 areaMenu.addItem(betweenMenuItem); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
400 areaMenu.addItem(overMenuItem); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
401 areaMenu.addItem(underMenuItem); |
1469
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
402 areaMenu.addItem(createSeparator()); |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
403 final MenuItem standAloneAgainstAxis = new MenuItem(this.MSG.getString("against_x_axis")); |
1469
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
404 standAloneAgainstAxis.addClickHandler(new ClickHandler() { |
4568
bbd82bd8e541
flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
405 @Override |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
406 public void onClick(final MenuItemClickEvent evt) { |
1469
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
407 disable(); |
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
408 createAreaArtifact(null, facetTheme, false); |
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
409 } |
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
410 }); |
31d0557f31a2
Fix over axis menu item, added standalone 'over axis' menu item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1462
diff
changeset
|
411 areaMenu.addItem(standAloneAgainstAxis); |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
412 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
413 areaMenuItem.setSubmenu(areaMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
414 menu.addItem(areaMenuItem); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
415 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
416 return menu; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
417 } |
9416
05405292a7ca
Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
gernotbelger
parents:
8856
diff
changeset
|
418 } |