Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/Style.java @ 3719:e82acd5c86f7
Merged revisions 5495-5496,5509,5514-5515,5521-5526 via svnmerge from
file:///home/clients/bsh/bsh-generischer-viewer/Material/SVN/flys-client/trunk
........
r5495 | ingo | 2012-09-17 14:55:09 +0200 (Mo, 17 Sep 2012) | 1 line
Added missing i18n strings for minfo state description.
........
r5496 | ingo | 2012-09-17 15:47:43 +0200 (Mo, 17 Sep 2012) | 1 line
Tagged 'flys-client' as 2.9.1
........
r5509 | teichmann | 2012-09-18 17:54:37 +0200 (Di, 18 Sep 2012) | 1 line
Removed trailing whitespace.
........
r5514 | bricks | 2012-09-19 09:56:42 +0200 (Mi, 19 Sep 2012) | 2 lines
Add missing Changelog entry for r5472
........
r5515 | bricks | 2012-09-19 09:59:35 +0200 (Mi, 19 Sep 2012) | 2 lines
Implement a scrolling gauge info tree
........
r5521 | bricks | 2012-09-19 14:41:48 +0200 (Mi, 19 Sep 2012) | 2 lines
Add station info to the gauges
........
r5522 | bricks | 2012-09-19 14:43:43 +0200 (Mi, 19 Sep 2012) | 2 lines
Improve the handling of the GaugePanel in the ParameterList
........
r5523 | bricks | 2012-09-19 14:51:02 +0200 (Mi, 19 Sep 2012) | 4 lines
Improve the GaugePanel
Be locale aware and only load the gauge info if the river name changes.
........
r5524 | bricks | 2012-09-19 15:14:46 +0200 (Mi, 19 Sep 2012) | 5 lines
Fix a NullPointerException
When iterating over a list it must be checked if the reference to the list is
valid.
........
r5525 | bricks | 2012-09-19 15:16:24 +0200 (Mi, 19 Sep 2012) | 2 lines
Don't display the GaugePanel if no river is selected
........
r5526 | bricks | 2012-09-19 15:18:36 +0200 (Mi, 19 Sep 2012) | 2 lines
Use the wstunit from the river as unit for the Pegelnullpunkt
........
flys-client/tags/2.9.1@5528 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 19 Sep 2012 14:42:48 +0000 |
parents | bb91cdf8407b |
children |
rev | line source |
---|---|
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 import java.util.List; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 import java.util.ArrayList; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 /** |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 */ |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 public class Style implements Serializable { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
13 /** The theme name. */ |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 protected String name; |
1292
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
15 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
16 /** The facet. */ |
1292
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
17 protected String facet; |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
18 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
19 /** The theme index. */ |
1326
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
20 protected int index; |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
21 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
22 /** List of theme attribute settings. */ |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 protected List<StyleSetting> settings; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
25 |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
26 /** |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
27 * Create a new style for theme attribution. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
28 */ |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 public Style() { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 settings = new ArrayList<StyleSetting>(); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
33 |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
34 /** |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
35 * Append a new style setting. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
36 * @param setting A theme attribution setting. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
37 */ |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 public void appendStyleSetting(StyleSetting setting) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 settings.add(setting); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 public void setName(String name) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 this.name = name; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 |
1292
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
46 public void setFacet(String facet) { |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
47 this.facet = facet; |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
48 } |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
49 |
1326
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
50 public void setIndex(int index) { |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
51 this.index = index; |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
52 } |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
53 |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 public String getName() { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 return this.name; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 |
1292
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
58 public String getFacet() { |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
59 return this.facet; |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
60 } |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1290
diff
changeset
|
61 |
1326
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
62 public int getIndex() { |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
63 return this.index; |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
64 } |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1295
diff
changeset
|
65 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
66 |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
67 /** |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
68 * Getter for a theme attribution setting. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
69 * @return The style setting. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
70 */ |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 public StyleSetting getSetting(String name) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 for (int i = 0; i < settings.size (); i++) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 if (settings.get(i).getName().equals(name)) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 return settings.get(i); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 return null; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 } |
1290
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
79 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
80 |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
81 /** |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
82 * Getter for number of settings. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
83 * @return The size of the settings list. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
84 */ |
1290
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
85 public int getNumSettings () { |
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
86 return settings.size(); |
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
87 } |
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
88 |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
89 |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
90 /** |
1450
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
91 * Getter for style settings. |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
92 * |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
93 * @return The list of style settings. |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
94 */ |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
95 public List<StyleSetting> getSettings() { |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
96 return this.settings; |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
97 } |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
98 |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
99 |
bb91cdf8407b
Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1345
diff
changeset
|
100 /** |
1345
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
101 * Getter for style setting. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
102 * @param i The index in the settings list. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
103 * |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
104 * @return The style setting at the given index. |
92074508a387
Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1326
diff
changeset
|
105 */ |
1290
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
106 public StyleSetting getSetting(int i) { |
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
107 return this.settings.get(i); |
f4deeafa60b3
Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
108 } |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |