Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/ChartInfo.java @ 2468:6a65694bdcc2
Issue 506.
Gauge time range panel now accepts dates. The dates are stored as long values.
flys-client/trunk@4176 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 20 Mar 2012 14:53:42 +0000 |
parents | ea2191b1299d |
children | 936e3e6cd9b9 |
rev | line source |
---|---|
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:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
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:
diff
changeset
|
2 |
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:
diff
changeset
|
3 import java.io.Serializable; |
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:
diff
changeset
|
4 |
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.google.gwt.core.client.GWT; |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
6 |
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:
diff
changeset
|
7 import de.intevation.flys.client.shared.Transform2D; |
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:
diff
changeset
|
8 |
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:
diff
changeset
|
9 |
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:
diff
changeset
|
10 /** |
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:
diff
changeset
|
11 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
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:
diff
changeset
|
12 */ |
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:
diff
changeset
|
13 public class ChartInfo implements Serializable { |
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:
diff
changeset
|
14 |
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:
diff
changeset
|
15 protected Axis[] xAxes; |
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:
diff
changeset
|
16 protected Axis[] yAxes; |
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:
diff
changeset
|
17 |
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:
552
diff
changeset
|
18 protected Transform2D[] transformer; |
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:
diff
changeset
|
19 |
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:
diff
changeset
|
20 |
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:
diff
changeset
|
21 public 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:
diff
changeset
|
22 } |
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:
diff
changeset
|
23 |
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:
diff
changeset
|
24 |
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:
552
diff
changeset
|
25 public ChartInfo(Axis[] xAxes, Axis[] yAxes, Transform2D[] transformer) { |
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:
diff
changeset
|
26 this.xAxes = xAxes; |
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:
diff
changeset
|
27 this.yAxes = yAxes; |
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:
diff
changeset
|
28 this.transformer = transformer; |
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:
diff
changeset
|
29 } |
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:
diff
changeset
|
30 |
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:
diff
changeset
|
31 |
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:
552
diff
changeset
|
32 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:
552
diff
changeset
|
33 if (pos >= 0 && pos < transformer.length) { |
460b8e0f0563
Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
552
diff
changeset
|
34 return transformer[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:
552
diff
changeset
|
35 } |
460b8e0f0563
Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
552
diff
changeset
|
36 |
460b8e0f0563
Parse the min/max axes ranges for the ChartInfo and modified the zoom and pan actions to match the current server implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
552
diff
changeset
|
37 return null; |
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:
diff
changeset
|
38 } |
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:
diff
changeset
|
39 |
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:
diff
changeset
|
40 |
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:
diff
changeset
|
41 public int getXAxisCount() { |
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:
diff
changeset
|
42 return xAxes.length; |
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:
diff
changeset
|
43 } |
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:
diff
changeset
|
44 |
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:
diff
changeset
|
45 |
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:
diff
changeset
|
46 public int getYAxisCount() { |
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:
diff
changeset
|
47 return yAxes.length; |
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:
diff
changeset
|
48 } |
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:
diff
changeset
|
49 |
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:
diff
changeset
|
50 |
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:
diff
changeset
|
51 public Axis getXAxis(int pos) { |
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:
diff
changeset
|
52 if (pos >= 0 && pos < xAxes.length) { |
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:
diff
changeset
|
53 return xAxes[pos]; |
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:
diff
changeset
|
54 } |
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:
diff
changeset
|
55 |
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:
diff
changeset
|
56 return null; |
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:
diff
changeset
|
57 } |
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:
diff
changeset
|
58 |
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:
diff
changeset
|
59 |
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:
diff
changeset
|
60 public Axis getYAxis(int pos) { |
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:
diff
changeset
|
61 if (pos >= 0 && pos < yAxes.length) { |
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:
diff
changeset
|
62 return yAxes[pos]; |
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:
diff
changeset
|
63 } |
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:
diff
changeset
|
64 |
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:
diff
changeset
|
65 return null; |
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:
diff
changeset
|
66 } |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
67 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
68 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
69 public void dumpGWT() { |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
70 StringBuilder sb = new StringBuilder(); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
71 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
72 Axis x = getXAxis(0); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
73 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
74 GWT.log("X axis:"); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
75 GWT.log("... from " + x.getFrom() + " to " + x.getTo()); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
76 GWT.log("... min " + x.getMin() + " max " + x.getMax()); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
77 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
78 for (int i = 0, count = getYAxisCount(); i < count; i++) { |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
79 Axis y = getYAxis(i); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
80 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
81 GWT.log("Y axis " + i + ":"); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
82 GWT.log("... from " + y.getFrom() + " to " + y.getTo()); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
83 GWT.log("... min " + y.getMin() + " max " + y.getMax()); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
84 } |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
85 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
86 for (Transform2D t: transformer) { |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
87 t.dumpGWT(); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
88 } |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
561
diff
changeset
|
89 } |
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:
diff
changeset
|
90 } |
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:
diff
changeset
|
91 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |