Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java @ 1072:80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
flys-artifacts/trunk@2556 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 24 Aug 2011 12:07:33 +0000 |
parents | 193c49b7f6a3 |
children | 21b9eb24bd47 |
rev | line source |
---|---|
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 import org.w3c.dom.Element; |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
10 import org.w3c.dom.Node; |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
12 import de.intevation.artifacts.Artifact; |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.ArtifactFactory; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.ArtifactNamespaceContext; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.CallContext; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.CallMeta; |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
17 import de.intevation.flys.artifacts.states.StaticState; |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.artifacts.context.FLYSContext; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.artifacts.states.DefaultState; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.artifactdatabase.ProtocolUtils; |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
22 import de.intevation.artifactdatabase.state.DefaultFacet; |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.artifactdatabase.state.Facet; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.artifactdatabase.state.DefaultOutput; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 import de.intevation.artifactdatabase.state.Output; |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
26 import de.intevation.artifactdatabase.state.State; |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 import de.intevation.artifacts.common.utils.XMLUtils; |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 /** |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 * Artifact to access names of Points Of Interest along a segment of a river. |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
31 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
32 * with the StateEngine by overriding the getState*-methods. |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 */ |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 public class MainValuesArtifact |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 extends StaticFLYSArtifact |
1059
fdb0f4ef96f0
Made FLYS artifacts cloneable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1051
diff
changeset
|
36 { |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 /** The logger for this class. */ |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
38 private static Logger logger = Logger.getLogger(MainValuesArtifact.class); |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 /** The name of the artifact. */ |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
41 public static final String ARTIFACT_NAME = "mainvalue"; |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
42 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
43 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
44 /** |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
45 * Trivial Constructor. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
46 */ |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 public MainValuesArtifact() { |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
48 logger.debug("MainValuesArtifact.MainValuesartifact()"); |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 } |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
51 |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 /** |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 * Gets called from factory, to set things up. |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 */ |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 @Override |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 public void setup( |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 String identifier, |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 ArtifactFactory factory, |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 Object context, |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 CallMeta callMeta, |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 Document data) |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 { |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
63 logger.debug("MainValuesArtifact.setup"); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
64 super.setup(identifier, factory, context, callMeta, data); |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 } |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 /** |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
69 * Get a list containing the one and only State. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
70 * @param context ignored. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
71 * @return list with one and only state. |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 */ |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
73 @Override |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
74 protected List<State> getStates(Object context) { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
75 ArrayList<State> states = new ArrayList<State>(); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
76 states.add(getState(null,null)); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
77 return states; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
78 } |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
81 /** |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
82 * Get the "current" state. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
83 * @param cc ignored. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
84 * @return the "current" state. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
85 */ |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
86 @Override |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
87 protected State getCurrentState(Object cc) { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
88 return getState(); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
89 } |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
90 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
91 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
92 /** |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
93 * Get the only possible state. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
94 * @return the state. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
95 */ |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
96 protected State getState() { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
97 return getState(null, null); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
98 } |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
99 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
100 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
101 /** |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
102 * Get the state. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
103 * @param context ignored. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
104 * @param stateID ignored. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
105 * @return the state. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
106 */ |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
107 @Override |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
108 protected State getState(Object context, String stateID) { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
109 // TODO Add other outputs, prevent this code from being executed |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
110 // multiple times (e.g. make state serializable and a field). |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
111 State state = new StaticState(); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
112 List<Facet> fs = new ArrayList<Facet>(); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
113 fs.add(new MainValuesFacet()); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
114 facets.put(state.getID(), fs); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
115 DefaultOutput mainValuesOutput = new DefaultOutput( |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 "discharge_curve", "output.discharge_curve", "image/png", |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 fs, |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 "chart"); |
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
120 state.getOutputs().add(mainValuesOutput); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
121 return state; |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 } |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
123 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
124 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
125 /* FACET IMPLEMENTATION */ |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
126 class MainValuesFacet extends DefaultFacet { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
127 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
128 public MainValuesFacet() |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
129 { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
130 description = "facet.mainvalues"; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
131 name = "facet.mainvalues"; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
132 index = 0; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
133 } |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
134 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
135 // TODO implement; what is index used for? |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
136 /** |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
137 * Returns the index of this facet. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
138 * |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
139 * @return the index of this facet. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
140 */ |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
141 public int getIndex() { |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
142 return 0; |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
143 } |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
144 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
145 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
146 /** |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
147 * Returns the name of this facet. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
148 * |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
149 * @return the name of this facet. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
150 */ |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
151 public String getName() { |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
152 // TODO define, static |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
153 // TODO remove, is part of DefaultFacet. |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
154 return "facet.mainvalue"; |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
155 } |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
156 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
157 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
158 /** |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
159 * Returns the description of this facet. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
160 * |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
161 * @return the description of this facet. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
162 */ |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
163 public String getDescription() { |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
164 // TODO remove, is part of DefaultFacet. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
165 return "facet.mainvalues"; |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
166 } |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
167 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
168 |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
169 /** |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
170 * Returns the data this facet requires. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
171 * |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
172 * @param artifact The owner artifact. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
173 * @param context The CallContext. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
174 * |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
175 * @return the data. |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
176 */ |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
177 public Object getData(Artifact artifact, CallContext context) { |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
178 return null; |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
179 } |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
180 |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
181 |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
182 /** |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
183 * Create a deep copy of this Facet. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
184 * @return a deep copy. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
185 */ |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
186 public MainValuesFacet deepCopy() { |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
187 MainValuesFacet copy = new MainValuesFacet(); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
188 copy.set(this); |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1065
diff
changeset
|
189 return copy; |
1065
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
190 } |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
191 } |
193c49b7f6a3
Minor changes to stub MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1061
diff
changeset
|
192 |
1047
38088c982db6
Added stub implementation of new MainValuesArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 } |