comparison flys-client/src/main/java/org/dive4elements/river/client/shared/model/Style.java @ 5834:f507086aa94b

Repaired internal references.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:31:32 +0200
parents flys-client/src/main/java/de/intevation/flys/client/shared/model/Style.java@bb91cdf8407b
children 821a02bbfb4e
comparison
equal deleted inserted replaced
5833:a2bdc0f524e8 5834:f507086aa94b
1 package de.intevation.flys.client.shared.model;
2
3 import java.io.Serializable;
4
5 import java.util.List;
6 import java.util.ArrayList;
7
8 /**
9 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
10 */
11 public class Style implements Serializable {
12
13 /** The theme name. */
14 protected String name;
15
16 /** The facet. */
17 protected String facet;
18
19 /** The theme index. */
20 protected int index;
21
22 /** List of theme attribute settings. */
23 protected List<StyleSetting> settings;
24
25
26 /**
27 * Create a new style for theme attribution.
28 */
29 public Style() {
30 settings = new ArrayList<StyleSetting>();
31 }
32
33
34 /**
35 * Append a new style setting.
36 * @param setting A theme attribution setting.
37 */
38 public void appendStyleSetting(StyleSetting setting) {
39 settings.add(setting);
40 }
41
42 public void setName(String name) {
43 this.name = name;
44 }
45
46 public void setFacet(String facet) {
47 this.facet = facet;
48 }
49
50 public void setIndex(int index) {
51 this.index = index;
52 }
53
54 public String getName() {
55 return this.name;
56 }
57
58 public String getFacet() {
59 return this.facet;
60 }
61
62 public int getIndex() {
63 return this.index;
64 }
65
66
67 /**
68 * Getter for a theme attribution setting.
69 * @return The style setting.
70 */
71 public StyleSetting getSetting(String name) {
72 for (int i = 0; i < settings.size (); i++) {
73 if (settings.get(i).getName().equals(name)) {
74 return settings.get(i);
75 }
76 }
77 return null;
78 }
79
80
81 /**
82 * Getter for number of settings.
83 * @return The size of the settings list.
84 */
85 public int getNumSettings () {
86 return settings.size();
87 }
88
89
90 /**
91 * Getter for style settings.
92 *
93 * @return The list of style settings.
94 */
95 public List<StyleSetting> getSettings() {
96 return this.settings;
97 }
98
99
100 /**
101 * Getter for style setting.
102 * @param i The index in the settings list.
103 *
104 * @return The style setting at the given index.
105 */
106 public StyleSetting getSetting(int i) {
107 return this.settings.get(i);
108 }
109 }
110 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org