Mercurial > dive4elements > river
changeset 7742:869f54874c3c
merged
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 06 Feb 2014 15:05:29 +0100 |
parents | 69c8d33a05e8 (current diff) 72d0cec59c78 (diff) |
children | a67bd7744827 |
files | |
diffstat | 3 files changed, 55 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WMSDBLayerFacet.java Thu Feb 06 15:04:29 2014 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WMSDBLayerFacet.java Thu Feb 06 15:05:29 2014 +0100 @@ -9,6 +9,7 @@ package org.dive4elements.river.artifacts.model.map; import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; +import org.dive4elements.artifactdatabase.state.Facet; public class WMSDBLayerFacet extends WMSLayerFacet { @@ -110,5 +111,27 @@ public boolean isQueryable() { return true; } + + /** Clone Facet-bound data. */ + protected void cloneData(WMSDBLayerFacet copy) { + super.cloneData(copy); + copy.setFilter(this.getFilter()); + copy.setData(this.getData()); + copy.setGeometryType(this.getGeometryType()); + copy.setConnection(this.getConnection()); + copy.setConnectionType(this.getConnectionType()); + copy.setLabelItem(this.getLabelItem()); + } + + /** Copy deeply. */ + @Override + public Facet deepCopy() { + WMSDBLayerFacet copy = new WMSDBLayerFacet(); + copy.set(this); + + cloneData(copy); + + return copy; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WMSLayerFacet.java Thu Feb 06 15:04:29 2014 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WMSLayerFacet.java Thu Feb 06 15:05:29 2014 +0100 @@ -173,18 +173,30 @@ } + /** Clone facet-bound data. */ + protected void cloneData(WMSLayerFacet copy) { + copy.type = type; + copy.stateId = stateId; + copy.hash = hash; + + if (layers != null) { + copy.layers = new ArrayList<String>(layers); + } + else { + copy.layers = new ArrayList<String>(); + } + + copy.url = url; + copy.extent = extent; + copy.srid = srid; + } + @Override public Facet deepCopy() { WMSLayerFacet copy = new WMSLayerFacet(); copy.set(this); - copy.type = type; - copy.layers = new ArrayList<String>(layers); - copy.stateId = stateId; - copy.hash = hash; - copy.url = url; - copy.extent = extent; - copy.srid = srid; + cloneData(copy); return copy; }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENLayerFacet.java Thu Feb 06 15:04:29 2014 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENLayerFacet.java Thu Feb 06 15:05:29 2014 +0100 @@ -9,6 +9,7 @@ package org.dive4elements.river.artifacts.model.map; import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; +import org.dive4elements.artifactdatabase.state.Facet; public class WSPLGENLayerFacet extends WMSLayerFacet @@ -50,5 +51,17 @@ public boolean isQueryable() { return true; } + + + /** Copy deeply. */ + @Override + public Facet deepCopy() { + WSPLGENLayerFacet copy = new WSPLGENLayerFacet(); + copy.set(this); + + cloneData(copy); + + return copy; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :