comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WMSLayerFacet.java @ 7740:72d0cec59c78

Implement deepCopy on WMSLayerFacet WMSDBLayerFacet and WSPLGENLayerFacet This fixes double map-out and dissappearance of visible floodmap if cloning happened.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 06 Feb 2014 14:47:29 +0100
parents af13ceeba52a
children 8abc86160959
comparison
equal deleted inserted replaced
7739:44a9233c62eb 7740:72d0cec59c78
171 public boolean isQueryable() { 171 public boolean isQueryable() {
172 return false; 172 return false;
173 } 173 }
174 174
175 175
176 /** Clone facet-bound data. */
177 protected void cloneData(WMSLayerFacet copy) {
178 copy.type = type;
179 copy.stateId = stateId;
180 copy.hash = hash;
181
182 if (layers != null) {
183 copy.layers = new ArrayList<String>(layers);
184 }
185 else {
186 copy.layers = new ArrayList<String>();
187 }
188
189 copy.url = url;
190 copy.extent = extent;
191 copy.srid = srid;
192 }
193
176 @Override 194 @Override
177 public Facet deepCopy() { 195 public Facet deepCopy() {
178 WMSLayerFacet copy = new WMSLayerFacet(); 196 WMSLayerFacet copy = new WMSLayerFacet();
179 copy.set(this); 197 copy.set(this);
180 198
181 copy.type = type; 199 cloneData(copy);
182 copy.layers = new ArrayList<String>(layers);
183 copy.stateId = stateId;
184 copy.hash = hash;
185 copy.url = url;
186 copy.extent = extent;
187 copy.srid = srid;
188 200
189 return copy; 201 return copy;
190 } 202 }
191 } 203 }
192 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 204 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org