annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java @ 804:374712890b94

Facets read from Collection's DESCRIBE document keep all their attributes after the Collection's attribute has been modified. flys-client/trunk@2362 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 19 Jul 2011 16:32:52 +0000
parents 3b02a798d75d
children f43d06d6a4a2
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
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
3 import java.util.ArrayList;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
4 import java.util.List;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
5
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import com.google.gwt.core.client.GWT;
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
7 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
8
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import com.smartgwt.client.types.ListGridFieldType;
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
10 import com.smartgwt.client.util.SC;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.smartgwt.client.widgets.Canvas;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import com.smartgwt.client.widgets.grid.events.EditCompleteEvent;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import com.smartgwt.client.widgets.grid.events.EditCompleteHandler;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import com.smartgwt.client.widgets.grid.ListGrid;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.widgets.grid.ListGridField;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.grid.ListGridRecord;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import com.smartgwt.client.widgets.layout.VLayout;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import de.intevation.flys.client.shared.model.Collection;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import de.intevation.flys.client.shared.model.FacetRecord;
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.OutputMode;
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
22 import de.intevation.flys.client.shared.model.Theme;
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
23 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
24
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
25 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
26 import de.intevation.flys.client.client.FLYSConstants;
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
27 import de.intevation.flys.client.client.event.HasOutputParameterChangeHandlers;
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
28 import de.intevation.flys.client.client.event.OnMoveEvent;
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
29 import de.intevation.flys.client.client.event.OnMoveHandler;
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
30 import de.intevation.flys.client.client.event.OutputParameterChangeEvent;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
31 import de.intevation.flys.client.client.event.OutputParameterChangeHandler;
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
32 import de.intevation.flys.client.client.services.CollectionAttributeService;
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
33 import de.intevation.flys.client.client.services.CollectionAttributeServiceAsync;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 * @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
38 */
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
39 public class ChartThemePanel
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
40 extends Canvas
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
41 implements EditCompleteHandler, OnMoveHandler,
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
42 HasOutputParameterChangeHandlers
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
43 {
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 /** The interface that provides i18n messages. */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 private FLYSConstants MSG = GWT.create(FLYSConstants.class);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46
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
47
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
48 /** The service that is used to modify collection attributes.*/
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
49 protected CollectionAttributeServiceAsync updater =
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
50 GWT.create(CollectionAttributeService.class);
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
51
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
52
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 public static final String GRID_FIELD_ACTIVE = "active";
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public static final String GRID_FIELD_NAME = "name";
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 protected Collection collection;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 protected OutputMode mode;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
61 protected List<OutputParameterChangeHandler> outHandlers;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
62
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 protected ListGrid list;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
65 protected ChartOutputTab chartOut;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
66
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
67 protected ThemeNavigationPanel navigation;
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
68
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
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 public ChartThemePanel(Collection collection, OutputMode mode) {
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
72 this.collection = collection;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
73 this.mode = mode;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
74 this.outHandlers = new ArrayList<OutputParameterChangeHandler>();
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
75 this.chartOut = chartOut;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
76 this.list = new ListGrid();
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
77 this.navigation = new ThemeNavigationPanel();
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
78 this.navigation.addOnMoveHandler(this);
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 initGrid();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 initLayout();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 updateGrid();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 * 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
89 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 protected void initLayout() {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 setWidth100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 setHeight100();
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 VLayout layout = new VLayout();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 layout.setWidth100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 layout.setHeight100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 layout.addMember(list);
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
99 layout.addMember(navigation);
523
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 addChild(layout);
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
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 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 * 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
107 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 protected void initGrid() {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 list.setCanEdit(true);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 list.setCanSort(false);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 list.setShowRecordComponents(false);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 list.setShowRecordComponentsByCell(true);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 list.setShowHeader(true);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 list.setShowHeaderContextMenu(false);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 list.setWidth100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 list.setHeight100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 list.addEditCompleteHandler(this);
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 active = new ListGridField(GRID_FIELD_ACTIVE, " ", 20);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 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
122
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 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
124 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
125 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
126
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 list.setFields(active, name);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 /**
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
132 * Replace the current collection with a new one. <b>NOTE: this operation
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
133 * triggers updateGrid() which modifies the themes in the grid.</b>
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
134 *
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
135 * @param collection The new collection object.
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
136 */
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
137 protected void setCollection(Collection collection) {
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
138 this.collection = collection;
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
139
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
140 updateGrid();
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
141 }
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
142
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
143
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
144 /**
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
145 * Registers a new OutputParameterChangeHandler.
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
146 *
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
147 * @param h The new handler.
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
148 */
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
149 public void addOutputParameterChangeHandler(OutputParameterChangeHandler h){
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
150 if (h != null) {
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
151 outHandlers.add(h);
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
152 }
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
153 }
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
154
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
155
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
156 /**
528
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
157 * Returns the ThemeList of the current collection and output mode.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
158 *
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
159 * @return the current ThemeList.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
160 */
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
161 public ThemeList getThemeList() {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
162 return collection.getThemeList(mode.getName());
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
163 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
164
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
165
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
166 /**
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
167 * A method that removes all records from theme grid.
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169 protected void clearGrid() {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
170 ListGridRecord[] records = list.getRecords();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
171
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 if (records == null || records.length == 0) {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
173 return;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
174 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 for (ListGridRecord record: records) {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 list.removeData(record);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
178 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
179 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
180
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
183 * This method is used to clear the current theme grid and add new updated
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184 * data.
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 protected void updateGrid() {
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
187 GWT.log("ChartThemePanel.updateGrid");
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
188
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
189 clearGrid();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
190
528
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
191 ThemeList themeList = getThemeList();
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
192
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
193 if (themeList == null) {
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
194 GWT.log("ERROR: No theme list.");
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
195 return;
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
196 }
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
197
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
198 int count = themeList.getThemeCount();
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
199
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
200 for (int i = 1; i <= count; i++) {
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
201 Theme theme = themeList.getThemeAt(i);
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
202
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
203 if (theme == null) {
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
204 continue;
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
205 }
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
206
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
207 list.addData(new FacetRecord(theme));
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
208 }
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
209
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
210 fireOutputParameterChanged();
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
211 }
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
212
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
213
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
214 /**
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
215 * Called when the attribution of a chart changed. It informs the registered
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
216 * handlers about the changes.
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
217 */
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
218 protected void fireOutputParameterChanged() {
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
219 OutputParameterChangeEvent evt = new OutputParameterChangeEvent();
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
220
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
221 for (OutputParameterChangeHandler handler: outHandlers) {
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
222 handler.onOutputParameterChanged(evt);
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
223 }
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
227 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
228 * This method is called after a cell in the theme grid has been modified.
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
229 *
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
230 * @param event The event that stores information about the modified record.
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
231 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
232 public void onEditComplete(EditCompleteEvent event) {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
233 GWT.log("Edited record.");
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
234
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
235 int row = event.getRowNum();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
236 FacetRecord rec = (FacetRecord) list.getRecord(row);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
237
529
a1048d310829 Changes in the chart theme panel will now have an effect on the themes stored at the collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 528
diff changeset
238 Theme theme = rec.getTheme();
804
374712890b94 Facets read from Collection's DESCRIBE document keep all their attributes after the Collection's attribute has been modified.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 777
diff changeset
239 theme.setActive(rec.getActive() ? 1 : 0);
529
a1048d310829 Changes in the chart theme panel will now have an effect on the themes stored at the collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 528
diff changeset
240
777
3b02a798d75d #181 Repaired activate/deactivate function in theme list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 531
diff changeset
241 updateCollection();
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
242 }
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
243
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
244
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
245 /**
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
246 * This method triggers the CollectionAttributeService. Based on the current
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
247 * collectin settings, the attribute of the collection is modified or not.
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
248 * But in every case, we will get a new collection object - which might be
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
249 * the same as the current one.
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
250 */
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
251 public void updateCollection() {
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
252 final Config config = Config.getInstance();
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
253 final String url = config.getServerUrl();
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
254 final String loc = config.getLocale();
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
255
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
256 GWT.log("ChartThemePanel.updateCollection via RPC now");
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
257
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
258 // don't forget to enable the panel after the request has finished!
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
259 disable();
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
260
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
261 updater.update(collection, url, loc, new AsyncCallback<Collection>() {
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
262 public void onFailure(Throwable caught) {
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
263 GWT.log("Could not update collection attributes.");
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
264 SC.warn(MSG.getString(caught.getMessage()));
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
265
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
266 enable();
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
267 }
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
268
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
269
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
270 public void onSuccess(Collection collection) {
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
271 setCollection(collection);
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
272
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 529
diff changeset
273 enable();
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
274 }
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
275 });
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
276 }
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
277
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
278
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
279 public void onMove(OnMoveEvent event) {
528
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
280 int type = event.getType();
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
281
528
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
282 GWT.log("ChartThemePanel.onMove: " + type);
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
283
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
284 ListGridRecord[] records = list.getSelection();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
285
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
286 if (records == null || records.length == 0) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
287 GWT.log("ChartThemePanel.onMove: No records selected.");
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
288 return;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
289 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
290
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
291 switch (type) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
292 case 0: moveRecordsTop(records); break;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
293 case 1: moveRecordsUp(records); break;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
294 case 2: moveRecordsDown(records); break;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
295 case 3: moveRecordsBottom(records); break;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
296 }
529
a1048d310829 Changes in the chart theme panel will now have an effect on the themes stored at the collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 528
diff changeset
297
a1048d310829 Changes in the chart theme panel will now have an effect on the themes stored at the collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 528
diff changeset
298 updateCollection();
528
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
299 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
300
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
301
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
302 /**
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
303 * Moves the selected grid records (themes) to the top of the grid.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
304 *
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
305 * @param records The selected themes in the list. Null not permitted.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
306 */
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
307 protected void moveRecordsTop(ListGridRecord[] records) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
308 ThemeList themeList = getThemeList();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
309
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
310 int idx = 1;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
311
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
312 for (ListGridRecord record: records) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
313 Theme theme = ((FacetRecord) record).getTheme();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
314 themeList.setThemePosition(theme, idx++);
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
315 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
316
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
317 updateGrid();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
318 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
319
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
320
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
321 /**
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
322 * Moves the selected grid records (themes) one step up.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
323 *
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
324 * @param records The selected themes in the list. Null not permitted.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
325 */
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
326 protected void moveRecordsUp(ListGridRecord[] records) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
327 ThemeList themeList = getThemeList();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
328
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
329 int[] newPos = new int[records.length];
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
330
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
331 for (int i = 0; i < records.length ; i++) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
332 Theme theme = ((FacetRecord) records[i]).getTheme();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
333 newPos[i] = theme.getPosition() - 1;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
334 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
335
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
336 for (int i = 0; i < records.length ; i++) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
337 Theme theme = ((FacetRecord) records[i]).getTheme();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
338 themeList.setThemePosition(theme, newPos[i]);
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
339 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
340
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
341 updateGrid();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
342 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
343
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
344
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
345 /**
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
346 * Moves the selected grid records (themes) one step down.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
347 *
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
348 * @param records The selected themes in the list. Null not permitted.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
349 */
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
350 protected void moveRecordsDown(ListGridRecord[] records) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
351 ThemeList themeList = getThemeList();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
352
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
353 int[] newPos = new int[records.length];
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
354
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
355 for (int i = records.length-1; i >= 0; i--) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
356 Theme theme = ((FacetRecord) records[i]).getTheme();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
357 newPos[i] = theme.getPosition()+1;
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
358 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
359
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
360 for (int i = records.length-1; i >= 0; i--) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
361 Theme theme = ((FacetRecord) records[i]).getTheme();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
362 themeList.setThemePosition(theme, newPos[i]);
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
363 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
364
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
365 updateGrid();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
366 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
367
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
368
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
369 /**
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
370 * Moves the selected grid records (themes) to the bottom of the grid.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
371 *
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
372 * @param records The selected themes in the list. Null not permitted.
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
373 */
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
374 protected void moveRecordsBottom(ListGridRecord[] records) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
375 ThemeList themeList = getThemeList();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
376
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
377 int idx = themeList.getThemeCount();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
378
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
379 for (int i = records.length-1; i >= 0; i--) {
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
380 Theme theme = ((FacetRecord) records[i]).getTheme();
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
381 themeList.setThemePosition(theme, idx--);
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
382 }
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
383
39d9291513cc Connected the actions in the navigation panel with the theme list in the ChartThemePanel - themes can be moved now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
384 updateGrid();
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
385 }
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
386 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
387 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org