Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/StaticState.java @ 3987:b328da465fe9
Correct i18n fixation outlier widget (state.fixation.preprocess).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sun, 30 Sep 2012 15:12:39 +0200 |
parents | 6cdd994ee8a4 |
children | c4400ccf158b |
rev | line source |
---|---|
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.states; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
1968
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
3 import java.util.List; |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
4 |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.flys.artifacts.model.FacetTypes; |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 |
1968
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
9 import de.intevation.artifactdatabase.state.Facet; |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
10 import de.intevation.artifactdatabase.state.DefaultOutput; |
3935
6cdd994ee8a4
Make addOutput of StaticState public
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2004
diff
changeset
|
11 import de.intevation.artifactdatabase.state.Output; |
1968
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
12 |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
13 import de.intevation.flys.artifacts.FLYSArtifact; |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
14 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
15 import de.intevation.artifacts.CallContext; |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
16 import de.intevation.artifacts.CallMeta; |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
17 |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 /** |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 * Yet, a non-abstract DefaultState. |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 */ |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 public class StaticState |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 extends DefaultState |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 implements FacetTypes |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 { |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 /** The logger that is used in this state. */ |
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 private static final Logger logger = Logger.getLogger(StaticState.class); |
1112
aeae4d20f32f
Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1072
diff
changeset
|
27 |
1787
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
28 |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
29 /** |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
30 * Trivial constructor, sets id and description. |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
31 * @param id String used for both id and description. |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
32 */ |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
33 public StaticState(String id) { |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
34 this(id, id); |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
35 } |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
36 |
f3be8fa1ec62
Cosmetics, added simpler constructor for StaticState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1112
diff
changeset
|
37 |
1112
aeae4d20f32f
Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1072
diff
changeset
|
38 public StaticState(String id, String description) { |
aeae4d20f32f
Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1072
diff
changeset
|
39 super(); |
aeae4d20f32f
Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1072
diff
changeset
|
40 setID(id); |
aeae4d20f32f
Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1072
diff
changeset
|
41 setDescription(description); |
aeae4d20f32f
Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1072
diff
changeset
|
42 } |
1968
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
43 |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
44 public void addDefaultChartOutput(String nameDesc, List<Facet> facets) { |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
45 DefaultOutput output = new DefaultOutput(nameDesc, |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
46 nameDesc, "image/png", facets, "chart"); |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
47 getOutputs().add(output); |
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
48 } |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
49 |
2004
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
50 public static void addDefaultChartOutput( |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
51 DefaultState state, |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
52 String nameDesc, |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
53 List<Facet> facets |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
54 ) { |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
55 DefaultOutput output = new DefaultOutput(nameDesc, |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
56 nameDesc, "image/png", facets, "chart"); |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
57 state.getOutputs().add(output); |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
58 } |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
59 |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
60 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
61 /** |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
62 * Do nothing (override to include your logic). |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
63 * @param facets List of facets (to add to). |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
64 */ |
2004
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
65 public Object staticCompute(List<Facet> facets, FLYSArtifact artifact) { |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
66 return staticCompute(facets); |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
67 } |
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
68 |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
69 public Object staticCompute(List<Facet> facets) { |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
70 return null; |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
71 } |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
72 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
73 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
74 /** Call staticCompute to allow easy adjustments. */ |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
75 @Override |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
76 public Object computeAdvance( |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
77 FLYSArtifact artifact, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
78 String hash, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
79 CallContext context, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
80 List<Facet> facets, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
81 Object old |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
82 ) { |
2004
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
83 return staticCompute(facets, artifact); |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
84 } |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
85 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
86 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
87 /** Call staticCompute to allow easy adjustments. */ |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
88 @Override |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
89 public Object computeFeed( |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
90 FLYSArtifact artifact, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
91 String hash, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
92 CallContext context, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
93 List<Facet> facets, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
94 Object old |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
95 ) { |
2004
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
96 return staticCompute(facets, artifact); |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
97 } |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
98 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
99 |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
100 /** Call staticCompute to allow easy adjustments. */ |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
101 @Override |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
102 public Object computeInit( |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
103 FLYSArtifact artifact, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
104 String hash, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
105 Object context, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
106 CallMeta meta, |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
107 List<Facet> facets |
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
108 ) { |
2004
94c4dd5aaf20
Made StaticState a bit more convenient to use.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1971
diff
changeset
|
109 return staticCompute(facets, artifact); |
1971
741d2067cfe1
Given CrossSections a name, let crosssection facets survive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1968
diff
changeset
|
110 } |
3935
6cdd994ee8a4
Make addOutput of StaticState public
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2004
diff
changeset
|
111 |
6cdd994ee8a4
Make addOutput of StaticState public
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2004
diff
changeset
|
112 public void addOutput(Output out) { |
6cdd994ee8a4
Make addOutput of StaticState public
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2004
diff
changeset
|
113 super.addOutput(out); |
6cdd994ee8a4
Make addOutput of StaticState public
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2004
diff
changeset
|
114 } |
1072
80aecb01d79a
Let MainValuesArtifact have a state, outputmode and facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 } |
1968
18928f0f339b
Add helper function.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1787
diff
changeset
|
116 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |