Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java @ 3532:69fdeca46f7a
ThemePanel are now resizable (fix for #750)
flys-client/trunk@5337 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 31 Aug 2012 20:29:08 +0000 |
parents | b6575b8c8db0 |
children | ebf47e4adea5 |
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 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
|
4 import com.google.gwt.user.client.rpc.AsyncCallback; |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
5 import com.smartgwt.client.types.Overflow; |
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 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
|
7 import com.smartgwt.client.widgets.Img; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
8 import com.smartgwt.client.widgets.events.ResizedEvent; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
9 import com.smartgwt.client.widgets.events.ResizedHandler; |
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
|
10 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
|
11 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
|
12 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
13 import de.intevation.flys.client.client.Config; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
14 import de.intevation.flys.client.client.event.OutputParameterChangeEvent; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
15 import de.intevation.flys.client.client.event.OutputParameterChangeHandler; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
16 import de.intevation.flys.client.client.event.PanEvent; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
17 import de.intevation.flys.client.client.event.PanHandler; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
18 import de.intevation.flys.client.client.event.RedrawRequestEvent; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
19 import de.intevation.flys.client.client.event.RedrawRequestEvent.Type; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
20 import de.intevation.flys.client.client.event.RedrawRequestHandler; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
21 import de.intevation.flys.client.client.event.ZoomEvent; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
22 import de.intevation.flys.client.client.event.ZoomHandler; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
23 import de.intevation.flys.client.client.services.ChartInfoService; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
24 import de.intevation.flys.client.client.services.ChartInfoServiceAsync; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
25 import de.intevation.flys.client.client.ui.CollectionView; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
26 import de.intevation.flys.client.client.ui.OutputTab; |
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
|
27 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
|
28 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
|
29 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
|
30 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
|
31 import de.intevation.flys.client.shared.model.OutputMode; |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
32 import de.intevation.flys.client.shared.model.ZoomObj; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
33 |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
34 import java.util.Date; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
35 import java.util.HashMap; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
36 import java.util.Map; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
37 import java.util.Stack; |
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 |
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 |
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 /** |
1545
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
41 * Tab representing and showing one Chart-output. |
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
42 * |
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
|
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 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
58 /** 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
|
59 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
|
60 |
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
|
61 /** The ChartInfo object that provides information about the current |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
62 * 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
|
63 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
|
64 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
65 /** 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
|
66 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
|
67 |
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
|
68 /** 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
|
69 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
|
70 |
1579
637481aeae43
javadoc
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
71 /** The ThemePanel to expose control over themes (facettes). */ |
911
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
72 protected ChartThemePanel ctp; |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
73 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
74 /** The canvas that wraps the chart toolbar. */ |
2936
a805118fffa6
Fixed zooming in navigatable charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2542
diff
changeset
|
75 protected ChartToolbar tbarPanel; |
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
|
76 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
77 /** 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
|
78 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
|
79 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
80 /** 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
|
81 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
|
82 |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
83 protected Img chart; |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
84 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
779
diff
changeset
|
85 /** 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
|
86 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
|
87 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
|
88 |
1579
637481aeae43
javadoc
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1555
diff
changeset
|
89 /** Stack of ZoomObj to allow 'redo last zoom'-kind of actions. */ |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
90 protected Stack<ZoomObj> zoomStack; |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
91 protected Number[] 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
|
92 |
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 |
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
|
94 /** |
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 * 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
|
96 * |
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 * @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
|
98 * @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
|
99 * @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
|
100 * @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
|
101 */ |
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 public ChartOutputTab( |
615
ba1b27b7d282
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
612
diff
changeset
|
103 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
|
104 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
|
105 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
|
106 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
|
107 ){ |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1344
diff
changeset
|
108 super(title, collection, collectionView, mode); |
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
|
109 |
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
|
110 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
|
111 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
|
112 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
|
113 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
|
114 yrange = new int[2]; |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
115 zoomStack = new Stack<ZoomObj>(); |
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
|
116 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
117 zoom = new Number[] { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
118 new Integer(0), new Integer(1), |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
119 new Integer(0), new Integer(1) }; |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
120 |
3532
69fdeca46f7a
ThemePanel are now resizable (fix for #750)
Christian Lins <christian.lins@intevation.de>
parents:
3371
diff
changeset
|
121 left.setBorder("1px solid gray"); |
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
|
122 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
|
123 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
|
124 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
|
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 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
|
127 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
|
128 |
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 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
|
130 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
|
131 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
|
132 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
|
133 |
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
|
134 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
|
135 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
|
136 |
3370
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
137 ctp = createThemePanel(mode, collectionView); |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
138 if (ctp != null) { |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
139 ctp.addRedrawRequestHandler(this); |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
140 ctp.addOutputParameterChangeHandler(this); |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
141 left.addChild(ctp); |
858
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
142 } |
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
143 else { |
3370
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
144 left.setVisible(false); |
858
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
145 } |
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
146 |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
147 chart = createChartImg(); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
148 right.addChild(chart); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
149 right.setOverflow(Overflow.HIDDEN); |
3532
69fdeca46f7a
ThemePanel are now resizable (fix for #750)
Christian Lins <christian.lins@intevation.de>
parents:
3371
diff
changeset
|
150 |
69fdeca46f7a
ThemePanel are now resizable (fix for #750)
Christian Lins <christian.lins@intevation.de>
parents:
3371
diff
changeset
|
151 left.setShowResizeBar(true); |
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
|
152 |
3370
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
153 tbarPanel = createChartToolbar(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
|
154 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
|
155 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
|
156 |
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 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
|
158 |
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 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
|
160 } |
3371
b6575b8c8db0
Removed superfluous imports and trailinh whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3370
diff
changeset
|
161 |
b6575b8c8db0
Removed superfluous imports and trailinh whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3370
diff
changeset
|
162 |
3370
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
163 public ChartThemePanel createThemePanel( |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
164 OutputMode mode, CollectionView view |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
165 ) { |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
166 // Output "cross_section" needs slightly modified ThemePanel |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
167 // (with action buttons). |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
168 if (mode.getName().equals("cross_section")) { |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
169 return new CrossSectionChartThemePanel(mode, view); |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
170 } |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
171 else { |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
172 return new ChartThemePanel(mode, view); |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
173 } |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
174 } |
3371
b6575b8c8db0
Removed superfluous imports and trailinh whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3370
diff
changeset
|
175 |
b6575b8c8db0
Removed superfluous imports and trailinh whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3370
diff
changeset
|
176 |
3370
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
177 public ChartToolbar createChartToolbar(ChartOutputTab tab) { |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
178 return new ChartToolbar(tab); |
08b2472111aa
New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3347
diff
changeset
|
179 } |
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
|
180 |
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
|
181 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
182 public void toggleThemePanel() { |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
183 this.left.setVisible(!left.isVisible()); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
184 } |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
185 |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
186 |
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
|
187 /** |
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
|
188 * 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
|
189 * 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
|
190 * |
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
|
191 * @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
|
192 */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
193 @Override |
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
|
194 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
|
195 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
|
196 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
|
197 } |
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
|
198 |
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
|
199 |
1550
9bf1ffd53dfb
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1545
diff
changeset
|
200 /** For RESET type of events, just reset the ranges, otherwise do a |
9bf1ffd53dfb
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1545
diff
changeset
|
201 * complete refresh of panel, info and collection. */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
202 @Override |
911
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
203 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
|
204 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
|
205 resetRanges(); |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
206 } |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
207 else { |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
208 ctp.updateCollection(); |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
209 updateChartPanel(); |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
210 updateChartInfo(); |
4668357b255e
#259 Refresh charts after loading new Themes / Artifacts from Datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
859
diff
changeset
|
211 } |
858
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
212 } |
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
213 |
9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
855
diff
changeset
|
214 |
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
|
215 /** |
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
|
216 * 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
|
217 * 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
|
218 * |
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
|
219 * @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
|
220 */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
221 @Override |
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
|
222 public void onOutputParameterChanged(OutputParameterChangeEvent event) { |
2477
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
223 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
|
224 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
|
225 } |
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
|
226 |
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
|
227 |
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
|
228 /** |
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
|
229 * 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
|
230 * |
ed29599e06e5
Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
538
diff
changeset
|
231 * @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
|
232 */ |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
233 @Override |
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
|
234 public void onZoom(ZoomEvent evt) { |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
235 zoomStack.push(new ZoomObj(zoom[0], zoom[1], zoom[2], zoom[3])); |
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
236 |
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
|
237 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
|
238 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
|
239 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
|
240 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
|
241 |
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
|
242 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
|
243 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
|
244 |
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
|
245 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
|
246 |
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 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
|
248 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
|
249 } |
ed29599e06e5
Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
538
diff
changeset
|
250 |
ed29599e06e5
Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
538
diff
changeset
|
251 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
252 protected Number[] translateCoordinates() { |
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
|
253 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
|
254 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
|
255 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
|
256 } |
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 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
|
258 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
|
259 } |
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 |
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 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
|
262 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
|
263 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
|
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 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
|
266 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
|
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 |
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 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
|
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 |
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
|
273 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
|
274 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
|
275 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
276 Number xmin = xAxis.getMin(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
277 Number xmax = xAxis.getMax(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
278 Number xRange = subtract(xmax, xmin); |
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
|
279 |
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
|
280 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
|
281 |
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
|
282 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
|
283 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
|
284 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
285 zoom[0] = divide(subtract(start[0], xmin), xRange); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
286 zoom[1] = divide(subtract(end[0], xmin), xRange); |
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
|
287 } |
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 |
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
|
289 |
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
|
290 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
|
291 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
|
292 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
293 Number ymin = yAxis.getMin(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
294 Number ymax = yAxis.getMax(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
295 Number yRange = subtract(ymax, ymin); |
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
|
296 |
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 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
|
298 |
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 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
|
300 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
|
301 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
302 zoom[2] = divide(subtract(start[1], ymin), yRange); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
303 zoom[3] = divide(subtract(end[1], ymin), yRange); |
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
|
304 } |
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 |
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 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
307 @Override |
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
|
308 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
|
309 if (chartInfo == null) { |
555
33b86f5b1168
Don't crash if there is no transformer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
552
diff
changeset
|
310 return; |
33b86f5b1168
Don't crash if there is no transformer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
552
diff
changeset
|
311 } |
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
|
312 |
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
|
313 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
|
314 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
|
315 |
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
|
316 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
|
317 |
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
|
318 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
|
319 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
|
320 |
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
|
321 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
|
322 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
|
323 |
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
|
324 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
|
325 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
|
326 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
327 Number[] x = panAxis(xAxis, diffX); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
328 Number[] 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
|
329 |
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
|
330 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
|
331 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
|
332 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
|
333 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
|
334 |
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
|
335 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
|
336 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
|
337 } |
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
|
338 |
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
|
339 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
340 protected Number[] panAxis(Axis axis, double diff) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
341 Number min = axis.getFrom(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
342 Number max = axis.getTo(); |
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
|
343 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
344 min = add(min, diff); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
345 max = add(max, diff); |
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 |
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 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
|
348 } |
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 |
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 |
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
|
351 public void resetRanges() { |
1281
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
352 zoomStack.push(new ZoomObj(zoom[0], zoom[1], zoom[2], zoom[3])); |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
353 |
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
|
354 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
|
355 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
|
356 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
|
357 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
|
358 |
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
|
359 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
|
360 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
|
361 } |
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
|
362 |
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
|
363 |
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
|
364 /** |
1281
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
365 * This method zooms the current chart out by a given <i>factor</i>. |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
366 * |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
367 * @param factor The factor should be between 0-100. |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
368 */ |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
369 public void zoomOut(int factor) { |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
370 if (factor < 0 || factor > 100 || chartInfo == null) { |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
371 return; |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
372 } |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
373 |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
374 zoomStack.push(new ZoomObj(zoom[0], zoom[1], zoom[2], zoom[3])); |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
375 |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
376 Axis xAxis = chartInfo.getXAxis(0); |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
377 Axis yAxis = chartInfo.getYAxis(0); |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
378 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
379 Number[] x = zoomAxis(xAxis, factor); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
380 Number[] y = zoomAxis(yAxis, factor); |
1281
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
381 |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
382 zoom[0] = x[0]; |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
383 zoom[1] = x[1]; |
1282
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
384 zoom[2] = y[0]; |
1281
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
385 zoom[3] = y[1]; |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
386 |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
387 updateChartInfo(); |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
388 updateChartPanel(); |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
389 } |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
390 |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
391 |
4782c0ce9cec
Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1280
diff
changeset
|
392 /** |
2542
c48e3df12c4a
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2477
diff
changeset
|
393 * This method is used to zoom out. Zooming out is realized with a stacked |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
394 * logic. Initially, you cannot zoom out. For each time you start a zoom-in |
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
395 * action, the extent of the chart is stored and pushed onto a stack. A |
2542
c48e3df12c4a
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2477
diff
changeset
|
396 * zoom-out will now lead you to the last extent that is popped from stack. |
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
|
397 */ |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
398 public void zoomOut() { |
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
399 if (!zoomStack.empty()) { |
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
400 zoom = zoomStack.pop().getZoom(); |
548
aff225e07720
Repaired broken zoom-out control.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
544
diff
changeset
|
401 |
1280
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
402 updateChartInfo(); |
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
403 updateChartPanel(); |
66192d170c79
Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
911
diff
changeset
|
404 } |
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
|
405 } |
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
|
406 |
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
|
407 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
408 public Number[] zoomAxis(Axis axis, int factor) { |
1282
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
409 GWT.log("Prepare Axis for zooming (factor: " + 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
|
410 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
411 Number min = axis.getMin(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
412 Number max = axis.getMax(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
413 Number range = isBigger(max, min) ? subtract(max, min) : subtract(min, max); |
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
|
414 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
415 Number curFrom = axis.getFrom(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
416 Number curTo = axis.getTo(); |
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
|
417 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
418 Number diff = isBigger(curTo, curFrom) |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
419 ? subtract(curTo, curFrom) |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
420 : subtract(curFrom, curTo); |
1282
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
421 |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
422 GWT.log(" max from : " + min); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
423 GWT.log(" max to : " + max); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
424 GWT.log(" max range : " + range); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
425 GWT.log(" current from: " + curFrom); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
426 GWT.log(" current to : " + curTo); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
427 GWT.log(" current diff: " + diff); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
428 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
429 Number newFrom = subtract(curFrom, divide(multi(diff, factor), 100)); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
430 Number newTo = add(curTo, divide(multi(diff, factor), 100)); |
1282
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
431 |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
432 GWT.log(" new from: " + newFrom); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
433 GWT.log(" new to : " + newTo); |
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
434 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
435 return new Number[] { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
436 divide(subtract(newFrom, min), range), |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
437 divide(subtract(newTo, min), range) |
1282
3904519ec161
Bugfix: #179 Repaired broken zoom-out-by-factor function for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1281
diff
changeset
|
438 }; |
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
|
439 } |
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
|
440 |
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
|
441 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
442 public static Number[] computeZoom(Axis axis, Number min, Number max) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
443 Number[] zoom = new Number[2]; |
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 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
445 Number absMin = axis.getMin(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
446 Number absMax = axis.getMax(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
447 Number diff = isBigger(absMax, absMin) |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
448 ? subtract(absMax, absMin) |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
449 : subtract(absMin, absMax); |
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
|
450 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
451 zoom[0] = divide(subtract(min, absMin), diff); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
452 zoom[1] = divide(subtract(max, absMin), diff); |
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
|
453 |
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
|
454 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
|
455 } |
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
|
456 |
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
|
457 |
1551
cfe88143ee89
Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1550
diff
changeset
|
458 /** Get Collection from ChartThemePanel. .*/ |
cfe88143ee89
Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1550
diff
changeset
|
459 public Collection getCtpCollection() { |
cfe88143ee89
Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1550
diff
changeset
|
460 return this.ctp.getCollection(); |
cfe88143ee89
Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1550
diff
changeset
|
461 } |
cfe88143ee89
Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1550
diff
changeset
|
462 |
cfe88143ee89
Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1550
diff
changeset
|
463 |
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
|
464 /** |
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
|
465 * 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
|
466 */ |
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
|
467 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
|
468 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
|
469 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
|
470 |
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
|
471 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
|
472 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
|
473 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
|
474 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
|
475 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
|
476 new AsyncCallback<ChartInfo>() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
477 @Override |
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
|
478 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
|
479 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
|
480 } |
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
|
481 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2936
diff
changeset
|
482 @Override |
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
|
483 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
|
484 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
|
485 } |
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
|
486 }); |
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
|
487 } |
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
|
488 |
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
|
489 |
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
|
490 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
|
491 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
|
492 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
|
493 |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
494 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
|
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 |
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 |
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
|
498 /** |
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
|
499 * 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
|
500 * |
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
|
501 * @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
|
502 */ |
534
e08777967bad
Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
533
diff
changeset
|
503 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
|
504 return right; |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
505 } |
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
|
506 |
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
|
507 |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
508 public Canvas getChartImg() { |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
509 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
|
510 } |
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
|
511 |
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
|
512 |
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
|
513 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
|
514 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
|
515 } |
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
|
516 |
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
|
517 |
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
|
518 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
|
519 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
|
520 } |
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
|
521 |
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
|
522 |
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
|
523 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
|
524 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
|
525 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
|
526 } |
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
|
527 |
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
|
528 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
|
529 } |
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
|
530 |
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
|
531 |
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
|
532 /** |
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
|
533 * 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
|
534 * 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
|
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 * @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
|
537 * |
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
|
538 * @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
|
539 */ |
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
|
540 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
|
541 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
|
542 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
|
543 } |
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
|
544 |
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
|
545 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
|
546 } |
e08777967bad
Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
533
diff
changeset
|
547 |
e08777967bad
Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
533
diff
changeset
|
548 |
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
|
549 /** |
2542
c48e3df12c4a
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2477
diff
changeset
|
550 * Returns the Transform2D count. |
2477
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
551 * |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
552 * @return the Transformer2D count |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
553 */ |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
554 public int getTransformerCount() { |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
555 if (chartInfo == null) { |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
556 return 0; |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
557 } |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
558 |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
559 return chartInfo.getTransformerCount(); |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
560 } |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
561 |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
562 |
936e3e6cd9b9
Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2430
diff
changeset
|
563 /** |
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
|
564 * 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
|
565 * |
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
|
566 * @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
|
567 */ |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
568 protected Img createChartImg() { |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
569 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
|
570 } |
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
|
571 |
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
|
572 |
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
|
573 /** |
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
|
574 * 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
|
575 * |
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
|
576 * @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
|
577 * @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
|
578 * |
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
|
579 * @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
|
580 */ |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
581 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
|
582 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
|
583 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
|
584 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
|
585 |
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
|
586 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
|
587 } |
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 |
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
|
590 /** |
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
|
591 * 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
|
592 * |
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
|
593 * @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
|
594 * @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
|
595 * |
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
|
596 * @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
|
597 */ |
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
|
598 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
|
599 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
|
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
|
601 |
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
|
602 |
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
|
603 /** |
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
|
604 * 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
|
605 * |
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
|
606 * @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
|
607 * @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
|
608 * @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
|
609 * @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
|
610 * |
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
|
611 * @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
|
612 */ |
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
|
613 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
|
614 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
|
615 |
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
|
616 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
|
617 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
|
618 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
|
619 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
|
620 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
|
621 imgUrl += "×tamp=" + 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
|
622 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
|
623 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
|
624 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
625 Number[] 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
|
626 |
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
|
627 if (zoom != null) { |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
628 if (zoom[0].intValue() != 0 || zoom[1].intValue() != 1) { |
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
|
629 // 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
|
630 // case we don't need to zoom. |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
631 imgUrl += "&minx=" + zoom[0]; |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
632 imgUrl += "&maxx=" + zoom[1]; |
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
|
633 } |
2430
ea6065c2dabe
Removed server url from chart image link.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1597
diff
changeset
|
634 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
635 if (zoom[2].intValue() != 0 || zoom[3].intValue() != 1) { |
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
|
636 // 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
|
637 // case we don't need to zoom. |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
638 imgUrl += "&miny=" + zoom[2]; |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
639 imgUrl += "&maxy=" + zoom[3]; |
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
|
640 } |
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
|
641 } |
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
|
642 |
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
|
643 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
|
644 } |
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
|
645 |
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
|
646 |
2542
c48e3df12c4a
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2477
diff
changeset
|
647 /** Get link to export image in given dimension and format. */ |
1344
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
648 public String getExportUrl(int width, int height, String format) { |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
649 String url = getImgUrl(width, height); |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
650 url += "&format=" + format; |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
651 url += "&export=true"; |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
652 |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
653 return url; |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
654 } |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
655 |
51d4b51a51ed
Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1287
diff
changeset
|
656 |
2936
a805118fffa6
Fixed zooming in navigatable charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2542
diff
changeset
|
657 public Map <String, String> getChartAttributes() { |
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
|
658 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
|
659 |
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
|
660 Canvas chart = getChartPanel(); |
1453
e8aec81af22b
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1425
diff
changeset
|
661 attr.put("width", chart.getWidth().toString()); |
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
|
662 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
|
663 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
664 Number[] 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
|
665 |
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
|
666 if (zoom != null) { |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
667 if (zoom[0].intValue() != 0 || zoom[1].intValue() != 1) { |
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
|
668 // 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
|
669 // case we don't need to zoom. |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
670 attr.put("minx", zoom[0].toString()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
671 attr.put("maxx", zoom[1].toString()); |
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
|
672 } |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
673 if (zoom[2].intValue() != 0 || zoom[3].intValue() != 1) { |
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
|
674 // 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
|
675 // case we don't need to zoom. |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
676 attr.put("miny", zoom[2].toString()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
677 attr.put("maxy", zoom[3].toString()); |
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
|
678 } |
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
|
679 } |
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
|
680 |
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
|
681 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
|
682 } |
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
|
683 |
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
|
684 |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
685 protected Number[] getZoomValues() { |
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
|
686 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
|
687 } |
1545
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
688 |
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
689 |
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
690 /** Return the 'parent' CollectionView. */ |
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
691 public CollectionView getView() { |
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
692 return this.view; |
2f0150f21e77
Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1474
diff
changeset
|
693 } |
1597
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
694 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
695 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
696 public static Number subtract(Number left, Number right) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
697 if (left instanceof Double) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
698 return new Double(left.doubleValue() - right.doubleValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
699 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
700 else if (left instanceof Long) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
701 return new Long(left.longValue() - right.longValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
702 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
703 else { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
704 return new Integer(left.intValue() - right.intValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
705 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
706 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
707 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
708 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
709 public static Number add(Number left, Number right) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
710 if (left instanceof Double) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
711 return new Double(left.doubleValue() + right.doubleValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
712 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
713 else if (left instanceof Long) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
714 return new Long(left.longValue() + right.longValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
715 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
716 else { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
717 return new Integer(left.intValue() + right.intValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
718 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
719 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
720 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
721 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
722 public static Number divide(Number left, Number right) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
723 if (left instanceof Double) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
724 return new Double(left.doubleValue() / right.doubleValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
725 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
726 else if (left instanceof Long) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
727 return new Long(left.longValue() / right.longValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
728 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
729 else { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
730 return new Integer(left.intValue() / right.intValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
731 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
732 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
733 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
734 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
735 public static Number multi(Number left, Number right) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
736 if (left instanceof Double) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
737 return new Double(left.doubleValue() * right.doubleValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
738 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
739 else if (left instanceof Long) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
740 return new Long(left.longValue() * right.longValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
741 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
742 else { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
743 return new Integer(left.intValue() * right.intValue()); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
744 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
745 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
746 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
747 |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
748 public static boolean isBigger(Number left, Number right) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
749 if (left instanceof Double) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
750 return left.doubleValue() > right.doubleValue(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
751 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
752 else if (left instanceof Long) { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
753 return left.longValue() > right.longValue(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
754 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
755 else { |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
756 return left.intValue() > right.intValue(); |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
757 } |
8bbaa0d173cf
Save zoom parameters as Number; added new Axis types NumberAxis and DateAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1579
diff
changeset
|
758 } |
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
|
759 } |
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
|
760 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |