Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/Style.java @ 5230:fb7d43ba8147
WaterlevelDifferencesParser: Cosmetics and fix misleading debug output.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 11 Mar 2013 15:08:43 +0100 |
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 : |