annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Style.java @ 5861:172338b1407f

GWT client: Added copyright header.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:30:15 +0200
parents 5aa05a7a34b7
children ea9eef426962
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.shared.model;
1285
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 import java.io.Serializable;
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 import java.util.List;
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 import java.util.ArrayList;
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 /**
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 * @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
18 */
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 public class Style implements Serializable {
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
21 /** The theme name. */
1285
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 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
23
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
24 /** 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
25 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
26
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
27 /** The theme index. */
1326
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
28 protected int index;
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
29
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
30 /** 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
31 protected List<StyleSetting> settings;
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 * Create a new style for theme attribution.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
36 */
1285
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 public Style() {
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 settings = new ArrayList<StyleSetting>();
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
41
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
42 /**
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
43 * Append a new style setting.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
44 * @param setting A theme attribution setting.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
45 */
1285
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 public void appendStyleSetting(StyleSetting setting) {
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 settings.add(setting);
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 public void setName(String name) {
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 this.name = name;
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53
1292
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1290
diff changeset
54 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
55 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
56 }
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1290
diff changeset
57
1326
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
58 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
59 this.index = index;
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
60 }
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
61
1285
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 public String getName() {
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 return this.name;
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65
1292
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1290
diff changeset
66 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
67 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
68 }
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1290
diff changeset
69
1326
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
70 public int getIndex() {
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
71 return this.index;
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
72 }
974c6b3700de Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1295
diff changeset
73
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
74
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
75 /**
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
76 * Getter for a theme attribution setting.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
77 * @return The style setting.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
78 */
1285
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 public StyleSetting getSetting(String name) {
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 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
81 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
82 return settings.get(i);
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 return null;
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 }
1290
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
87
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
88
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 * Getter for number of settings.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
91 * @return The size of the settings list.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
92 */
1290
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
93 public int getNumSettings () {
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
94 return settings.size();
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
95 }
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
96
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
97
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
98 /**
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
99 * 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
100 *
bb91cdf8407b Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1345
diff changeset
101 * @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
102 */
bb91cdf8407b Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1345
diff changeset
103 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
104 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
105 }
bb91cdf8407b Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1345
diff changeset
106
bb91cdf8407b Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1345
diff changeset
107
bb91cdf8407b Minor refactoring to ease addition of new style-fields (are now added automically).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1345
diff changeset
108 /**
1345
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
109 * Getter for style setting.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
110 * @param i The index in the settings list.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
111 *
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
112 * @return The style setting at the given index.
92074508a387 Added documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1326
diff changeset
113 */
1290
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
114 public StyleSetting getSetting(int i) {
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
115 return this.settings.get(i);
f4deeafa60b3 Build up the editor window from CollectionItemAttribute response.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1285
diff changeset
116 }
1285
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 }
0f3b19df1880 Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org