Mercurial > dive4elements > river
comparison flys-client/src/main/java/org/dive4elements/river/client/shared/model/ChartInfo.java @ 5834:f507086aa94b
Repaired internal references.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 12:31:32 +0200 |
parents | flys-client/src/main/java/de/intevation/flys/client/shared/model/ChartInfo.java@6a8f83c538e3 |
children | 821a02bbfb4e |
comparison
equal
deleted
inserted
replaced
5833:a2bdc0f524e8 | 5834:f507086aa94b |
---|---|
1 package de.intevation.flys.client.shared.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import com.google.gwt.core.client.GWT; | |
6 | |
7 import de.intevation.flys.client.shared.Transform2D; | |
8 | |
9 | |
10 /** | |
11 * Give information about chart dimension and transform of chart<->pixel | |
12 * space. | |
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
14 */ | |
15 public class ChartInfo implements Serializable { | |
16 | |
17 protected Axis[] xAxes; | |
18 protected Axis[] yAxes; | |
19 | |
20 protected Transform2D[] transformer; | |
21 | |
22 | |
23 public ChartInfo() { | |
24 } | |
25 | |
26 | |
27 public ChartInfo(Axis[] xAxes, Axis[] yAxes, Transform2D[] transformer) { | |
28 this.xAxes = xAxes; | |
29 this.yAxes = yAxes; | |
30 this.transformer = transformer; | |
31 } | |
32 | |
33 | |
34 public Transform2D getTransformer(int pos) { | |
35 if (pos >= 0 && pos < transformer.length) { | |
36 return transformer[pos]; | |
37 } | |
38 | |
39 return null; | |
40 } | |
41 | |
42 | |
43 public int getTransformerCount() { | |
44 return transformer.length; | |
45 } | |
46 | |
47 | |
48 public int getXAxisCount() { | |
49 return xAxes.length; | |
50 } | |
51 | |
52 | |
53 public int getYAxisCount() { | |
54 return yAxes.length; | |
55 } | |
56 | |
57 | |
58 public Axis getXAxis(int pos) { | |
59 if (pos >= 0 && pos < xAxes.length) { | |
60 return xAxes[pos]; | |
61 } | |
62 | |
63 return null; | |
64 } | |
65 | |
66 | |
67 public Axis getYAxis(int pos) { | |
68 if (pos >= 0 && pos < yAxes.length) { | |
69 return yAxes[pos]; | |
70 } | |
71 | |
72 return null; | |
73 } | |
74 | |
75 | |
76 public void dumpGWT() { | |
77 StringBuilder sb = new StringBuilder(); | |
78 | |
79 Axis x = getXAxis(0); | |
80 | |
81 GWT.log("X axis:"); | |
82 GWT.log("... from " + x.getFrom() + " to " + x.getTo()); | |
83 GWT.log("... min " + x.getMin() + " max " + x.getMax()); | |
84 | |
85 for (int i = 0, count = getYAxisCount(); i < count; i++) { | |
86 Axis y = getYAxis(i); | |
87 | |
88 GWT.log("Y axis " + i + ":"); | |
89 GWT.log("... from " + y.getFrom() + " to " + y.getTo()); | |
90 GWT.log("... min " + y.getMin() + " max " + y.getMax()); | |
91 } | |
92 | |
93 for (Transform2D t: transformer) { | |
94 t.dumpGWT(); | |
95 } | |
96 } | |
97 } | |
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |