Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java @ 1460:dfe884cc24a4
Allow other.wkms facets to be created areas with.
flys-client/trunk@3495 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 20 Dec 2011 12:09:16 +0000 |
parents | 3d9f81c3f00d |
children | a346db45c830 |
rev | line source |
---|---|
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui.chart; |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
5 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
|
6 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
7 import com.smartgwt.client.types.ListGridFieldType; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
8 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
9 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
|
10 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
|
11 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
|
12 import com.smartgwt.client.widgets.menu.events.ClickHandler; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
13 |
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.widgets.menu.Menu; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
15 import com.smartgwt.client.widgets.menu.MenuItem; |
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.menu.events.MenuItemClickEvent; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
17 |
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.util.SC; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
19 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
20 import de.intevation.flys.client.shared.model.Artifact; |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.client.shared.model.Collection; |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
22 import de.intevation.flys.client.shared.model.Data; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
23 import de.intevation.flys.client.shared.model.DefaultData; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
24 import de.intevation.flys.client.shared.model.DefaultArtifact; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
25 import de.intevation.flys.client.shared.model.FacetRecord; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
26 import de.intevation.flys.client.shared.model.OutputMode; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
27 import de.intevation.flys.client.shared.model.Recommendation; |
524
ba238f917b94
The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
523
diff
changeset
|
28 import de.intevation.flys.client.shared.model.Theme; |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
29 import de.intevation.flys.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
|
30 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
31 import de.intevation.flys.client.client.Config; |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 import de.intevation.flys.client.client.FLYSConstants; |
805
f43d06d6a4a2
Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
804
diff
changeset
|
33 import de.intevation.flys.client.client.ui.ThemePanel; |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
854
67c678903280
Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
805
diff
changeset
|
35 import de.intevation.flys.client.client.services.FeedService; |
67c678903280
Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
805
diff
changeset
|
36 import de.intevation.flys.client.client.services.FeedServiceAsync; |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
38 import de.intevation.flys.client.client.services.LoadArtifactService; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
39 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
40 |
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 |
1286
b643622d77fe
Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
891
diff
changeset
|
56 /** The collection */ |
b643622d77fe
Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
891
diff
changeset
|
57 protected Collection collection; |
b643622d77fe
Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
891
diff
changeset
|
58 |
854
67c678903280
Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
805
diff
changeset
|
59 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
|
60 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
|
61 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
|
62 |
854
67c678903280
Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
805
diff
changeset
|
63 FeedServiceAsync feedService = GWT.create( |
67c678903280
Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
805
diff
changeset
|
64 de.intevation.flys.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
|
65 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
66 |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 public ChartThemePanel(Collection collection, OutputMode mode) { |
805
f43d06d6a4a2
Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
804
diff
changeset
|
68 super(collection, mode); |
1286
b643622d77fe
Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
891
diff
changeset
|
69 this.collection = collection; |
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 |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
78 protected VLayout createLayout() { |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
79 VLayout layout = new VLayout(); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
80 layout.setWidth100(); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
81 layout.setHeight100(); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
82 |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
83 layout.addMember(list); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
84 layout.addMember(navigation); |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
85 |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
86 return layout; |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
87 } |
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
88 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
89 |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 /** |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 * 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
|
92 */ |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 protected void initLayout() { |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 setWidth100(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 setHeight100(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
1430
6bb6d43eeb2d
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1309
diff
changeset
|
97 addChild(createLayout()); |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 } |
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 * 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
|
103 */ |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 protected void initGrid() { |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 list.setCanEdit(true); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 list.setCanSort(false); |
858
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
854
diff
changeset
|
107 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
|
108 list.setShowRecordComponentsByCell(true); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 list.setShowHeader(true); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 list.setShowHeaderContextMenu(false); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 list.setWidth100(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 list.setHeight100(); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 list.addEditCompleteHandler(this); |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
1288
17bff7b27052
Bugfix: #357 Removed header title of selection column.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
116 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
|
117 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
|
118 |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 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
|
120 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
|
121 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
|
122 |
858
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
854
diff
changeset
|
123 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
|
124 } |
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 |
1460
dfe884cc24a4
Allow other.wkms facets to be created areas with.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1457
diff
changeset
|
127 /** 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
|
128 @Override |
f43d06d6a4a2
Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
804
diff
changeset
|
129 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
|
130 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
|
131 } |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
132 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
133 |
1457
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
134 /** Returns name of longitudinal section area facets. */ |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
135 protected String getAreaFacetName() { |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
136 return "longitudinal_section.area"; |
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
137 } |
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 |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
140 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
141 * Tell an area artifact where to get the upper and lower curve from. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
142 * @param over if null, something |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
143 */ |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
144 public void feedTellArea(final String artifact, Theme under, Theme over) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
145 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
146 Data[] feedData; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
147 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
148 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
|
149 feedData = new Data[] { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
150 DefaultData.createSimpleStringData("area.curve_under", |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
151 under.getArtifact() + under.getIndex()), |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
152 DefaultData.createSimpleStringData("area.curve_over", |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
153 over.getArtifact() + over.getIndex()), |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
154 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
|
155 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
|
156 DefaultData.createSimpleStringData("area.facet", |
1457
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
157 getAreaFacetName()) |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
158 }; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
159 GWT.log("Have over and under"); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
160 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
161 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
|
162 feedData = new Data[] { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
163 DefaultData.createSimpleStringData("area.curve_under", |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
164 under.getArtifact() + under.getIndex()), |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
165 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
|
166 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
|
167 DefaultData.createSimpleStringData("area.facet", |
1457
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
168 getAreaFacetName()) |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
169 }; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
170 GWT.log("Have under only"); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
171 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
172 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
|
173 feedData = new Data[] { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
174 DefaultData.createSimpleStringData("area.curve_over", |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
175 over.getArtifact() + over.getIndex()), |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
176 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
|
177 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
|
178 DefaultData.createSimpleStringData("area.facet", |
1457
3d9f81c3f00d
Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1456
diff
changeset
|
179 getAreaFacetName()) |
1456
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
180 }; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
181 GWT.log("Have over only"); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
182 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
183 else { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
184 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
|
185 return; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
186 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
187 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
188 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
189 feedService.feed( |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
190 Config.getInstance().getLocale(), |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
191 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
|
192 feedData, |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
193 new AsyncCallback<Artifact>() { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
194 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
|
195 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
|
196 + ") 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
|
197 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
|
198 enable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
199 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
200 public void onSuccess(Artifact artifact) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
201 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
|
202 requestRedraw(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
203 updateCollection(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
204 updateGrid(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
205 enable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
206 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
207 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
208 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
209 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
210 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
211 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
212 * 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
|
213 * @param under |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
214 * @param over if null, something. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
215 */ |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
216 public void createAreaArtifact( |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
217 final Theme under, |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
218 final Theme over, |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
219 boolean between |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
220 ) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
221 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
|
222 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
|
223 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
224 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
|
225 "area", |
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 null); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
229 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
|
230 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
231 loadService.loadMany( |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
232 this.collection, |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
233 recommendations, |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
234 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
|
235 locale, |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
236 new AsyncCallback<Artifact[]>() { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
237 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
|
238 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
|
239 enable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
240 // TODO SC.warn |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
241 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
242 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
|
243 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
|
244 + artifacts[0].getUuid()); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
245 // Now, feed the artifact with the relevant data. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
246 feedTellArea(artifacts[0].getUuid(), under, over); |
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 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
249 ); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
250 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
251 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
252 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
253 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
254 * 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
|
255 * rendered between them. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
256 * 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
|
257 * in subclasses. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
258 */ |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
259 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
|
260 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
|
261 return false; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
262 } |
1460
dfe884cc24a4
Allow other.wkms facets to be created areas with.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1457
diff
changeset
|
263 if (a.getFacet().equals("longitudinal_section.w") || |
dfe884cc24a4
Allow other.wkms facets to be created areas with.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1457
diff
changeset
|
264 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
|
265 return b.getFacet().equals("longitudinal_section.w") |
dfe884cc24a4
Allow other.wkms facets to be created areas with.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1457
diff
changeset
|
266 || 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
|
267 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
268 else if (a.getFacet().equals("longitudinal_section.q")) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
269 return b.getFacet().equals("longitudinal_section.q"); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
270 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
271 return false; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
272 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
273 |
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 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
276 * 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
|
277 * this theme. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
278 */ |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
279 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
|
280 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
|
281 || a.getFacet().equals("longitudinal_section.w") |
dfe884cc24a4
Allow other.wkms facets to be created areas with.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1457
diff
changeset
|
282 || a.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
|
283 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
284 |
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 /** |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
287 * Include area specific menu items. |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
288 */ |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
289 protected Menu getSingleContextMenu(final ListGridRecord[] records) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
290 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
|
291 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
292 final Theme facetTheme = ((FacetRecord)records[0]).getTheme(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
293 String thisItem = facetTheme.getDescription(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
294 if (!canArea(facetTheme)) { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
295 return menu; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
296 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
297 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
298 menu.addItem(createSeparator()); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
299 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
300 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
|
301 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
|
302 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
303 ThemeList themes = getThemeList(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
304 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
|
305 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
306 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
|
307 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
|
308 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
|
309 final Theme theme = themes.getThemeAt(i+1); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
310 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
|
311 continue; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
312 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
313 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
|
314 underMenu.addItem(againster); |
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 againster.addClickHandler(new ClickHandler() { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
317 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
|
318 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
319 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
|
320 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
321 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
322 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
323 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
324 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
|
325 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
|
326 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
|
327 final Theme theme = themes.getThemeAt(i+1); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
328 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
|
329 continue; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
330 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
331 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
|
332 overMenu.addItem(againster); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
333 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
334 againster.addClickHandler(new ClickHandler() { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
335 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
|
336 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
337 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
|
338 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
339 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
340 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
341 overMenu.addItem(createSeparator()); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
342 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
|
343 againstAxis.addClickHandler(new ClickHandler() { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
344 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
|
345 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
346 createAreaArtifact(facetTheme, null, false); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
347 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
348 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
349 overMenu.addItem(againstAxis); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
350 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
351 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
|
352 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
|
353 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
|
354 final Theme theme = themes.getThemeAt(i+1); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
355 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
|
356 continue; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
357 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
358 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
|
359 betweenMenu.addItem(againster); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
360 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
361 againster.addClickHandler(new ClickHandler() { |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
362 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
|
363 disable(); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
364 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
|
365 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
366 }); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
367 } |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
368 betweenMenu.addItem(createSeparator()); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
369 betweenMenu.addItem(againstAxis); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
370 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
371 overMenuItem.setSubmenu(overMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
372 underMenuItem.setSubmenu(underMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
373 betweenMenuItem.setSubmenu(betweenMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
374 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
375 areaMenu.addItem(overMenuItem); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
376 areaMenu.addItem(underMenuItem); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
377 areaMenu.addItem(betweenMenuItem); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
378 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
379 areaMenuItem.setSubmenu(areaMenu); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
380 menu.addItem(areaMenuItem); |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
381 |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
382 return menu; |
1c2cd46d526d
Have 'area' context menu in Longitudinal-Section diagrams themepanels, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1430
diff
changeset
|
383 } |
523
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
384 } |
0785a8ba5e6d
Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
385 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |