annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java @ 811:df6d980c5418

Added more Javadoc in state.profile.horizontal package. gnv-artifacts/trunk@895 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 09 Apr 2010 10:46:31 +0000
parents c4156275c1e1
children 2423cefe7d39
rev   line source
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 package de.intevation.gnv.state.profile.horizontal;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
3 import de.intevation.artifacts.CallContext;
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
4 import de.intevation.artifacts.CallMeta;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
7
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8 import de.intevation.gnv.geobackend.base.Result;
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
9
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10 import de.intevation.gnv.state.StateBase;
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
11
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13 import de.intevation.gnv.state.describedata.KeyValueDescibeData;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14 import de.intevation.gnv.state.describedata.NamedArrayList;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 import de.intevation.gnv.state.describedata.NamedCollection;
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
16
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import de.intevation.gnv.state.exception.StateException;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
19 import java.util.ArrayList;
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
20 import java.util.Collection;
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
21 import java.util.List;
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
22
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 /**
811
df6d980c5418 Added more Javadoc in state.profile.horizontal package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
24 * This states handles coordinate inputs.
df6d980c5418 Added more Javadoc in state.profile.horizontal package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
25 *
780
c4156275c1e1 Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 779
diff changeset
26 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28 public class NorthSouthEastWestState extends StateBase {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 638
diff changeset
30
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 * The UID of this Class
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 private static final long serialVersionUID = -7989531326553305293L;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35
638
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
36 protected String ipos;
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
37 protected String jpos;
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
38
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 * Constructor
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 public NorthSouthEastWestState() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44
811
df6d980c5418 Added more Javadoc in state.profile.horizontal package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
45
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 @Override
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
47 protected List<Object> purifyResult(Collection<Result> result, String uuid) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
48 List<Object> describeData = new ArrayList<Object>();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
49
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
50 NamedCollection<KeyValueDescibeData> keyValueDescibeData =
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
51 new NamedArrayList<KeyValueDescibeData>(dataName, 2);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
52
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 keyValueDescibeData.setMultiSelect(super.dataMultiSelect);
638
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
54 keyValueDescibeData.add(new DefaultKeyValueDescribeData(
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
55 "IPOSITION", ipos));
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
56 keyValueDescibeData.add(new DefaultKeyValueDescribeData(
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
57 "JPOSITION", jpos));
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 describeData.add(keyValueDescibeData);
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
59
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
60 return describeData;
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
61 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
62
811
df6d980c5418 Added more Javadoc in state.profile.horizontal package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
63
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
64 @Override
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
65 public void initialize(String uuid, CallContext context)
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
66 throws StateException
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 493
diff changeset
67 {
638
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
68 CallMeta callMeta = context.getMeta();
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
69 RessourceFactory factory = RessourceFactory.getInstance();
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
70
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
71 // XXX Workarround - we need these strings in purifyResult, but have no
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 638
diff changeset
72 // CallMeta object there which is necessary to get resources from
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 638
diff changeset
73 // RessourceFactory. Storing the strings here is not nice, because the
638
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
74 // Locale object could change!
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
75 ipos = factory.getRessource(
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
76 callMeta.getLanguages(), "iposition", "iposition");
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
77 jpos = factory.getRessource(
c580666a843f Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
78 callMeta.getLanguages(), "jposition", "jposition");
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
79 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 }
811
df6d980c5418 Added more Javadoc in state.profile.horizontal package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
81 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org