annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 67ae70259011
children 05405292a7ca
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui.chart;
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
12 import com.google.gwt.user.client.rpc.AsyncCallback;
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
13
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
14 import com.smartgwt.client.types.ListGridFieldType;
2939
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
15 import com.smartgwt.client.util.SC;
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.Canvas;
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 import com.smartgwt.client.widgets.form.DynamicForm;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
18 import com.smartgwt.client.widgets.form.fields.SelectItem;
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
19 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent;
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
20 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler;
2939
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
21 import com.smartgwt.client.widgets.grid.ListGrid;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
22 import com.smartgwt.client.widgets.grid.ListGridField;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
23 import com.smartgwt.client.widgets.grid.ListGridRecord;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
24 import com.smartgwt.client.widgets.layout.VLayout;
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
25 import com.smartgwt.client.widgets.menu.Menu;
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
26 import com.smartgwt.client.widgets.menu.MenuItem;
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
27 import com.smartgwt.client.widgets.menu.events.ClickHandler;
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
28 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
29
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
31 import org.dive4elements.river.client.client.services.CrossSectionKMServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.client.services.LoadArtifactService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.client.ui.CollectionView;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
35 import org.dive4elements.river.client.client.widgets.KMSpinner;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.client.widgets.KMSpinnerChangeListener;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.shared.model.Artifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
38 import org.dive4elements.river.client.shared.model.Data;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
39 import org.dive4elements.river.client.shared.model.DefaultArtifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
40 import org.dive4elements.river.client.shared.model.DefaultData;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
41 import org.dive4elements.river.client.shared.model.FacetRecord;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
42 import org.dive4elements.river.client.shared.model.OutputMode;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
43 import org.dive4elements.river.client.shared.model.Theme;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
44 import org.dive4elements.river.client.shared.model.ThemeList;
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45
2939
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
46 import java.util.ArrayList;
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
47 import java.util.Arrays;
2939
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
48 import java.util.HashMap;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
49 import java.util.HashSet;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
50 import java.util.LinkedHashMap;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
51 import java.util.List;
8e6b1df7c3b0 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2937
diff changeset
52 import java.util.Map;
1472
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
53
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
54
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55 /**
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
56 * ThemePanel much like ChartThemePanel, but shows an "Actions" column,
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
57 * needed for interaction in the CrossSection Charts and a selector to
2481
37438d7228b4 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2464
diff changeset
58 * declare which cross section profile is "master" (waterlevels refer to the
37438d7228b4 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2464
diff changeset
59 * chosen kilometer of that cross section profile).
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
60 * Also can show 'area creation' context menus.
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 */
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 public class CrossSectionChartThemePanel
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
63 extends ChartThemePanel
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
64 implements KMSpinnerChangeListener
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
65 {
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
66 /** Artifact Clone/Creation service. */
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
67 protected LoadArtifactServiceAsync loadService =
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
68 GWT.create(LoadArtifactService.class);
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
70 /** Service to query measurement points of cross sections. */
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
71 CrossSectionKMServiceAsync kmService = GWT.create(
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
72 org.dive4elements.river.client.client.services
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
73 .CrossSectionKMService.class);
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
74
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
75 /** UUID of the current "master" cross section. */
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
76 protected String currentCSMasterUUID;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
77
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
78 /** The layout (used for visual active/inactive feedback). */
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
79 protected VLayout layout;
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
80
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
81 /** Data item name for CrossSections selected km. */
1476
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
82 protected static String CS_KM = "cross_section.km";
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
83
6195
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
84 /** Data item name for CrossSections reference ('master') flag. */
1476
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
85 protected static String CS_IS_MASTER = "cross_section.master?";
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
86
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
87 /** List of cross-section themes through which is moved
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
88 * through synchronously. */
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
89 protected HashSet synchronCrossSectionThemes = new HashSet();
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
90
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
91 /** Data for master artifact combobox.*/
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
92 protected LinkedHashMap<String, String> masters;
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
93
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
94 /** Combobox for master artifacts.*/
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
95 protected SelectItem masterCb;
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
96
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
97
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
98 /**
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
99 * Trivial constructor.
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
100 */
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
101 public CrossSectionChartThemePanel(
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
102 OutputMode mode,
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
103 CollectionView view)
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
104 {
1555
c057ef91b268 Refactored Collection reference out of Panels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1533
diff changeset
105 super(mode, view);
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
106 }
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
107
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
108
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
109 /** Create DefaultArtifact. */
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
110 public static DefaultArtifact artifactReference(String uuid) {
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
111 return new DefaultArtifact(uuid, "TODO:hash");
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
112 }
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
113
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
114
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
115 /** Access data of collection item of theme. */
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
116 public static String dataOf(Theme theme, String dataItemName) {
1578
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
117 if (theme != null && theme.getCollectionItem() != null
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
118 && theme.getCollectionItem().getData() != null
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
119 ) {
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
120 return theme.getCollectionItem().getData().get(dataItemName);
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
121 }
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
122
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
123 return null;
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
124 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
125
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
126
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
127 /**
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
128 * Feed an artifact to let it know that it is master wrt cross-sections.
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
129 * @param artifact uuid of an artifact.
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
130 */
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
131 public void feedTellMaster(final String artifact) {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
132 Data[] feedData = DefaultData.createSimpleStringDataArray(
1476
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
133 CS_IS_MASTER, "1");
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
134
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
135 feedService.feed(
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
136 Config.getInstance().getLocale(),
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
137 artifactReference(artifact),
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
138 feedData,
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
139 new AsyncCallback<Artifact>() {
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
140 @Override
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
141 public void onFailure(Throwable caught) {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
142 GWT.log("Could not feed artifact (" + artifact
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
143 + ") with master marker: " + caught.getMessage());
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
144 SC.warn(MSG.getString(caught.getMessage()));
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
145 enable();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
146 }
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
147 @Override
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
148 public void onSuccess(Artifact artifact) {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
149 GWT.log("Successfully injected master mark to " + artifact);
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
150 setCurrentCSMaster(artifact.getUuid());
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
151 requestRedraw();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
152 enable();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
153 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
154 });
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
155 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
156
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
157
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
158 /**
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
159 * Sets currentCSMasterUUID.
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
160 */
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
161 public String findCurrentCSMaster() {
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
162 ThemeList themeList = getThemeList();
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
163 int count = getThemeList().getThemeCount();
1445
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
164 String firstCSUuid = null;
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
165
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
166 for (int i = 1; i <= count; i++) {
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
167 Theme theme = themeList.getThemeAt(i);
1476
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
168 String value = dataOf(theme, CS_IS_MASTER);
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
169
1445
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
170 if (value != null) {
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
171 if (firstCSUuid == null) {
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
172 firstCSUuid = theme.getArtifact();
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
173 }
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
174 if (!value.equals("0")) {
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
175 setCurrentCSMaster(theme.getArtifact());
1472
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
176 GWT.log("found a master: " + currentCSMasterUUID
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
177 + "/" + theme.getDescription());
1445
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
178 return theme.getDescription();
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
179 }
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
180 }
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
181 }
1445
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
182 // There is none selected. Take the first one.
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
183 if (firstCSUuid != null) {
6195
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
184 // TODO better take the one closest to first km!
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
185 // issue1157, query next/prev kms, select the one which is closest.
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
186 setCurrentCSMaster(firstCSUuid);
1445
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
187 feedTellMaster(firstCSUuid);
df7ebcbff984 Bugfixing and feature-adding for cross-sections/areas.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1444
diff changeset
188 }
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
189 return null;
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
190 }
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
191
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
192
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
193 /**
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
194 * Create Layout, add a master selection box beneath.
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
195 */
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
196 @Override
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
197 protected VLayout createLayout() {
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
198 layout = super.createLayout();
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
199
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
200 // Create "set master" combobox.
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
201 masterCb = new SelectItem();
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
202
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
203 masterCb.setTitle(MSG.chart_themepanel_set_master());
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
204 masterCb.setType("comboBox");
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
205 masters = getThemeList().toMapArtifactUUIDDescription("cross_section");
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
206 masterCb.setValueMap(masters);
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
207
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
208 final DynamicForm form = new DynamicForm();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
209 form.setWidth(200);
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
210 form.setFields(masterCb);
2462
d45059aa8507 i18n and moved reference selectbox for cross section master to top.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2453
diff changeset
211 layout.addMember(form, 0);
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
212
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
213 Config config = Config.getInstance();
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
214 final String locale = config.getLocale();
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
215 findCurrentCSMaster();
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
216 masterCb.setValue(getCurrentCSMaster());
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
217
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
218 // Add Change Handler to first unset the old master and then set the
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
219 // new master.
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
220 masterCb.addChangeHandler(new ChangeHandler() {
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
221 @Override
2905
51ed89b754ae FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2544
diff changeset
222 public void onChange(ChangeEvent event) {
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
223 String selectedItem = (String) event.getValue();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
224 final String artifact = selectedItem;
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
225
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
226 disable();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
227
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
228 // Tell current master that he is not master anymore.
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
229 if (getCurrentCSMaster() != null) {
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
230 Data[] feedData = DefaultData.createSimpleStringDataArray(
1476
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
231 CS_IS_MASTER, "0");
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
232 feedService.feed(
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
233 locale,
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
234 artifactReference(getCurrentCSMaster()),
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
235 feedData,
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
236 new AsyncCallback<Artifact>() {
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
237 @Override
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
238 public void onFailure(Throwable caught) {
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
239 GWT.log("Could not un-master artifact ("
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
240 + getCurrentCSMaster() + "): " +
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
241 caught.getMessage());
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
242 SC.warn(MSG.getString(caught.getMessage()));
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
243 enable();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
244 }
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
245 @Override
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
246 public void onSuccess(Artifact oldMaster) {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
247 GWT.log("Successfully un-mastered artifact.");
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
248 feedTellMaster(artifact);
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
249 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
250 });
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
251 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
252 else {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
253 feedTellMaster(artifact);
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
254 }
2905
51ed89b754ae FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2544
diff changeset
255 }
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
256 });
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
257
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
258 return layout;
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
259 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
260
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
261
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
262 /** Disable the UI (becomes gray, inresponsive to user input). */
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
263 @Override
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
264 public void disable() {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
265 this.layout.setDisabled(true);
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
266 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
267
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
268
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
269 /** DisDisable the UI (becomes ungray, responsive to user input). */
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
270 @Override
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
271 public void enable() {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
272 this.layout.setDisabled(false);
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
273 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
274
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
275
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
276 /**
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
277 * Returns a double from the list that has the smallest distance to the
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
278 * given to value. In case of multiple values with the same difference,
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
279 * the last one is taken.
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
280 * @param in possible return values.
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
281 * @param to the value to be as close to as possible.
2934
a5ebe2e2c772 issue457
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2930
diff changeset
282 * @param up if true, prefer numerically higher values in case of two
a5ebe2e2c772 issue457
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2930
diff changeset
283 * values with equal distance to \param to.
8468
67ae70259011 Cross section navigation: behave equally, regardless of whether an input value is below or above the range of possible values.
Tom Gottfried <tom@intevation.de>
parents: 8467
diff changeset
284 * @return value from in that is closest to to, NaN if none.
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
285 */
8467
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
286 public static Double closest(Double[] in, double to, boolean up) {
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
287 if (in == null || in.length == 0) {
8467
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
288 return Double.NaN;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
289 }
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
290 Arrays.sort(in);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
291 GWT.log ("Closest match for " + (up ? "next" : "previous")
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
292 + " value to: " + to + " candidates: " + Arrays.toString(in));
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
293 if (up) {
8468
67ae70259011 Cross section navigation: behave equally, regardless of whether an input value is below or above the range of possible values.
Tom Gottfried <tom@intevation.de>
parents: 8467
diff changeset
294 double max = in[in.length - 1];
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
295 for (int i = 0; i < in.length; i++) {
8468
67ae70259011 Cross section navigation: behave equally, regardless of whether an input value is below or above the range of possible values.
Tom Gottfried <tom@intevation.de>
parents: 8467
diff changeset
296 if (in[i] >= to || in[i] == max) {
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
297 return in[i];
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
298 }
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
299 }
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
300 } else {
8468
67ae70259011 Cross section navigation: behave equally, regardless of whether an input value is below or above the range of possible values.
Tom Gottfried <tom@intevation.de>
parents: 8467
diff changeset
301 double min = in[0];
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
302 for (int i = in.length - 1; i >= 0; i--) {
8468
67ae70259011 Cross section navigation: behave equally, regardless of whether an input value is below or above the range of possible values.
Tom Gottfried <tom@intevation.de>
parents: 8467
diff changeset
303 if (in[i] <= to || in[i] == min) {
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
304 return in[i];
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
305 }
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
306 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
307 }
8465
2772a0fc7400 (issue1767) Fix closet next value selection.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 6535
diff changeset
308 GWT.log("Failed to find closest match");
8467
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
309 return Double.NaN;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
310 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
311
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
312
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
313 /**
6535
8a425ee702e3 CrossSectionChartThemePanel: Corrected doc-string.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6195
diff changeset
314 * Feed artifacts with the km of the crosssection to display.
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
315 * If its the selected master, also feed the collectionmaster.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
316 *
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
317 * @param artifacts List of artifacts to feed.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
318 * @param kmD The km to set.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
319 */
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
320 public void sendFeed(final List<Artifact> artifacts, final double kmD) {
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
321 Config config = Config.getInstance();
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
322 final String locale = config.getLocale();
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
323
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
324 Data[] feedData =
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
325 DefaultData.createSimpleStringDataArray(CS_KM,
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
326 Double.valueOf(kmD).toString());
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
327
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
328 disable();
2518
b3bf9e5ce9e6 i18n for datacage/computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2514
diff changeset
329 // TODO
b3bf9e5ce9e6 i18n for datacage/computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2514
diff changeset
330 // The ones who do not have data for this km should not show line!
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
331 feedService.feedMany(
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
332 locale,
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
333 artifacts,
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
334 feedData,
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
335 new AsyncCallback<List<Artifact>>() {
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
336 @Override
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
337 public void onFailure(Throwable caught) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
338 GWT.log("Could not feed many artifacts "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
339 + caught.getMessage());
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
340 SC.warn(MSG.getString(caught.getMessage()));
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
341 enable();
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
342 }
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
343 @Override
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
344 public void onSuccess(List<Artifact> artifact) {
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
345 GWT.log("Successfully fed many with km");
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
346 requestRedraw();
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
347 enable();
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
348 }
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
349 });
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
350 }
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
351
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
352
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
353 /**
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
354 * Feed a single artifact with the km of the crosssection to display.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
355 * If its the selected master, also feed the collectionmaster.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
356 * @param artUUID The UUID of the artifact to feed.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
357 * @param kmD The km to set.
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
358 */
1472
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
359 public void sendFeed(final String artUUID, final double kmD) {
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
360 Config config = Config.getInstance();
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
361 final String locale = config.getLocale();
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
362
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
363 Data[] feedData =
1476
edf18a9dfd8b Uncommented some code paths to avoid unwanted side effects, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1475
diff changeset
364 DefaultData.createSimpleStringDataArray(CS_KM,
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
365 Double.valueOf(kmD).toString());
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
366
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
367 disable();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
368 feedService.feed(
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
369 locale,
1475
fb2fefe0325f Improvements in CrossSectionChartThemePanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1472
diff changeset
370 artifactReference(artUUID),
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
371 feedData,
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
372 new AsyncCallback<Artifact>() {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
373 @Override
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
374 public void onFailure(Throwable caught) {
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
375 GWT.log("Could not feed artifact " + caught.getMessage());
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
376 SC.warn(MSG.getString(caught.getMessage()));
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
377 enable();
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
378 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
379 @Override
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
380 public void onSuccess(Artifact artifact) {
1472
a2b0b2af529f Tell master-artifact of collection when cross-section-master changed kilometer.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1470
diff changeset
381 GWT.log("Successfully fed with km");
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
382 requestRedraw();
1496
a882297ce63d Changed CrossSection spinner-stepsize, adjusted km- and mastersetting.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1476
diff changeset
383 enable();
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
384 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
385 });
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
386 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
387
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
388
2443
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
389 /** Remove the themes, also from the master (reference) select box. */
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
390 @Override
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
391 protected void removeThemes(final ListGridRecord[] records) {
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
392 // TODO take care of what happens if that was the last
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
393 // cross section and/or the cross section currently selected as master.
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
394 for (ListGridRecord record: records) {
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
395 FacetRecord facet = (FacetRecord) record;
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
396 Theme theme = facet.getTheme();
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
397 masters.remove(theme.getArtifact());
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
398 }
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
399 masterCb.setValueMap(masters);
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
400 super.removeThemes(records);
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
401 }
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
402
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
403
2482
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
404 /**
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
405 * Callback for when a value has been accepted in the km-spinner
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
406 * of a Cross-Section Profile theme.
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
407 * @param item The SpinnerItem which was manipulated.
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
408 * @param enteredKm The double-parsed value that has been entered.
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
409 * @param facetRecord The underlying datastores record.
2934
a5ebe2e2c772 issue457
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2930
diff changeset
410 * @param up If true, numerically higher values are preferred if
a5ebe2e2c772 issue457
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2930
diff changeset
411 * two values in \param in are in the same distance to
a5ebe2e2c772 issue457
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2930
diff changeset
412 * \param to.
2482
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
413 */
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
414 @Override
6195
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
415 public void spinnerValueEntered(KMSpinner spinner,
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
416 final double enteredKm,
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
417 final FacetRecord facetRecord,
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
418 final boolean up
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
419 ) {
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
420 disable();
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
421 Config config = Config.getInstance();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
422 final String locale = config.getLocale();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
423
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
424 Map<Integer, Double> map = new HashMap<Integer,Double>();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
425 int _dbid = -1;
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
426 try {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
427 _dbid = Integer.valueOf(facetRecord.getTheme()
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
428 .getCollectionItem()
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
429 .getData().get("cross_section.dbid"));
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
430 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
431 catch (NumberFormatException nfe) {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
432 GWT.log("Could not extract cross-section db id from data.");
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
433 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
434 final int dbid = _dbid;
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
435
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
436 map.put(dbid, enteredKm);
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
437
2482
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
438 // Query the available cross section measurements.
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
439 kmService.getCrossSectionKMs(locale, map, 2,
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
440 new AsyncCallback<Map<Integer, Double[]>>() {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
441 @Override
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
442 public void onFailure(Throwable caught) {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
443 GWT.log("Could not get single km for "
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
444 + dbid + ": "+ caught.getMessage());
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
445 SC.warn(MSG.getString(caught.getMessage()));
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
446 updateCollection();
1573
0fbbcec35462 Improved spinner-behaviour in cross section km control.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1572
diff changeset
447 //updateGrid();
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
448 enable();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
449 }
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
450
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
451 @Override
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
452 public void onSuccess(Map<Integer, Double[]> obj) {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
453 Double[] kms = obj.get(dbid);
8467
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
454 Double closest =
2934
a5ebe2e2c772 issue457
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2930
diff changeset
455 CrossSectionChartThemePanel.closest(kms, enteredKm, up);
8467
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
456 if (Double.isNaN(closest)) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
457 GWT.log("Failed to find a closest km. "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
458 + "Staying on current km.");
8467
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
459 updateCollection();
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
460 enable();
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
461 return;
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
462 }
5fa1c8be43db (issue1767) Fix lookup of closest value.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8465
diff changeset
463
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
464 GWT.log("Got single km close to "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
465 + enteredKm + " for " + dbid + ", it is "
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
466 + closest);
1574
465f72f68cee Fix strange javascript side effects.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1573
diff changeset
467
465f72f68cee Fix strange javascript side effects.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1573
diff changeset
468 // Do not set value, as it will trigger strange
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
469 // "javascript" bugs. /*item.setValue(closest);*/
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
470 if (synchronCrossSectionThemes.contains (themeHash
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
471 (facetRecord.getTheme()))) {
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
472 // Move all other synchrons
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
473 ThemeList themes = getThemeList();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
474 int nThemes = themes.getThemeCount();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
475 List<Artifact> artifacts = new ArrayList<Artifact>();
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
476 for (int i = 0; i < nThemes; i++) {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
477 final Theme theme = themes.getThemeAt(i+1);
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
478 if (theme.getFacet().equals("cross_section") &&
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
479 theme.getActive() == 1 &&
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
480 synchronCrossSectionThemes.contains(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
481 themeHash(theme))
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
482 ) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
483 artifacts.add(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
484 artifactReference(theme.getArtifact()));
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
485 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
486 }
1574
465f72f68cee Fix strange javascript side effects.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1573
diff changeset
487 sendFeed(artifacts, closest);
1572
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
488 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
489 else {
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
490 sendFeed(facetRecord.getTheme().getArtifact(),
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
491 closest);
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
492 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
493 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
494 });
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
495 }
60f8edc7a6f0 Slightly improved Spinner- behaviour in CrossSectionControl, but regress in other case.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1555
diff changeset
496
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
497
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
498 /**
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
499 * Create and configure the Grid to display.
1438
432180235caf Minor refactoring and fix initial settings when creating ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1436
diff changeset
500 * @return ListGrid with Themes and related controls inside.
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
501 */
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
502 @Override
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
503 protected ListGrid createGrid() {
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
504 final CrossSectionChartThemePanel parent = this;
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
505
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
506 ListGrid list = new ListGrid() {
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
507 @Override
1379
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1378
diff changeset
508 protected Canvas createRecordComponent(
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1378
diff changeset
509 final ListGridRecord record,
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1378
diff changeset
510 Integer colNum)
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1378
diff changeset
511 {
861
65204f30877b Display Action Widget only for cross_section theme/facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 858
diff changeset
512 // Only cross_section Facets display an action widget.
65204f30877b Display Action Widget only for cross_section theme/facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 858
diff changeset
513 final FacetRecord facetRecord = (FacetRecord) record;
65204f30877b Display Action Widget only for cross_section theme/facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 858
diff changeset
514 if (!facetRecord.getTheme().getFacet().equals(
1379
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1378
diff changeset
515 "cross_section"))
546f7f890ffa Cosmetics, refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1378
diff changeset
516 {
861
65204f30877b Display Action Widget only for cross_section theme/facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 858
diff changeset
517 return null;
65204f30877b Display Action Widget only for cross_section theme/facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 858
diff changeset
518 }
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
519
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
520 String fieldName = this.getFieldName(colNum);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
521
6195
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
522 // Place KMSpinner in Grid with currently chosen km value.
888
d6b88f8f88dd Fix issue flys/issue311 (i18n crossection).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 861
diff changeset
523 if (fieldName.equals(GRID_FIELD_ACTIONS)) {
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
524 double currentValue =
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
525 Double.valueOf(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
526 facetRecord.getTheme().getCollectionItem()
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
527 .getData().get(CS_KM));
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
528 KMSpinner kmSpinner = new KMSpinner(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
529 currentValue, facetRecord);
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
530 kmSpinner.addChangeListener(parent);
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
531 return kmSpinner;
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
532 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
533 else {
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
534 return null;
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
535 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
536 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
537 };
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
538 list.setCanResizeFields(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
539 list.setShowRecordComponents(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
540 list.setShowRecordComponentsByCell(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
541 list.setShowAllRecords(true);
1378
ebba8a8618e6 Fix flys/issue306 (CrossSections: Remove table header context menu).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 891
diff changeset
542 list.setShowHeaderContextMenu(false);
2445
1de15a7bfc59 Removed the scrollbar gap in the theme panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2443
diff changeset
543 list.setLeaveScrollbarGap(false);
6195
de614089cc15 Cosmetics, TODO, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
544
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
545 return list;
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
546 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
547
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
548
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
549 /**
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
550 * Initializes the components (columns) of the theme grid.
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
551 */
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
552 @Override
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
553 protected void initGrid() {
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
554 list.setCanEdit(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
555 list.setCanSort(false);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
556 list.setShowRecordComponents(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
557 list.setShowRecordComponentsByCell(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
558 list.setShowHeader(true);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
559 list.setWidth100();
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
560 list.setHeight100();
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
561
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
562 list.addEditCompleteHandler(this);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
563
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
564 ListGridField active = new ListGridField(GRID_FIELD_ACTIVE, " ", 20);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
565 active.setType(ListGridFieldType.BOOLEAN);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
566
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
567 ListGridField name = new ListGridField(
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
568 GRID_FIELD_NAME, MSG.chart_themepanel_header_themes());
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
569 name.setType(ListGridFieldType.TEXT);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
570
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
571 ListGridField actions = new ListGridField(GRID_FIELD_ACTIONS,
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
572 MSG.chart_themepanel_header_actions(), 100);
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
573
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
574 list.setFields(active, name, actions);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
575 }
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
576
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
577
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
578 /** Get Current Cross-section Masters uuid. */
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
579 public String getCurrentCSMaster() {
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
580 return currentCSMasterUUID;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
581 }
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
582
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
583
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
584 /** Set Current Cross-section Masters uuid. */
1470
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
585 public void setCurrentCSMaster(String currentMasterUuid) {
eef55d18f424 Cosmetics, refactoring, renamed Master to CSMaster to avoid confusion.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1458
diff changeset
586 this.currentCSMasterUUID = currentMasterUuid;
1436
29fc2d1dfe9b Client side of interactive cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
587 }
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
588
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
589
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
590 /** Returns name of cross section area facets. */
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
591 @Override
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
592 protected String getAreaFacetName() {
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
593 return "cross_section.area";
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
594 }
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
595
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
596
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
597 /**
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
598 * Return true if two themes are canditates for an area being
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
599 * rendered between them.
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
600 * TODO join with canArea, generalize to allow easier modification
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
601 * in subclasses.
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
602 */
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
603 @Override
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
604 protected boolean areAreaCompatible(Theme a, Theme b) {
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
605 if (a.equals(b)) {
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
606 return false;
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
607 }
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
608 return (a.getFacet().equals("cross_section")
2930
e8eca6eeeec0 Show area menu also for newer manual wsp line facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2905
diff changeset
609 || a.getFacet().endsWith("line"))
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
610 && (b.getFacet().equals("cross_section")
2930
e8eca6eeeec0 Show area menu also for newer manual wsp line facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2905
diff changeset
611 || b.getFacet().endsWith("line"));
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
612 }
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
613
1452
fa63366ba115 Improved area creation GUI.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1449
diff changeset
614
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
615 /**
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
616 * True if context menu should contain 'create area' submenu on
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
617 * this theme.
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
618 */
3717
3b4cef59836a KMSpinner refactoring
Christian Lins <christian.lins@intevation.de>
parents: 2939
diff changeset
619 @Override
1457
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
620 protected boolean canArea(Theme a) {
3d9f81c3f00d Refactored to use existing code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1452
diff changeset
621 return a.getFacet().equals("cross_section")
2930
e8eca6eeeec0 Show area menu also for newer manual wsp line facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2905
diff changeset
622 || a.getFacet().equals("cross_section_water_line")
e8eca6eeeec0 Show area menu also for newer manual wsp line facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2905
diff changeset
623 || a.getFacet().endsWith("line");
1444
bdac8a72f7e6 Area creation UI update.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1438
diff changeset
624 }
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
625
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
626
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
627 protected String themeHash(Theme theme) {
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
628 return theme.getArtifact() + theme.getFacet() + theme.getIndex();
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
629 }
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
630
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
631
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
632 /**
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
633 * Include synchron navigation item.
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
634 */
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
635 @Override
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
636 protected Menu getSingleContextMenu(final ListGridRecord[] records) {
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
637 Menu contextMenu = super.getSingleContextMenu(records);
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
638
2453
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
639 Theme facetTheme = ((FacetRecord)records[0]).getTheme();
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
640 String item = facetTheme.getFacet();
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
641
2482
cef4c624c68c Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2481
diff changeset
642 if (item.equals("cross_section")) {
2453
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
643 // Synchron checking.
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
644 MenuItem synchronNavigationMenuItem = new MenuItem();
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
645 final String themeHash = themeHash(facetTheme);
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
646 if (synchronCrossSectionThemes.contains(themeHash)) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
647 synchronNavigationMenuItem.setTitle(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
648 MSG.chart_themepanel_asynchron());
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
649 synchronNavigationMenuItem.addClickHandler(new ClickHandler() {
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
650 @Override
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
651 public void onClick(MenuItemClickEvent evt) {
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
652 synchronCrossSectionThemes.remove (themeHash);
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
653 }
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
654 });
2453
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
655 }
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
656 else {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
657 synchronNavigationMenuItem.setTitle(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8468
diff changeset
658 MSG.chart_themepanel_synchron());
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
659 synchronNavigationMenuItem.addClickHandler(new ClickHandler() {
4568
bbd82bd8e541 flys-client: Cosmetics and warnings.
Christian Lins <christian.lins@intevation.de>
parents: 3717
diff changeset
660 @Override
2463
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
661 public void onClick(MenuItemClickEvent evt) {
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
662 synchronCrossSectionThemes.add (themeHash);
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
663 }
0eeceffd50e3 Make synchron navigation of CrossSections a per-theme option, not global one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2462
diff changeset
664 });
2453
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
665 }
ec120dc6279b Issue 616.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2445
diff changeset
666 contextMenu.addItem(synchronNavigationMenuItem);
1519
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
667 }
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
668
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
669 return contextMenu;
a6f6c61b18be Implemented synchronous navigation through cross section profiles.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1496
diff changeset
670 }
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
671
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
672
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
673 /**
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
674 * This method is used to clear the current theme grid and add new updated
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
675 * data.
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
676 */
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
677 @Override
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
678 protected void updateGrid() {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
679 GWT.log("CrossSectionChartThemePanel.updateGrid");
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
680
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
681 ListGridRecord[] selected = list.getSelectedRecords();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
682
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
683 clearGrid();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
684
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
685 ThemeList themeList = getThemeList();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
686
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
687 if (themeList == null) {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
688 GWT.log("ERROR: No theme list.");
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
689 return;
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
690 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
691
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
692 int count = themeList.getThemeCount();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
693
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
694 for (int i = 1; i <= count; i++) {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
695 Theme theme = themeList.getThemeAt(i);
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
696
1578
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
697 if (theme == null) {
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
698 continue;
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
699 }
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
700
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
701 if (theme.getFacet().equals("empty.facet")) {
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
702 theme.setVisible(0);
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
703 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
704
1578
df11c4c8c578 Avoid certain npes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1574
diff changeset
705 if (theme.getVisible() == 0) {
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
706 continue;
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
707 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
708
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
709 if (theme.getFacet().equals("cross_section")) {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
710 addToReferences(theme);
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
711 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
712
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
713 FacetRecord newRecord = createRecord(theme);
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
714 addFacetRecord(newRecord);
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
715
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
716 String newArtifact = theme.getArtifact();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
717 String newFacet = theme.getFacet();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
718 int newIndex = theme.getIndex();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
719
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
720 for (ListGridRecord r: selected) {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
721 FacetRecord sel = (FacetRecord) r;
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
722 Theme oldTheme = sel.getTheme();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
723
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
724 if (oldTheme.getArtifact().equals(newArtifact)
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
725 && oldTheme.getFacet().equals(newFacet)
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
726 && oldTheme.getIndex() == newIndex) {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
727 list.selectRecord(newRecord);
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
728 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
729 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
730 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
731
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
732 fireOutputParameterChanged();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
733
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
734 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
735
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
736
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
737 /**
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
738 * Adds a cross section theme to the master artifacts combobox and finds
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
739 * a new master if necessary.
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
740 *
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
741 * @param theme The cross section theme.
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
742 */
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
743 protected void addToReferences(Theme theme) {
2443
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
744 if (theme.getVisible() != 0) {
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
745 masters.put(theme.getArtifact(), theme.getDescription());
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
746 masterCb.setValueMap(masters);
993871f8e2f2 Partial fix flys/issue624 (removing cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1588
diff changeset
747 }
1533
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
748 findCurrentCSMaster();
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
749 if (masterCb.getSelectedRecord() == null) {
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
750 masterCb.setValue(getCurrentCSMaster());
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
751 }
7fcec57c2f2c Add cross sections loaded from datacage to the master artifacts list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1519
diff changeset
752 }
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
753 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
754 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org