Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacet.java @ 1061:b1b0a0b61845
Made facets cloneable with the right type.
flys-artifacts/trunk@2533 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 23 Aug 2011 13:17:21 +0000 |
parents | ea56940bfc4c |
children | 238145ef67da |
comparison
equal
deleted
inserted
replaced
1060:2d60a875e28c | 1061:b1b0a0b61845 |
---|---|
7 import de.intevation.artifacts.ArtifactNamespaceContext; | 7 import de.intevation.artifacts.ArtifactNamespaceContext; |
8 | 8 |
9 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; | 9 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
10 | 10 |
11 import de.intevation.artifactdatabase.state.DefaultFacet; | 11 import de.intevation.artifactdatabase.state.DefaultFacet; |
12 | 12 import de.intevation.artifactdatabase.state.Facet; |
13 | 13 |
14 public class ManagedFacet extends DefaultFacet { | 14 public class ManagedFacet extends DefaultFacet { |
15 | 15 |
16 /** The uuid of the owner artifact.*/ | 16 /** The uuid of the owner artifact.*/ |
17 protected String uuid; | 17 protected String uuid; |
20 protected int position; | 20 protected int position; |
21 | 21 |
22 /** A property that determines if this facet is active or not.*/ | 22 /** A property that determines if this facet is active or not.*/ |
23 protected int active; | 23 protected int active; |
24 | 24 |
25 public ManagedFacet() { | |
26 } | |
25 | 27 |
26 public ManagedFacet( | 28 public ManagedFacet( |
27 String name, | 29 String name, |
28 int index, | 30 int index, |
29 String desc, | 31 String desc, |
78 ec.addAttr(facet, "index", String.valueOf(getIndex()), true); | 80 ec.addAttr(facet, "index", String.valueOf(getIndex()), true); |
79 ec.addAttr(facet, "description", getDescription(), true); | 81 ec.addAttr(facet, "description", getDescription(), true); |
80 | 82 |
81 return facet; | 83 return facet; |
82 } | 84 } |
85 | |
86 public void set(ManagedFacet other) { | |
87 uuid = other.uuid; | |
88 position = other.position; | |
89 active = other.active; | |
90 } | |
91 | |
92 @Override | |
93 public Facet deepCopy() { | |
94 ManagedFacet copy = new ManagedFacet(); | |
95 copy.set((DefaultFacet)this); | |
96 copy.set((ManagedFacet)this); | |
97 return copy; | |
98 } | |
83 } | 99 } |
84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 100 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |