annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartThemePanel.java @ 7712:27578853bf24

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

http://dive4elements.wald.intevation.org