annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/ChartInfo.java @ 3693:b63e6fdd8cd0

Cosmetics, docs. flys-client/trunk@5384 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 07 Sep 2012 13:02:46 +0000
parents 936e3e6cd9b9
children
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 /**
3693
b63e6fdd8cd0 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2477
diff changeset
11 * Give information about chart dimension and transform of chart<->pixel
b63e6fdd8cd0 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2477
diff changeset
12 * space.
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
13 * @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
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 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
16
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 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
18 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
19
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
20 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
21
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 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
24 }
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
25
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
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
27 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
28 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
29 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
30 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
31 }
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
32
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
33
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
34 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
35 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
36 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
37 }
460b8e0f0563 Parse the min/max axes 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
38
460b8e0f0563 Parse the min/max axes 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
39 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
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
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
2477
936e3e6cd9b9 Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 610
diff changeset
43 public int getTransformerCount() {
936e3e6cd9b9 Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 610
diff changeset
44 return transformer.length;
936e3e6cd9b9 Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 610
diff changeset
45 }
936e3e6cd9b9 Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 610
diff changeset
46
936e3e6cd9b9 Issue 502.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 610
diff changeset
47
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
48 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
49 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
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
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
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 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
54 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
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
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 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
59 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
60 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
61 }
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
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 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
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
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
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
67 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
68 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
69 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
70 }
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
71
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
72 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
73 }
610
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
74
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
75
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
76 public void dumpGWT() {
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
77 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
78
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
79 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
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("X axis:");
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 " + 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
83 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
84
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
85 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
86 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
87
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
88 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
89 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
90 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
91 }
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
92
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
93 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
94 t.dumpGWT();
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
95 }
ea2191b1299d #170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 561
diff changeset
96 }
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
97 }
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
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org