Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java @ 4133:c722c08cf502
Merged heads.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 15 Oct 2012 09:31:50 +0200 |
parents | e0354aed0cd3 |
children | a2735a4bf75e |
comparison
equal
deleted
inserted
replaced
4132:f6c73ee1b7f1 | 4133:c722c08cf502 |
---|---|
34 | 34 |
35 import de.intevation.flys.utils.FLYSUtils; | 35 import de.intevation.flys.utils.FLYSUtils; |
36 | 36 |
37 | 37 |
38 /** | 38 /** |
39 * Artifact to access names of Points Of Interest along a segment of a river. | 39 * Artifact to access main and extreme values of a river. |
40 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction | 40 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction |
41 * with the StateEngine by overriding the getState*-methods. | 41 * with the StateEngine by overriding the getState*-methods. |
42 */ | 42 */ |
43 public class MainValuesArtifact | 43 public class MainValuesArtifact |
44 extends StaticFLYSArtifact | 44 extends StaticFLYSArtifact |
94 Document data) | 94 Document data) |
95 { | 95 { |
96 logger.debug("MainValuesArtifact.setup"); | 96 logger.debug("MainValuesArtifact.setup"); |
97 state = new StaticState(STATIC_STATE_NAME); | 97 state = new StaticState(STATIC_STATE_NAME); |
98 | 98 |
99 Facet qfacet0 = new MainValuesQFacet( | 99 List<Facet> fs = new ArrayList<Facet>(); |
100 DURATION_MAINVALUES_Q, | 100 facets.put(state.getID(), fs); |
101 Resources.getMsg( | 101 spawnState(); |
102 callMeta, | 102 super.setup(identifier, factory, context, callMeta, data); |
103 "facet.discharge_curves.mainvalues.q", | 103 String restriction = getDatacageIDValue(data); |
104 "facet.discharge_curves.mainvalues.q"), | 104 logger.debug("mainvalue restriction " + restriction); |
105 false); | 105 boolean restricted = restriction.endsWith("q") || restriction.endsWith("w"); |
106 Facet qfacet1 = new MainValuesQFacet( | 106 if (!restricted || restriction.endsWith("q")) { |
107 COMPUTED_DISCHARGE_MAINVALUES_Q, | 107 Facet qfacet0 = new MainValuesQFacet( |
108 Resources.getMsg( | 108 DURATION_MAINVALUES_Q, |
109 callMeta, | 109 Resources.getMsg( |
110 "facet.discharge_curves.mainvalues.q", | 110 callMeta, |
111 "facet.discharge_curves.mainvalues.q"), | 111 "facet.discharge_curves.mainvalues.q", |
112 false); | 112 "facet.discharge_curves.mainvalues.q"), |
113 Facet qfacet2 = new MainValuesQFacet( | 113 false); |
114 MAINVALUES_Q, | 114 Facet qfacet1 = new MainValuesQFacet( |
115 Resources.getMsg( | 115 COMPUTED_DISCHARGE_MAINVALUES_Q, |
116 callMeta, | 116 Resources.getMsg( |
117 "facet.discharge_curves.mainvalues.q", | 117 callMeta, |
118 "facet.discharge_curves.mainvalues.q"), | 118 "facet.discharge_curves.mainvalues.q", |
119 true); | 119 "facet.discharge_curves.mainvalues.q"), |
120 false); | |
121 Facet qfacet2 = new MainValuesQFacet( | |
122 MAINVALUES_Q, | |
123 Resources.getMsg( | |
124 callMeta, | |
125 "facet.discharge_curves.mainvalues.q", | |
126 "facet.discharge_curves.mainvalues.q"), | |
127 true); | |
128 | |
129 fs.add(qfacet0); | |
130 fs.add(qfacet1); | |
131 fs.add(qfacet2); | |
132 } | |
133 if (!restricted || restriction.endsWith("w")) { | |
120 Facet wfacet1 = new MainValuesWFacet( | 134 Facet wfacet1 = new MainValuesWFacet( |
121 COMPUTED_DISCHARGE_MAINVALUES_W, | 135 COMPUTED_DISCHARGE_MAINVALUES_W, |
122 Resources.getMsg( | 136 Resources.getMsg( |
123 callMeta, | 137 callMeta, |
124 "facet.discharge_curves.mainvalues.w", | 138 "facet.discharge_curves.mainvalues.w", |
129 Resources.getMsg( | 143 Resources.getMsg( |
130 callMeta, | 144 callMeta, |
131 "facet.discharge_curves.mainvalues.w", | 145 "facet.discharge_curves.mainvalues.w", |
132 "facet.discharge_curves.mainvalues.w"), | 146 "facet.discharge_curves.mainvalues.w"), |
133 true); | 147 true); |
134 | 148 fs.add(wfacet1); |
135 List<Facet> fs = new ArrayList<Facet>(); | 149 fs.add(wfacet2); |
136 fs.add(qfacet0); | 150 } |
137 fs.add(qfacet1); | |
138 fs.add(qfacet2); | |
139 fs.add(wfacet1); | |
140 fs.add(wfacet2); | |
141 | |
142 facets.put(state.getID(), fs); | |
143 spawnState(); | |
144 super.setup(identifier, factory, context, callMeta, data); | |
145 } | 151 } |
146 | 152 |
147 | 153 |
148 /** | 154 /** |
149 * Create "the" state. | 155 * Create "the" state. |