Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ReferenceCurveFacet.java @ 2405:f008c3335a77
Towards fixe of flys/issue495.
flys-artifacts/trunk@4033 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 10 Feb 2012 12:41:12 +0000 |
parents | c5e4a2d67631 |
children | dce0cc856357 |
comparison
equal
deleted
inserted
replaced
2404:750cdcccb39c | 2405:f008c3335a77 |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | 2 |
3 import java.util.ArrayList; | |
4 import java.util.Arrays; | |
3 import java.util.List; | 5 import java.util.List; |
4 import java.util.Arrays; | |
5 | 6 |
6 import de.intevation.artifactdatabase.state.Facet; | 7 import de.intevation.artifactdatabase.state.Facet; |
7 | 8 |
8 import de.intevation.artifacts.Artifact; | 9 import de.intevation.artifacts.Artifact; |
9 import de.intevation.artifacts.CallContext; | 10 import de.intevation.artifacts.CallContext; |
63 } | 64 } |
64 | 65 |
65 @Override | 66 @Override |
66 public void set(Facet other) { | 67 public void set(Facet other) { |
67 super.set(other); | 68 super.set(other); |
68 ReferenceCurveFacet o= (ReferenceCurveFacet)other; | 69 ReferenceCurveFacet o = (ReferenceCurveFacet)other; |
69 type = o.type; | 70 type = o.type; |
70 hash = o.hash; | 71 hash = o.hash; |
71 stateId = o.stateId; | 72 stateId = o.stateId; |
72 } | 73 } |
73 | 74 |
74 /** Copy deeply. */ | 75 /** Copy deeply. */ |
75 @Override | 76 @Override |
76 public Facet deepCopy() { | 77 public Facet deepCopy() { |
78 copy.set(this); | 79 copy.set(this); |
79 return copy; | 80 return copy; |
80 } | 81 } |
81 | 82 |
82 @Override | 83 @Override |
83 public List getDataProviderKeys(Artifact art) { | 84 public List getDataProviderKeys(Artifact art, CallContext context) { |
85 // Answer to key only if x or y in meter... | |
86 List keys = new ArrayList(); | |
87 // compute / get data | |
88 Object obj = context.getContextValue("reference.curve.axis.scale"); | |
89 | |
90 if (!(obj instanceof WWAxisTypes)) { | |
91 obj = new WWAxisTypes(getWWQQ(art, context)); | |
92 context.putContextValue("reference.curve.axis.scale", obj); | |
93 } | |
94 else { | |
95 ((WWAxisTypes)obj).classify(getWWQQ(art, context)); | |
96 } | |
97 // TODO we do not need to provide data | |
84 return BLACK_BOARD_KEY_LIST; | 98 return BLACK_BOARD_KEY_LIST; |
85 } | 99 } |
86 | 100 |
87 @Override | 101 @Override |
88 public Object provideBlackboardData( | 102 public Object provideBlackboardData( |
89 Artifact artifact, | 103 Artifact artifact, |
90 Object key, | 104 Object key, |
91 Object param, | 105 Object param, |
92 CallContext context | 106 CallContext context |
93 ) { | 107 ) { |
108 // TODO we do not really need to provide data | |
94 if (!key.equals(BLACK_BOARD_KEY)) { | 109 if (!key.equals(BLACK_BOARD_KEY)) { |
95 return null; | 110 return null; |
96 } | 111 } |
97 | 112 |
98 Object obj = context.getContextValue("reference.curve.axis.scale"); | 113 Object obj = context.getContextValue("reference.curve.axis.scale"); |