annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java @ 911:4668357b255e

#259 Refresh charts after loading new Themes / Artifacts from Datacage. flys-client/trunk@2768 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 15 Sep 2011 17:01:12 +0000
parents 6b047887855b
children 66192d170c79
rev   line source
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui.chart;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.Date;
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
4 import java.util.HashMap;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
5 import java.util.Map;
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import com.google.gwt.core.client.GWT;
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
8 import com.google.gwt.user.client.rpc.AsyncCallback;
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
10 import com.smartgwt.client.types.Overflow;
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
11
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import com.smartgwt.client.widgets.Canvas;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import com.smartgwt.client.widgets.Img;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.widgets.layout.HLayout;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.layout.VLayout;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import com.smartgwt.client.widgets.events.ResizedEvent;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import com.smartgwt.client.widgets.events.ResizedHandler;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
21 import de.intevation.flys.client.shared.Transform2D;
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
22 import de.intevation.flys.client.shared.model.Axis;
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
23 import de.intevation.flys.client.shared.model.ChartInfo;
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 import de.intevation.flys.client.shared.model.Collection;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 import de.intevation.flys.client.shared.model.OutputMode;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 import de.intevation.flys.client.client.Config;
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
27 import de.intevation.flys.client.client.event.OutputParameterChangeEvent;
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
28 import de.intevation.flys.client.client.event.OutputParameterChangeHandler;
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
29 import de.intevation.flys.client.client.event.PanEvent;
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
30 import de.intevation.flys.client.client.event.PanHandler;
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
31 import de.intevation.flys.client.client.event.RedrawRequestHandler;
911
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
32 import de.intevation.flys.client.client.event.RedrawRequestEvent;
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
33 import de.intevation.flys.client.client.event.RedrawRequestEvent.Type;
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
34 import de.intevation.flys.client.client.event.ZoomEvent;
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
35 import de.intevation.flys.client.client.event.ZoomHandler;
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
36 import de.intevation.flys.client.client.services.ChartInfoService;
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
37 import de.intevation.flys.client.client.services.ChartInfoServiceAsync;
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 import de.intevation.flys.client.client.ui.CollectionView;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 import de.intevation.flys.client.client.ui.OutputTab;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 /**
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 */
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
45 public class ChartOutputTab
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
46 extends OutputTab
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
47 implements ResizedHandler,
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
48 OutputParameterChangeHandler,
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
49 ZoomHandler,
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
50 PanHandler,
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
51 RedrawRequestHandler
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
52 {
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 public static final int DEFAULT_CHART_WIDTH = 600;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public static final int DEFAULT_CHART_HEIGHT = 500;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55
527
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 523
diff changeset
56 public static final int THEMEPANEL_MIN_WIDTH = 200;
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 523
diff changeset
57
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 523
diff changeset
58
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
59 /** The service that is used to fetch chart information. */
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
60 protected ChartInfoServiceAsync info = GWT.create(ChartInfoService.class);
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
61
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
62
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
63 /** The ChartInfo object that provides information about the current
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
64 * chart. */
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
65 protected ChartInfo chartInfo;
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
66
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
67 /** Transformer used to transform image pixels into chart coordinates. */
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
68 protected Transform2D[] transformer;
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
69
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
70 /** The collection view.*/
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
71 protected CollectionView view;
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
72
911
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
73 protected ChartThemePanel ctp;
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
74
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
75
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
76 /** The canvas that wraps the chart toolbar. */
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 protected Canvas tbarPanel;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
79 /** The canvas that wraps the theme editor. */
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 protected Canvas left;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
82 /** The canvas that wraps the chart. */
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 protected Canvas right;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
85 protected Img chart;
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
86
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
855
2c48d75c4ab7 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 779
diff changeset
88 /** Chart zoom options. */
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
89 protected int[] xrange;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
90 protected int[] yrange;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
91
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
92 protected double[] zoom;
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
93
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
94
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 /**
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 * The default constructor to create a new ChartOutputTab.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 *
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 * @param title The title of this tab.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 * @param collection The Collection which this chart belongs to.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 * @param mode The OutputMode.
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
101 * @param collectionView The shown collection.
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 */
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 public ChartOutputTab(
615
ba1b27b7d282 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 612
diff changeset
104 String title,
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 Collection collection,
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 OutputMode mode,
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 CollectionView collectionView
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 ){
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 super(title, collection, mode);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
111 view = collectionView;
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 left = new Canvas();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 right = new Canvas();
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
114 xrange = new int[2];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
115 yrange = new int[2];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
116 zoom = new double[4];
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 left.setBorder("1px solid black");
527
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 523
diff changeset
119 left.setWidth(THEMEPANEL_MIN_WIDTH);
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 523
diff changeset
120 left.setMinWidth(THEMEPANEL_MIN_WIDTH);
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 right.setWidth("*");
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 VLayout vLayout = new VLayout();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 vLayout.setMembersMargin(2);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 HLayout hLayout = new HLayout();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 hLayout.setWidth100();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 hLayout.setHeight100();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 hLayout.setMembersMargin(10);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 hLayout.addMember(left);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 hLayout.addMember(right);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
134 // Output "cross_section" needs slightly modified ThemePanel
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
135 // (with action buttons).
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
136 if (mode.getName().equals("cross_section")) {
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
137 ctp = new CrossSectionChartThemePanel(collection, mode);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
138 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
139 else {
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
140 ctp = new ChartThemePanel(collection, mode);
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
141 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
142
859
6b047887855b Fix broken build.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 858
diff changeset
143 ctp.addRedrawRequestHandler(this);
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
144 ctp.addOutputParameterChangeHandler(this);
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
145
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
146 chart = createChartImg();
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
147 right.addChild(chart);
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
148 right.setOverflow(Overflow.HIDDEN);
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
149 //right.addChild(createChartPanel());
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
150 left.addChild(ctp);
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151
779
f1a559d13eef #185 Repaired zooming for IE8 and Chrome.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
152 tbarPanel = new ChartToolbar(collectionView, this);
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 vLayout.addMember(tbarPanel);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154 vLayout.addMember(hLayout);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156 setPane(vLayout);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 right.addResizedHandler(this);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159 }
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
162 /**
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
163 * This method is called after the chart panel has resized. It removes the
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 * chart - if existing - and requests a new one with adjusted size.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165 *
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 * @param event The resize event.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
167 */
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168 public void onResized(ResizedEvent event) {
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
169 updateChartPanel();
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
170 updateChartInfo();
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
171 }
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
172
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
173
911
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
174 public void onRedrawRequest(RedrawRequestEvent event) {
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
175 if (event.getType() == Type.RESET) {
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
176 resetRanges();
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
177 }
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
178 else {
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
179 ctp.updateCollection();
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
180 updateChartPanel();
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
181 updateChartInfo();
4668357b255e #259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 859
diff changeset
182 }
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
183 }
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
184
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 855
diff changeset
185
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
186 /**
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
187 * Listens to change event in the chart them panel and updates chart after
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
188 * receiving such an event.
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
189 *
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
190 * @param event The OutputParameterChangeEvent.
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
191 */
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
192 public void onOutputParameterChanged(OutputParameterChangeEvent event) {
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
193 updateChartPanel();
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
194 }
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
195
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
196
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
197 /**
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
198 * Listens to zoom events and refreshes the current chart in such case.
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
199 *
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
200 * @param evt The ZoomEvent that stores the coordinates for zooming.
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
201 */
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
202 public void onZoom(ZoomEvent evt) {
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
203 xrange[0] = evt.getStartX();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
204 xrange[1] = evt.getEndX();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
205 yrange[0] = evt.getStartY();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
206 yrange[1] = evt.getEndY();
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
207
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
208 xrange[0] = xrange[0] < xrange[1] ? xrange[0] : xrange[1];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
209 yrange[0] = yrange[0] < yrange[1] ? yrange[0] : yrange[1];
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
210
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
211 translateCoordinates();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
212
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
213 updateChartInfo();
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
214 updateChartPanel();
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
215 }
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
216
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
217
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
218 protected double[] translateCoordinates() {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
219 if (xrange == null || (xrange[0] == 0 && xrange[1] == 0)) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
220 zoom[0] = 0d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
221 zoom[1] = 1d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
222 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
223 else {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
224 translateXCoordinates();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
225 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
226
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
227 if (yrange == null || (yrange[0] == 0 && yrange[1] == 0)) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
228 zoom[2] = 0d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
229 zoom[3] = 1d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
230 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
231 else {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
232 translateYCoordinates();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
233 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
234
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
235 return zoom;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
236 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
237
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
238
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
239 protected void translateXCoordinates() {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
240 Axis xAxis = chartInfo.getXAxis(0);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
241
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
242 double xmin = xAxis.getMin();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
243 double xmax = xAxis.getMax();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
244 double xRange = xmax - xmin;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
245
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
246 Transform2D transformer = getTransformer(0);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
247
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
248 double[] start = transformer.transform(xrange[0], yrange[0]);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
249 double[] end = transformer.transform(xrange[1], yrange[1]);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
250
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
251 zoom[0] = (start[0] - xmin) / xRange;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
252 zoom[1] = (end[0] - xmin) / xRange;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
253 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
254
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
255
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
256 protected void translateYCoordinates() {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
257 Axis yAxis = chartInfo.getYAxis(0);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
258
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
259 double ymin = yAxis.getMin();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
260 double ymax = yAxis.getMax();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
261 double yRange = ymax - ymin;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
262
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
263 Transform2D transformer = getTransformer(0);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
264
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
265 double[] start = transformer.transform(xrange[0], yrange[0]);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
266 double[] end = transformer.transform(xrange[1], yrange[1]);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
267
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
268 zoom[2] = (start[1] - ymin) / yRange;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
269 zoom[3] = (end[1] - ymin) / yRange;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
270 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
271
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
272
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
273 public void onPan(PanEvent event) {
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
274 if (chartInfo == null) {
555
33b86f5b1168 Don't crash if there is no transformer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 552
diff changeset
275 return;
33b86f5b1168 Don't crash if there is no transformer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 552
diff changeset
276 }
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
277
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
278 int[] start = event.getStartPos();
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
279 int[] end = event.getEndPos();
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
280
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
281 Transform2D t = getTransformer();
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
282
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
283 double[] ts = t.transform(start[0], start[1]);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
284 double[] tt = t.transform(end[0], end[1]);
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
285
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
286 double diffX = ts[0] - tt[0];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
287 double diffY = ts[1] - tt[1];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
288
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
289 Axis xAxis = chartInfo.getXAxis(0);
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
290 Axis yAxis = chartInfo.getYAxis(0);
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
291
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
292 double[] x = panAxis(xAxis, diffX);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
293 double[] y = panAxis(yAxis, diffY);
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
294
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
295 zoom[0] = x[0];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
296 zoom[1] = x[1];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
297 zoom[2] = y[0];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
298 zoom[3] = y[1];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
299
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
300 updateChartInfo();
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
301 updateChartPanel();
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
302 }
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
303
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
304
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
305 protected double[] panAxis(Axis axis, double diff) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
306 double min = axis.getFrom();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
307 double max = axis.getTo();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
308
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
309 min += diff;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
310 max += diff;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
311
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
312 return computeZoom(axis, min, max);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
313 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
314
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
315
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 542
diff changeset
316 public void resetRanges() {
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
317 zoom[0] = 0d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
318 zoom[1] = 1d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
319 zoom[2] = 0d;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
320 zoom[3] = 1d;
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 542
diff changeset
321
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
322 updateChartInfo();
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 542
diff changeset
323 updateChartPanel();
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 542
diff changeset
324 }
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 542
diff changeset
325
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 542
diff changeset
326
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
327 /**
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
328 * This method is used to zoom out.
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
329 *
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
330 * @param factor The factor should be between 0-100.
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
331 */
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
332 public void zoomOut(int factor) {
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
333 if (factor < 0 || factor > 100 || chartInfo == null) {
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
334 return;
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
335 }
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
336
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
337 Axis xAxis = chartInfo.getXAxis(0);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
338 Axis yAxis = chartInfo.getYAxis(0);
548
aff225e07720 Repaired broken zoom-out control.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
339
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
340 GWT.log("ZOOM X");
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
341 double[] x = zoomAxis(xAxis, factor);
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
342
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
343 GWT.log("ZOOM Y");
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
344 double[] y = zoomAxis(yAxis, factor);
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
345
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
346 zoom[0] = x[0];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
347 zoom[1] = x[1];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
348 zoom[2] = x[0];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
349 zoom[3] = y[1];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
350
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
351 updateChartInfo();
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
352 updateChartPanel();
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
353 }
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
354
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
355
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
356 public double[] zoomAxis(Axis axis, int factor) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
357 double min = axis.getFrom();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
358 double max = axis.getTo();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
359
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
360 GWT.log("ZOOM CURRENT: " + min + " - " + max);
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
361
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
362 double add = (max - min) / 100 * factor;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
363 add = add < 0 ? (-1) * add : add;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
364
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
365 min -= add;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
366 max += add;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
367
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
368 GWT.log("ZOOM TO: " + min + " - " + max);
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 610
diff changeset
369
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
370 return computeZoom(axis, min, max);
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
371 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
372
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
373
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
374 public static double[] computeZoom(Axis axis, double min, double max) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
375 double[] zoom = new double[2];
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
376
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
377 double absMin = axis.getMin();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
378 double absMax = axis.getMax();
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
379 double diff = absMax > absMin ? absMax - absMin : absMin - absMax;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
380
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
381 zoom[0] = (min - absMin) / diff;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
382 zoom[1] = (max - absMin) / diff;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
383
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
384 return zoom;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
385 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
386
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
387
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
388 /**
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
389 * Updates the Transform2D object using the chart info service.
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
390 */
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
391 public void updateChartInfo() {
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
392 Config config = Config.getInstance();
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
393 String url = config.getServerUrl();
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
394 String locale = config.getLocale();
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
395
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
396 info.getChartInfo(
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
397 view.getCollection(),
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
398 url,
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
399 locale,
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
400 mode.getName(),
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
401 getChartAttributes(),
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
402 new AsyncCallback<ChartInfo>() {
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
403 public void onFailure(Throwable caught) {
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
404 GWT.log("ChartInfo ERROR: " + caught.getMessage());
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
405 }
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
406
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
407 public void onSuccess(ChartInfo chartInfo) {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
408 setChartInfo(chartInfo);
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
409 }
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
410 });
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
411 }
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
412
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
413
531
c17c593f8732 The chart in the ChartOutputTab is refreshed when there occur any changes in the chart theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 527
diff changeset
414 public void updateChartPanel() {
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
415 int w = right.getWidth();
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
416 int h = right.getHeight();
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
417
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
418 chart.setSrc(getImgUrl(w, h));
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
419 }
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
420
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
421
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
422 /**
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
423 * Returns the existing chart panel.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
424 *
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
425 * @return the existing chart panel.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
426 */
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
427 public Canvas getChartPanel() {
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
428 return right;
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
429 }
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
430
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
431
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
432 public Canvas getChartImg() {
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
433 return chart;
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
434 }
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
435
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
436
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
437 public ChartInfo getChartInfo() {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
438 return chartInfo;
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
439 }
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
440
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
441
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
442 protected void setChartInfo(ChartInfo chartInfo) {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
443 this.chartInfo = chartInfo;
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
444 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
445
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
446
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
447 public Transform2D getTransformer() {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
448 if (chartInfo == null) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
449 return null;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
450 }
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
451
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
452 return chartInfo.getTransformer(0);
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
453 }
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
454
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
455
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
456 /**
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
457 * Returns the Transform2D object used to transform image coordinates into
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
458 * chart coordinates.
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
459 *
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
460 * @param pos The index of a specific transformer.
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
461 *
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
462 * @return the Transform2D object.
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
463 */
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
464 public Transform2D getTransformer(int pos) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
465 if (chartInfo == null) {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
466 return null;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
467 }
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
468
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
469 return chartInfo.getTransformer(pos);
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
470 }
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
471
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
472
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
473 /**
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
474 * Creates a new chart panel with default size.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
475 *
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
476 * @return the created chart panel.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
477 */
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
478 protected Img createChartImg() {
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
479 return createChartImg(DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
480 }
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
481
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
482
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
483 /**
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
484 * Creates a new chart panel with specified width and height.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
485 *
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
486 * @param width The width for the chart panel.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
487 * @param height The height for the chart panel.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
488 *
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
489 * @return the created chart panel.
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
490 */
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
491 protected Img createChartImg(int width, int height) {
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
492 Img chart = getChartImg(width, height);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
493 chart.setWidth100();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
494 chart.setHeight100();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
495
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
496 return chart;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
497 }
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
498
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
499
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
500 /**
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
501 * Builds the chart image and returns it.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
502 *
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
503 * @param width The chart width.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
504 * @param height The chart height.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
505 *
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
506 * @return the chart image.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
507 */
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
508 protected Img getChartImg(int width, int height) {
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
509 return new Img(getImgUrl(width, height));
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
510 }
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
511
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
512
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
513 /**
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
514 * Builds the URL that points to the chart image.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
515 *
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
516 * @param width The width of the requested chart.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
517 * @param height The height of the requested chart.
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
518 * @param xr Optional x range (used for zooming).
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
519 * @param yr Optional y range (used for zooming).
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
520 *
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
521 * @return the URL to the chart image.
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
522 */
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
523 protected String getImgUrl(int width, int height) {
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
524 Config config = Config.getInstance();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
525
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
526 String imgUrl = GWT.getModuleBaseURL();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
527 imgUrl += "chart";
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
528 imgUrl += "?uuid=" + collection.identifier();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
529 imgUrl += "&type=" + mode.getName();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
530 imgUrl += "&server=" + config.getServerUrl();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
531 imgUrl += "&locale=" + config.getLocale();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
532 imgUrl += "&timestamp=" + new Date().getTime();
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
533 imgUrl += "&width=" + Integer.toString(width);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
534 imgUrl += "&height=" + Integer.toString(height);
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
535
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
536 double[] zoom = getZoomValues();
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
537
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
538 if (zoom != null) {
612
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
539 if (zoom[0] != 0 || zoom[1] != 1) {
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
540 // a zoom range of 0-1 means displaying the whole range. In such
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
541 // case we don't need to zoom.
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
542 imgUrl += "&minx=" + Double.toString(zoom[0]);
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
543 imgUrl += "&maxx=" + Double.toString(zoom[1]);
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
544 }
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
545 if (zoom[2] != 0 || zoom[3] != 1) {
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
546 // a zoom range of 0-1 means displaying the whole range. In such
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
547 // case we don't need to zoom.
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
548 imgUrl += "&miny=" + Double.toString(zoom[2]);
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
549 imgUrl += "&maxy=" + Double.toString(zoom[3]);
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
550 }
542
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
551 }
7c57149e8715 Append the x and y ranges determined after zooming with the ZoomboxControl to the attribute document used for the chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
552
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
553 return imgUrl;
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
554 }
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
555
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
556
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
557 public Map getChartAttributes() {
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
558 Map<String, String> attr = new HashMap<String, String>();
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
559
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
560 Canvas chart = getChartPanel();
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
561 attr.put("width", chart.getWidth().toString());
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
562 attr.put("height", chart.getHeight().toString());
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
563
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
564 double[] zoom = getZoomValues();
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
565
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
566 if (zoom != null) {
612
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
567 if (zoom[0] != 0 || zoom[1] != 1) {
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
568 // a zoom range of 0-1 means displaying the whole range. In such
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
569 // case we don't need to zoom.
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
570 attr.put("minx", Double.toString(zoom[0]));
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
571 attr.put("maxx", Double.toString(zoom[1]));
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
572 }
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
573 if (zoom[2] != 0 || zoom[3] != 1) {
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
574 // a zoom range of 0-1 means displaying the whole range. In such
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
575 // case we don't need to zoom.
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
576 attr.put("miny", Double.toString(zoom[2]));
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
577 attr.put("maxy", Double.toString(zoom[3]));
e59f2569558e Zoom-to-max-extent will zoom to the initial chart range now (without zoom values given).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
578 }
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
579 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
580
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
581 return attr;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 548
diff changeset
582 }
561
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
583
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
584
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
585 protected double[] getZoomValues() {
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
586 return zoom;
460b8e0f0563 Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 555
diff changeset
587 }
521
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
588 }
fc60822e9c89 Added a new package 'chart' that should be the place where chart relevant classes should be stored. Moved ChartOutputTab into that package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
589 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org