Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MainValuesQFacet.java @ 1957:3b08b8aacfb0
Fix flys/issue423, do not interpolate main values at gauge.
flys-artifacts/trunk@3357 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 06 Dec 2011 08:26:24 +0000 |
parents | f6a190f6aaff |
children | c68f4f227c09 |
comparison
equal
deleted
inserted
replaced
1956:a5f87f8dbe57 | 1957:3b08b8aacfb0 |
---|---|
20 */ | 20 */ |
21 public class MainValuesQFacet | 21 public class MainValuesQFacet |
22 extends DefaultFacet | 22 extends DefaultFacet |
23 implements FacetTypes { | 23 implements FacetTypes { |
24 | 24 |
25 /** Do we want MainValues at Gauge (not interpolated)? */ | |
26 protected boolean isAtGauge; | |
27 | |
25 /** Trivial Constructor. */ | 28 /** Trivial Constructor. */ |
26 public MainValuesQFacet(String name, String description) { | 29 public MainValuesQFacet(String name, String description, boolean atGauge) { |
27 this.description = description; | 30 this.description = description; |
28 this.name = name; | 31 this.name = name; |
29 index = 0; | 32 this.index = 0; |
33 this.isAtGauge = atGauge; | |
30 } | 34 } |
31 | 35 |
32 | 36 |
33 /** | 37 /** |
34 * Returns the data this facet requires. | 38 * Returns the data this facet requires. |
40 */ | 44 */ |
41 @Override | 45 @Override |
42 public Object getData(Artifact artifact, CallContext context) { | 46 public Object getData(Artifact artifact, CallContext context) { |
43 MainValuesArtifact mvArtifact = (MainValuesArtifact) artifact; | 47 MainValuesArtifact mvArtifact = (MainValuesArtifact) artifact; |
44 | 48 |
45 List<NamedDouble> qs = mvArtifact.getMainValuesQ(); | 49 List<NamedDouble> qs = mvArtifact.getMainValuesQ(isAtGauge); |
46 List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); | 50 List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); |
47 | 51 |
48 for (NamedDouble q: qs) { | 52 for (NamedDouble q: qs) { |
49 xy.add(new StickyAxisAnnotation( | 53 xy.add(new StickyAxisAnnotation( |
50 q.getName(), | 54 q.getName(), |
60 * Create a deep copy of this Facet. | 64 * Create a deep copy of this Facet. |
61 * @return a deep copy. | 65 * @return a deep copy. |
62 */ | 66 */ |
63 @Override | 67 @Override |
64 public MainValuesQFacet deepCopy() { | 68 public MainValuesQFacet deepCopy() { |
65 MainValuesQFacet copy = new MainValuesQFacet(this.name, description); | 69 MainValuesQFacet copy = new MainValuesQFacet(this.name, |
70 description, this.isAtGauge); | |
66 copy.set(this); | 71 copy.set(this); |
67 return copy; | 72 return copy; |
68 } | 73 } |
69 } | 74 } |
70 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 75 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |