Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/jfree/XYDatasetToZeroMapper.java @ 1835:35e38e2afb22
Re-enabled mainvalue-recommendation for computed discharge curves.
flys-artifacts/trunk@3171 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 04 Nov 2011 13:29:15 +0000 |
parents | 982956bde69e |
children |
rev | line source |
---|---|
1824
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.jfree; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.util.Iterator; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.util.ArrayList; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import org.jfree.data.xy.XYDataset; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import org.jfree.data.general.DatasetChangeListener; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 import org.jfree.data.general.DatasetGroup; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import org.jfree.data.DomainOrder; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 import java.io.Serializable; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public class XYDatasetToZeroMapper |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 implements Serializable |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 protected int seriesA; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 protected int seriesB; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 public class MappedXYDataset implements XYDataset, Serializable { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 protected XYDataset parent; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 public MappedXYDataset() { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 public MappedXYDataset(XYDataset parent) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 this.parent = parent; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 protected int remap(int series) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 switch (series) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 case 0: return seriesA; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 case 1: return seriesB; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 return series; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 public int getSeriesCount() { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 return seriesA != seriesB ? 2 : 1; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 public Comparable getSeriesKey(int series) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 return parent.getSeriesKey(remap(series)); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 public int indexOf(Comparable seriesKey) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 Comparable cmpA = parent.getSeriesKey(seriesA); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 if (cmpA == seriesKey |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 || (cmpA != null && cmpA.equals(seriesKey))) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 return 0; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 Comparable cmpB = parent.getSeriesKey(seriesB); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 if (cmpB == seriesKey |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 || (cmpB != null && cmpB.equals(seriesKey))) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 return 1; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 return -1; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 public void addChangeListener(DatasetChangeListener listener) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 parent.addChangeListener(listener); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 public void removeChangeListener(DatasetChangeListener listener) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 parent.removeChangeListener(listener); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 public DatasetGroup getGroup() { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 return parent.getGroup(); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 public void setGroup(DatasetGroup group) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 parent.setGroup(group); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 public DomainOrder getDomainOrder() { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 return parent.getDomainOrder(); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 public int getItemCount(int series) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 return parent.getItemCount(remap(series)); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 public Number getX(int series, int item) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 return parent.getX(remap(series), item); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 public double getXValue(int series, int item) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 return parent.getXValue(remap(series), item); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 public Number getY(int series, int item) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 return parent.getY(remap(series), item); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 @Override |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 public double getYValue(int series, int item) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 return parent.getYValue(remap(series), item); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 } // class MappedXYDataset |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 public XYDatasetToZeroMapper() { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 public XYDatasetToZeroMapper(int seriesA) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 this(seriesA, seriesA); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 public XYDatasetToZeroMapper(int seriesA, int seriesB) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 this.seriesA = seriesA; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 this.seriesB = seriesB; |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 public Iterator<XYDataset> iterator(XYDataset dataset) { |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 List<XYDataset> list = new ArrayList<XYDataset>(1); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 list.add(new MappedXYDataset(dataset)); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 return list.iterator(); |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 } |
982956bde69e
Added a dataset to zero mapper to circumvent shortcommings in XYDifferenceRenderer.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |