Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacet.java @ 2792:fe987587ebc9
Merged revisions 4539-4540,4543,4545-4546 via svnmerge from
file:///home/clients/bsh/bsh-generischer-viewer/Material/SVN/flys-artifacts/trunk
........
r4539 | teichmann | 2012-05-27 20:02:13 +0200 (So, 27 Mai 2012) | 1 line
FixA: Added forgotten csv/report facets/generators to conf.
........
r4540 | teichmann | 2012-05-27 20:11:31 +0200 (So, 27 Mai 2012) | 1 line
FixA: Fixed class cast bug in report facet.
........
r4543 | teichmann | 2012-05-28 20:35:01 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: Added facet to return delta w/t as CSV
........
r4545 | teichmann | 2012-05-28 22:59:27 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: Made Delta W/t calculation finally work
........
r4546 | teichmann | 2012-05-28 23:34:24 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: corrected fitting (Q->W instead W->Q).
........
flys-artifacts/tags/2.7@4547 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 May 2012 04:58:29 +0000 |
parents | eb35570df0e8 |
children | 5642a83420f2 |
line wrap: on
line source
package de.intevation.flys.artifacts.model; import org.apache.log4j.Logger; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; import de.intevation.artifactdatabase.state.DefaultFacet; import de.intevation.artifactdatabase.state.Facet; /** * Facet with user-supplied theme-control-information (pos in list, * active/disabled etc) attached. */ public class ManagedFacet extends DefaultFacet { /** The uuid of the owner artifact. */ protected String uuid; /** A property that determines the position of this facet. */ protected int position; /** A property that determines if this facet is active or not. */ protected int active; /** The logger that is used in this class. */ private static Logger logger = Logger.getLogger(ManagedFacet.class); /** A property that determines if this facet is visible or not. */ protected int visible; public ManagedFacet() { } public ManagedFacet( String name, int index, String desc, String uuid, int pos, int active, int visible) { super(index, name, desc); this.uuid = uuid; this.position = pos; this.active = active; this.visible = visible; } /** * Sets position (will be merged to position in ThemeList). */ public void setPosition(int pos) { this.position = pos; } public int getPosition() { return position; } public void setActive(int active) { this.active = active; } public int getActive() { return active; } public void setVisible(int visible) { this.visible = visible; } public int getVisible() { return visible; } /** * Get uuid of related artifact. * @return uuid of related artifact. */ public String getArtifact() { return uuid; } public Node toXML(Document doc) { ElementCreator ec = new ElementCreator( doc, ArtifactNamespaceContext.NAMESPACE_URI, ArtifactNamespaceContext.NAMESPACE_PREFIX); Element facet = ec.create("theme"); ec.addAttr(facet, "artifact", getArtifact(), true); ec.addAttr(facet, "facet", getName(), true); ec.addAttr(facet, "pos", String.valueOf(getPosition()), true); ec.addAttr(facet, "active", String.valueOf(getActive()), true); ec.addAttr(facet, "index", String.valueOf(getIndex()), true); ec.addAttr(facet, "description", getDescription(), true); ec.addAttr(facet, "visible", String.valueOf(getVisible()), true); return facet; } public void set(ManagedFacet other) { uuid = other.uuid; position = other.position; active = other.active; } @Override public Facet deepCopy() { ManagedFacet copy = new ManagedFacet(); copy.set((DefaultFacet)this); copy.set((ManagedFacet)this); return copy; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :