annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.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 cff7636035ce
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;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
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
11 import java.util.ArrayList;
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
12 import java.util.List;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
14 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
15 import org.dive4elements.river.client.client.FLYSConstants;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
16 import org.dive4elements.river.client.client.event.HasOutputParameterChangeHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
17 import org.dive4elements.river.client.client.event.HasRedrawRequestHandlers;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
18 import org.dive4elements.river.client.client.event.OnMoveEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
19 import org.dive4elements.river.client.client.event.OnMoveHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
20 import org.dive4elements.river.client.client.event.OutputParameterChangeEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
21 import org.dive4elements.river.client.client.event.OutputParameterChangeHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
22 import org.dive4elements.river.client.client.event.RedrawRequestEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
23 import org.dive4elements.river.client.client.event.RedrawRequestEvent.Type;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
24 import org.dive4elements.river.client.client.event.RedrawRequestHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
25 import org.dive4elements.river.client.client.services.CollectionAttributeService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
26 import org.dive4elements.river.client.client.services.CollectionAttributeServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
27 import org.dive4elements.river.client.client.services.CollectionItemAttributeService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
28 import org.dive4elements.river.client.client.services.CollectionItemAttributeServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
29 import org.dive4elements.river.client.shared.model.Collection;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 import org.dive4elements.river.client.shared.model.CollectionItemAttribute;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
31 import org.dive4elements.river.client.shared.model.FacetRecord;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.shared.model.OutputMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.shared.model.Theme;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.shared.model.ThemeList;
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
35
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
36 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
37 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
38 import com.smartgwt.client.util.BooleanCallback;
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.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
40 import com.smartgwt.client.widgets.Canvas;
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
41 import com.smartgwt.client.widgets.grid.ListGrid;
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
42 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
43 import com.smartgwt.client.widgets.grid.events.EditCompleteEvent;
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
44 import com.smartgwt.client.widgets.grid.events.EditCompleteHandler;
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
45 import com.smartgwt.client.widgets.grid.events.RowContextClickEvent;
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
46 import com.smartgwt.client.widgets.grid.events.RowContextClickHandler;
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
47 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
48 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
49 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
50 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
52 /**
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
53 * ThemePanel on the left in CollectionView.
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
54 * Contains control widgets for "themes", which are plotted in
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
55 * a diagram (chart).
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
56 *
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
57 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
58 */
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
59 public abstract class ThemePanel extends Canvas implements OnMoveHandler, EditCompleteHandler, HasOutputParameterChangeHandlers, HasRedrawRequestHandlers {
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
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 private final CollectionAttributeServiceAsync updater = GWT.create(CollectionAttributeService.class);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
63 /** The service used to get collection item attributes. */
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
64 private final CollectionItemAttributeServiceAsync itemAttributeService = GWT.create(CollectionItemAttributeService.class);
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
65
1443
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
66 /** i18ner. */
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
67 protected final FLYSConstants MSG = GWT.create(FLYSConstants.class);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
69 /** List of OutParameterChangedHandler. */
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
70 private final List<OutputParameterChangeHandler> outHandlers;
1443
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
71
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
72 /** List of ChartShallRedrawHandler. */
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
73 protected final List<RedrawRequestHandler> redrawRequestHandlers;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
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 protected final OutputMode mode;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
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
77 protected final ThemeNavigationPanel navigation;
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
78
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
79 protected final ListGrid 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
80
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
81 /** The collection view */
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
82 protected CollectionView view;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
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 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
85
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
86 /**
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
87 * Setup Grid, navigation bar.
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
88 *
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
89 * @param collection
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
90 * Collection for which to show themes.
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
91 */
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
92 public ThemePanel(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
93 this.mode = mode;
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
94 this.recordHandler = 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
95 this.list = createGrid();
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.view = view;
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
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.addRowContextClickHandler(new RowContextClickHandler() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
99 @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
100 public void onRowContextClick(final RowContextClickEvent event) {
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 final ListGridRecord[] records = ThemePanel.this.list.getSelectedRecords();
1358
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
102
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
103 Menu menu = null;
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
104
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
105 if (records == null || records.length == 0) {
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
106 return;
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 } else if (records.length == 1) {
1358
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
108 menu = getSingleContextMenu(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
109 } else if (records.length > 1) {
1358
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
110 menu = getMultiContextMenu(records);
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
111 }
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
112
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
113 if (menu != 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
114 ThemePanel.this.list.setContextMenu(menu);
1358
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
115 menu.showContextMenu();
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
116
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
117 event.cancel();
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
118 }
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
119 }
c437e4f0f7be Moved the context menu handler to constructor to have the menu
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1340
diff changeset
120 });
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
121
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
122 this.redrawRequestHandlers = new ArrayList<RedrawRequestHandler>();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 this.outHandlers = new ArrayList<OutputParameterChangeHandler>();
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
124 this.navigation = new ThemeNavigationPanel();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 this.navigation.addOnMoveHandler(this);
3547
8a16ff3b9a7f Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3532
diff changeset
126
3532
69fdeca46f7a ThemePanel are now resizable (fix for #750)
Christian Lins <christian.lins@intevation.de>
parents: 2987
diff changeset
127 this.setShowResizeBar(true);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 public abstract void activateTheme(Theme theme, boolean active);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133 * Replace the current collection with a new one. <b>NOTE: this operation
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 * triggers updateGrid() which modifies the themes in the grid.</b>
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 *
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
136 * @param collection
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 * The new collection object.
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 */
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
139 protected void setCollection(final Collection collection) {
1555
c057ef91b268 Refactored Collection reference out of Panels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1551
diff changeset
140 // Set collection of view, but do not trigger event shooting.
c057ef91b268 Refactored Collection reference out of Panels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1551
diff changeset
141 this.view.setCollection(collection, true);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 updateGrid();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145
1551
cfe88143ee89 Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1531
diff changeset
146 /** Get Collection. */
cfe88143ee89 Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1531
diff changeset
147 public Collection getCollection() {
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
148 return this.view.getCollection();
1551
cfe88143ee89 Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1531
diff changeset
149 }
cfe88143ee89 Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1531
diff changeset
150
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 * Returns the ThemeList of the current collection and output mode.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 *
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154 * @return the current ThemeList.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155 */
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156 public ThemeList getThemeList() {
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 return getCollection().getThemeList(this.mode.getName());
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159
5794
af2aa716152f Fix issue1254, make GetFeatureInfo work reliably
Andre Heinecke <aheinecke@intevation.de>
parents: 4184
diff changeset
160 public ListGridRecord[] getSelectedRecords() {
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
161 return this.list.getSelectedRecords();
5794
af2aa716152f Fix issue1254, make GetFeatureInfo work reliably
Andre Heinecke <aheinecke@intevation.de>
parents: 4184
diff changeset
162 }
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
163
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165 * Registers a new OutputParameterChangeHandler.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 *
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
167 * @param h
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 * The new handler.
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169 */
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
170 @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
171 public void addOutputParameterChangeHandler(final OutputParameterChangeHandler h) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 if (h != 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
173 this.outHandlers.add(h);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
174 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 /**
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
178 * Registers a RedrawRequestHandler.
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
179 *
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
180 * @param h
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 * The new handler.
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
182 */
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
183 @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
184 public void addRedrawRequestHandler(final RedrawRequestHandler h) {
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
185 if (h != 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
186 this.redrawRequestHandlers.add(h);
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
187 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
188 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
189
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
190 /**
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
191 * Request a redraw of e.g. a Chart.
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
192 */
1379
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1361
diff changeset
193 final public void requestRedraw() {
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
194 for (final RedrawRequestHandler handler : this.redrawRequestHandlers) {
1509
8c911c935b58 Issue 435
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1474
diff changeset
195 handler.onRedrawRequest(new RedrawRequestEvent(Type.DEFAULT));
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
196 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
197 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
198
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
199 /**
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
200 * Called when the attribution of an output changed. It informs the
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
201 * registered handlers about the changes.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
202 */
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
203 protected void fireOutputParameterChanged() {
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
204 final OutputParameterChangeEvent evt = new OutputParameterChangeEvent();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
205
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
206 for (final OutputParameterChangeHandler handler : this.outHandlers) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
207 handler.onOutputParameterChanged(evt);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
208 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
209 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
210
1560
1c47de6ccfb1 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
211 /** Registers the CollectionView associated to this ThemePanel. */
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
212 public void setCollectionView(final CollectionView view) {
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
213 this.view = view;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
214 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
215
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
216 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
217 * This method is used to clear the current theme grid and add new updated
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
218 * data.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
219 */
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
220 protected void updateGrid() {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221 GWT.log("ThemePanel.updateGrid");
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
222
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
223 final ListGridRecord[] selected = this.list.getSelectedRecords();
1361
9d67cd17ab78 Bugfix: #352 Keep grid selection in theme panels alive after themes has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1358
diff changeset
224
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225 clearGrid();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226
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
227 final ThemeList themeList = getThemeList();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
228
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
229 if (themeList == null) {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
230 GWT.log("ERROR: No theme list.");
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
231 return;
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
232 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
233
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
234 final int count = themeList.getThemeCount();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
235
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
236 for (int i = 1; i <= count; i++) {
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
237 final Theme theme = themeList.getThemeAt(i);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
238
1578
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1568
diff changeset
239 if (theme == null) {
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1568
diff changeset
240 continue;
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1568
diff changeset
241 }
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1568
diff changeset
242
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1568
diff changeset
243 if (theme.getFacet().equals("empty.facet")) {
1531
8b4688a2e25d Set the empty facet to invisible.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1509
diff changeset
244 theme.setVisible(0);
8b4688a2e25d Set the empty facet to invisible.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1509
diff changeset
245 }
8b4688a2e25d Set the empty facet to invisible.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1509
diff changeset
246
1578
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1568
diff changeset
247 if (theme.getVisible() == 0) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
248 continue;
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
249 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
250
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
251 final FacetRecord newRecord = createRecord(theme);
1382
78542ff1f562 Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1379
diff changeset
252 addFacetRecord(newRecord);
1361
9d67cd17ab78 Bugfix: #352 Keep grid selection in theme panels alive after themes has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1358
diff changeset
253
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
254 final String newArtifact = theme.getArtifact();
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
255 final String newFacet = theme.getFacet();
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
256 final int newIndex = theme.getIndex();
1361
9d67cd17ab78 Bugfix: #352 Keep grid selection in theme panels alive after themes has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1358
diff changeset
257
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
258 for (final ListGridRecord r : selected) {
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 final FacetRecord sel = (FacetRecord) r;
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 final Theme oldTheme = sel.getTheme();
1361
9d67cd17ab78 Bugfix: #352 Keep grid selection in theme panels alive after themes has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1358
diff changeset
261
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
262 if (oldTheme.getArtifact().equals(newArtifact) && oldTheme.getFacet().equals(newFacet) && oldTheme.getIndex() == newIndex) {
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
263 this.list.selectRecord(newRecord);
1361
9d67cd17ab78 Bugfix: #352 Keep grid selection in theme panels alive after themes has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1358
diff changeset
264 }
9d67cd17ab78 Bugfix: #352 Keep grid selection in theme panels alive after themes has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1358
diff changeset
265 }
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
266 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
267
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
268 updateThemes();
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
269
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
270 fireOutputParameterChanged();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
271 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
273 /** Adds given Record to the list (table). */
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
274 protected void addFacetRecord(final FacetRecord rec) {
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 this.list.addData(rec);
1382
78542ff1f562 Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1379
diff changeset
276 }
78542ff1f562 Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1379
diff changeset
277
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
278 /** Create a FacetRecord that wraps given 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
279 protected final FacetRecord createRecord(final Theme theme) {
1327
8a93fb299e64 #288 Added legend symbols to the MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1310
diff changeset
280 return new FacetRecord(theme);
8a93fb299e64 #288 Added legend symbols to the MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1310
diff changeset
281 }
8a93fb299e64 #288 Added legend symbols to the MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1310
diff changeset
282
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
283 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
284 * This method triggers the CollectionAttributeService. Based on the current
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
285 * collectin settings, the attribute of the collection is modified or not.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
286 * But in every case, we will get a new collection object - which might be
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
287 * the same as the current one.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
288 */
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
289 public void updateCollection() {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
290 final Config config = Config.getInstance();
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
291 final String loc = config.getLocale();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
292
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
293 GWT.log("ThemePanel.updateCollection via RPC now");
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
294
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
295 // Don't forget to enable the panel after the request has finished!
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
296 disable();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
297
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 this.updater.update(getCollection(), loc, new AsyncCallback<Collection>() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
299 @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
300 public void onFailure(final Throwable caught) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
301 GWT.log("Could not update collection attributes.");
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
302 SC.warn(ThemePanel.this.MSG.getString(caught.getMessage()));
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
303
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
304 enable();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
305 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
306
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
307 @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
308 public void onSuccess(final Collection collection) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
309 setCollection(collection);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
311 enable();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
312 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
313 });
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
314 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
315
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
316 /**
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
317 * Create and configure the Grid to display.
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
318 */
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
319 protected ListGrid createGrid() {
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
320 final ListGrid grid = new ListGrid();
2445
1de15a7bfc59 Removed the scrollbar gap in the theme panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2443
diff changeset
321 grid.setLeaveScrollbarGap(false);
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
322
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
323 return grid;
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
324 }
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
325
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
326 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
327 * A method that removes all records from theme grid.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
328 */
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
329 protected void clearGrid() {
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 final ListGridRecord[] records = this.list.getRecords();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
331
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
332 if (records == null || records.length == 0) {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
333 return;
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
334 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
335
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
336 for (final ListGridRecord record : records) {
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
337 this.list.removeData(record);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
338 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
339 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
340
1443
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
341 /** Return 'separator'- menu-item. */
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
342 protected MenuItem 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
343 final MenuItem separator = new MenuItem();
1443
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
344 separator.setIsSeparator(true);
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
345 return separator;
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
346 }
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
347
1443
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
348 /**
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
349 * Get the context menu for a (right mouse button)click on a single item.
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
350 */
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
351 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
352 final Menu menu = new Menu();
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
353
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
354 menu.addItem(createActivateItem(records));
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
355 menu.addItem(createDeactivateItem(records));
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
356 menu.addItem(createRemoveItem(records));
1443
ec0460dbbae2 Added method to create a menuitem separator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
357 menu.addItem(createSeparator());
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
358 menu.addItem(createPropertiesItem(records));
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
359
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
360 return menu;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
361 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
362
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
363 protected Menu getMultiContextMenu(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
364 final Menu menu = new Menu();
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
365
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
366 menu.addItem(createActivateItem(records));
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
367 menu.addItem(createDeactivateItem(records));
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
368 menu.addItem(createRemoveItem(records));
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
369
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
370 return menu;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
371 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
372
1453
e8aec81af22b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1443
diff changeset
373 /** The properties menu item (opens style editor on click). */
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
374 protected MenuItem createPropertiesItem(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
375 final MenuItem properties = new MenuItem(this.MSG.properties());
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
376
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
377 properties.addClickHandler(new ClickHandler() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
378 @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
379 public void onClick(final MenuItemClickEvent evt) {
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
380 GWT.log("clicked properties");
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 for (final ListGridRecord record : records) {
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
382 openStyleEditor((FacetRecord) record);
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
383 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
384 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
385 });
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
386
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
387 return properties;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
388 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
389
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
390 protected MenuItem createActivateItem(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
391 final MenuItem activate = new MenuItem(this.MSG.activateTheme());
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
392
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
393 activate.addClickHandler(new ClickHandler() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
394 @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
395 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
396 for (final ListGridRecord record : records) {
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
397 final FacetRecord facet = (FacetRecord) record;
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
398 activateTheme(facet.getTheme(), true);
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
399 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
400
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
401 updateCollection();
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
402 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
403 });
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
404
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
405 return activate;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
406 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
407
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
408 protected MenuItem createDeactivateItem(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
409 final MenuItem deactivate = new MenuItem(this.MSG.deactivateTheme());
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
410
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
411 deactivate.addClickHandler(new ClickHandler() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
412 @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
413 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
414 for (final ListGridRecord record : records) {
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
415 final FacetRecord facet = (FacetRecord) record;
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
416 activateTheme(facet.getTheme(), false);
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
417 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
418
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
419 updateCollection();
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
420 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
421 });
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
422
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
423 return deactivate;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
424 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
425
2443
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
426 /** Remove given themes (not asking for confirmation). */
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
427 protected void removeThemes(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
428 for (final ListGridRecord record : records) {
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
429 final FacetRecord facet = (FacetRecord) record;
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
430 final Theme theme = facet.getTheme();
2443
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
431 theme.setVisible(0);
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
432 theme.setActive(0);
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
433 updateCollection();
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
434 }
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
435 }
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
436
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
437 /** Create menu item for removing theme(s). Will ask for confirmation. */
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
438 protected MenuItem createRemoveItem(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
439 final MenuItem remove = new MenuItem(this.MSG.removeTheme());
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
440
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
441 remove.addClickHandler(new ClickHandler() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
442 @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
443 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
444 SC.ask(ThemePanel.this.MSG.askThemeRemove(), new BooleanCallback() {
1422
25be27e33b77 #421 Ask the user before removing themes from chart or map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1382
diff changeset
445 @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
446 public void execute(final Boolean value) {
1422
25be27e33b77 #421 Ask the user before removing themes from chart or map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1382
diff changeset
447 if (value) {
2443
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1578
diff changeset
448 removeThemes(records);
1422
25be27e33b77 #421 Ask the user before removing themes from chart or map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1382
diff changeset
449 }
25be27e33b77 #421 Ask the user before removing themes from chart or map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1382
diff changeset
450 }
25be27e33b77 #421 Ask the user before removing themes from chart or map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1382
diff changeset
451 });
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
452 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
453 });
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
454
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
455 return remove;
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
456 }
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
457
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
458 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
459 * This method is called after a cell in the theme grid has been modified.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
460 *
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
461 * @param event
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
462 * The event that stores information about the modified record.
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
463 */
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
464 @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
465 public void onEditComplete(final EditCompleteEvent event) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
466 GWT.log("Edited record.");
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
467
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
468 final int row = event.getRowNum();
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
469 final FacetRecord rec = (FacetRecord) this.list.getRecord(row);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
470
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
471 final Theme theme = rec.getTheme();
1331
aa2313e0f18d #366 Modifications on theme description in theme panels are now persisted to artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1327
diff changeset
472
aa2313e0f18d #366 Modifications on theme description in theme panels are now persisted to artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1327
diff changeset
473 theme.setDescription(rec.getName());
aa2313e0f18d #366 Modifications on theme description in theme panels are now persisted to artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1327
diff changeset
474 activateTheme(theme, rec.getActive());
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
475
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
476 updateCollection();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
477 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
478
1303
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
479 /**
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
480 * This method should be defined in subclasses that wants to listen to this
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
481 * event.
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
482 *
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
483 * @param 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
484 * The theme that is moved.
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
485 * @param oldIdx
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
486 * The index of the theme before it was moved.
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
487 * @param newIdx
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
488 * The index of the theme after it was moved.
1303
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
489 */
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
490 protected void fireThemeMoved(final Theme theme, final int oldIdx, final int newIdx) {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 3547
diff changeset
491 // Do nothing
1303
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
492 }
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
493
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
494 @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
495 public void onMove(final OnMoveEvent event) {
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
496 final int type = event.getType();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
497
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
498 GWT.log("ThemePanel.onMove: " + type);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
499
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
500 final ListGridRecord[] records = this.list.getSelectedRecords();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
501
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
502 if (records == null || records.length == 0) {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
503 GWT.log("ThemePanel.onMove: No records selected.");
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
504 return;
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
505 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
506
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
507 switch (type) {
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
508 case 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
509 moveRecordsTop(records);
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
510 break;
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
511 case 1:
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
512 moveRecordsUp(records);
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
513 break;
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
514 case 2:
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
515 moveRecordsDown(records);
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
516 break;
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
517 case 3:
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
518 moveRecordsBottom(records);
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
519 break;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
520 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
521
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
522 updateCollection();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
523 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
524
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
525 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
526 * Moves the selected grid records (themes) to the top of the grid.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
527 *
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
528 * @param records
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
529 * The selected themes in the list. Null not permitted.
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
530 */
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
531 protected void moveRecordsTop(final ListGridRecord[] records) {
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
532 final ThemeList themeList = getThemeList();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
533
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
534 int idx = 1;
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
535
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
536 for (final ListGridRecord record : records) {
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
537 final Theme theme = ((FacetRecord) record).getTheme();
1303
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
538 fireThemeMoved(theme, theme.getPosition(), idx);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
539 themeList.setThemePosition(theme, idx++);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
540 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
541
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
542 updateGrid();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
543 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
544
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
545 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
546 * Moves the selected grid records (themes) one step up.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
547 *
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
548 * @param records
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
549 * The selected themes in the list. Null not permitted.
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
550 */
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
551 protected void moveRecordsUp(final ListGridRecord[] records) {
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
552 final ThemeList themeList = getThemeList();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
553
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
554 final int[] newPos = new int[records.length];
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
555
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
556 for (int i = 0; i < records.length; 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
557 final Theme theme = ((FacetRecord) records[i]).getTheme();
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
558 newPos[i] = theme.getPosition() - 1;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
559 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
560
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
561 for (int i = 0; i < records.length; 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
562 final Theme theme = ((FacetRecord) records[i]).getTheme();
1303
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
563 fireThemeMoved(theme, theme.getPosition(), newPos[i]);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
564 themeList.setThemePosition(theme, newPos[i]);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
565 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
566
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
567 updateGrid();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
568 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
569
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
570 /**
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
571 * Moves the selected grid records (themes) one step down.
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
572 *
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
573 * @param records
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
574 * The selected themes in the list. Null not permitted.
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
575 */
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
576 protected void moveRecordsDown(final ListGridRecord[] records) {
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
577 final ThemeList themeList = 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
578
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
579 final int[] newPos = new int[records.length];
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
580
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
581 for (int i = records.length - 1; i >= 0; 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
582 final Theme theme = ((FacetRecord) records[i]).getTheme();
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
583 newPos[i] = theme.getPosition() + 1;
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
584 }
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
585
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
586 for (int i = records.length - 1; i >= 0; 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
587 final Theme theme = ((FacetRecord) records[i]).getTheme();
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
588 fireThemeMoved(theme, theme.getPosition(), newPos[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
589 themeList.setThemePosition(theme, newPos[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
590 }
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
591
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
592 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
593 }
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
594
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
595 /**
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
596 * Moves the selected grid records (themes) to the bottom of the grid.
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
597 *
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
598 * @param records
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
599 * The selected themes in the list. Null not permitted.
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
600 */
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
601 protected void moveRecordsBottom(final ListGridRecord[] records) {
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
602 final ThemeList themeList = getThemeList();
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
603
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
604 int idx = themeList.getThemeCount();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
605
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
606 for (int i = records.length - 1; i >= 0; 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
607 final Theme theme = ((FacetRecord) records[i]).getTheme();
1303
84c50f1d939b Added the option for the MapThemePanel to listen to Theme move events.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
608 fireThemeMoved(theme, theme.getPosition(), idx);
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
609 themeList.setThemePosition(theme, idx--);
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
610 }
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
611
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
612 updateGrid();
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
613 }
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
614
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
615 protected void openStyleEditor(final FacetRecord record) {
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
616 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
617 final String locale = config.getLocale();
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
618
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
619 final String artifact = record.getTheme().getArtifact();
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
620
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
621 this.itemAttributeService.getCollectionItemAttribute(this.getCollection(), artifact, locale, new AsyncCallback<CollectionItemAttribute>() {
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
622 @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
623 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
624 SC.warn(ThemePanel.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
625 }
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
626
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
627 @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
628 public void onSuccess(final CollectionItemAttribute cia) {
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
629 GWT.log("Successfully loaded collectionitem attributes.");
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
630 showStyleEditor(cia, record);
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
631 }
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
632 });
1309
a95e82d6bcc1 Refactored the code to create a context menu and a style editor so that it is also available for maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1303
diff changeset
633 }
1336
ceb989d64cd2 Request redraw on style attribute change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1331
diff changeset
634
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
635 protected void showStyleEditor(final CollectionItemAttribute cia, final FacetRecord record) {
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
636 final StyleEditorWindow win = new StyleEditorWindow(getCollection(), cia, record);
1336
ceb989d64cd2 Request redraw on style attribute change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1331
diff changeset
637 win.setThemePanel(this);
1338
c730f0438510 Set window position to page center.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1336
diff changeset
638 win.centerInPage();
1336
ceb989d64cd2 Request redraw on style attribute change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1331
diff changeset
639 win.show();
ceb989d64cd2 Request redraw on style attribute change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1331
diff changeset
640 }
1568
2432973ccced Handle manual points on a per-chart(type) basis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1560
diff changeset
641
2432973ccced Handle manual points on a per-chart(type) basis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1560
diff changeset
642 /** Get OutputMode of this Panel. */
2432973ccced Handle manual points on a per-chart(type) basis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1560
diff changeset
643 public OutputMode getMode() {
2432973ccced Handle manual points on a per-chart(type) basis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1560
diff changeset
644 return this.mode;
2432973ccced Handle manual points on a per-chart(type) basis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1560
diff changeset
645 }
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
646
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
647 public void updateThemes() {
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
648
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
649 final ListGridRecord[] records = this.list.getRecords();
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
650 for (final ListGridRecord record : records) {
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
651 final FacetRecord facetRecord = (FacetRecord) record;
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
652
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
653 this.recordHandler.handle(facetRecord);
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
654 }
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
655
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
656 this.list.markForRedraw();
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
657 }
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
658 }

http://dive4elements.wald.intevation.org