Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java @ 1326:974c6b3700de
Use the theme index to identify the correct style.
flys-client/trunk@2968 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 14 Oct 2011 08:36:29 +0000 |
parents | bdc270ea6195 |
children | 92074508a387 |
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 /** |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * @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
|
11 */ |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 public class CollectionItemAttribute implements Serializable { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 protected List<Style> styles; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
1292
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
16 protected String artifact; |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
17 |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 public CollectionItemAttribute() { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 styles = new ArrayList<Style>(); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 public void appendStyle (Style style) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 this.styles.add(style); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 public void removeStyle (String name) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 for (int i = 0; i < styles.size(); i++) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 if (styles.get(i).getName().equals(name)) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 styles.remove(i); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 } |
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 } |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 |
1326
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1292
diff
changeset
|
34 public Style getStyle(String facet, int index) { |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 for (int i = 0; i < styles.size(); i++) { |
1326
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1292
diff
changeset
|
36 Style tmp = styles.get(i); |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1292
diff
changeset
|
37 if (tmp.getFacet().equals(facet) && |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1292
diff
changeset
|
38 tmp.getIndex() == index) { |
974c6b3700de
Use the theme index to identify the correct style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1292
diff
changeset
|
39 return tmp; |
1285
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 return null; |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 } |
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 public Style getStyle(int i) { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 return styles.get(i); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 } |
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 public int getNumStyles() { |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 return styles.size(); |
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 } |
1292
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
52 |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
53 public void setArtifact(String artifact) { |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
54 this.artifact = artifact; |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
55 } |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
56 |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
57 public String getArtifact () { |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
58 return this.artifact; |
bdc270ea6195
Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1285
diff
changeset
|
59 } |
1285
0f3b19df1880
Added new service and model for collection item attributes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 } |