Revision 2378 org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSLayerNode.java

View differences:

WMSLayerNode.java
24 24
import java.awt.Dimension;
25 25
import java.util.ArrayList;
26 26
import java.util.List;
27
import java.util.Vector;
28 27

  
29 28
import org.gvsig.raster.wms.io.time.DefaultDimension;
30 29
import org.gvsig.raster.wms.io.time.RemoteTimeDimension;
......
44 43
public class WMSLayerNode implements Persistent {
45 44
    private String                         _name              = null;
46 45
    private String                         _title             = null;
47
	private Vector                         srs                = null;
46
	private List<String>                   srs                = null;
48 47
    private boolean                        queryable;
49 48
    private boolean                        transparency;
50 49
    private String                         lAbstract          = null;
51 50
    private String                         latLonBox          = null;
52 51
    private int                            selectedStyleIndex = 0;
53
    private ArrayList<RemoteWMSStyle>      styles             = new ArrayList<RemoteWMSStyle>();
54
    private ArrayList<RemoteTimeDimension> dimensions         = null;
55
    private ArrayList<String>              keywords           = null;
56
    private ArrayList                      children           = new ArrayList();
52
    private List<RemoteWMSStyle>           styles             = new ArrayList<RemoteWMSStyle>();
53
    private List<RemoteTimeDimension>      dimensions         = null;
54
    private List<String>                   keywords           = null;
55
    private List<WMSLayerNode>             children           = new ArrayList<WMSLayerNode>();
57 56
    private WMSLayerNode                   _parent            = null;
58 57
	private Dimension                      fixedSize          = null;
59 58
	
60
	/*
61
	 * (non-Javadoc)
62
	 * @see org.gvsig.tools.persistence.Persistent#loadFromState(org.gvsig.tools.persistence.PersistentState)
63
	 */
64 59
	public void loadFromState(PersistentState state) throws PersistenceException {
65 60
		this._name = state.getString("_name");
66 61
		this._title = state.getString("_title");
67
		
68
		List<String> srs = state.getList("srs");
69
		if(srs != null) {
70
			this.srs = new Vector();
71
			this.srs.addAll(srs);
72
		}
73
		
62
		this.srs = state.getList("srs");
74 63
		this.queryable = state.getBoolean("queryable");
75 64
		this.transparency = state.getBoolean("transparency");
76 65
		this.lAbstract = state.getString("lAbstract");
77 66
		this.latLonBox = state.getString("latLonBox");
78 67
		this.selectedStyleIndex = state.getInt("selectedStyleIndex");
79
		
80
		List<RemoteWMSStyle> styles = state.getList("styles");
81
		if(styles != null) {
82
			this.styles = new ArrayList<RemoteWMSStyle>();
83
			this.styles.addAll(styles);
84
		}
85
		
86
		List<RemoteTimeDimension> dimensions = state.getList("dimensions");
87
		if(dimensions != null) {
88
			this.dimensions = new ArrayList<RemoteTimeDimension>();
89
			this.dimensions.addAll(dimensions);
90
		}
91
		
92
		List<String> keywords = state.getList("keywords");
93
		if(keywords != null) {
94
			this.keywords = new ArrayList<String>();
95
			this.keywords.addAll(keywords);
96
		}
97
		
98
		List<WMSLayerNode> children = state.getList("children");
99
		if(children != null) {
100
			this.children = new ArrayList<WMSLayerNode>();
101
			this.children.addAll(children);
102
		}
103
		
68
		this.styles = state.getList("styles");
69
		this.dimensions = state.getList("dimensions");
70
		this.keywords = state.getList("keywords");
71
		this.children = state.getList("children");
104 72
		this._parent = (WMSLayerNode)state.get("_parent");
105 73
		this.fixedSize = (Dimension)state.get("fixedSize");
106 74
	}
107 75
	
108
	/*
109
	 * (non-Javadoc)
110
	 * @see org.gvsig.tools.persistence.Persistent#saveToState(org.gvsig.tools.persistence.PersistentState)
111
	 */
112 76
	public void saveToState(PersistentState state) throws PersistenceException {
113 77
		state.set("_name", _name);
114 78
		state.set("_title", _title);
......
162 126
        return _name;
163 127
    }
164 128

  
165
    public ArrayList getChildren() {
129
    public List<WMSLayerNode> getChildren() {
166 130
        return children;
167 131
    }
168 132

  
......
176 140
    /**
177 141
     * @return Returns the namedStyles.
178 142
     */
179
    public ArrayList<RemoteWMSStyle> getStyles() {
143
    public List<RemoteWMSStyle> getStyles() {
180 144
        return styles;
181 145
    }
182 146

  
183
    public ArrayList<String> getKeywords() {
147
    public List<String> getKeywords() {
184 148
    	return keywords;
185 149
    }
186 150
   
......
201 165
    /**
202 166
     * @return Returns the srs.
203 167
     */
204
    public Vector getAllSrs() {
168
    public List<String> getAllSrs() {
205 169
        if ((srs.size() == 0) && _parent!=null)
206 170
            return _parent.getAllSrs();
207 171
        return srs;
......
210 174
    /**
211 175
     * @param srs The srs to set.
212 176
     */
213
    public void setSrs(Vector srs) {
177
    public void setSrs(List<String> srs) {
214 178
        this.srs = srs;
215 179
    }
216 180

  
......
221 185
        return _title;
222 186
    }
223 187

  
224
    /*
225
     * (non-Javadoc)
226
     * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#setTitle(java.lang.String)
227
     */
228 188
    public void setTitle(String title) {
229 189
        this._title = title.trim();
230 190
    }
......
247 207
     * Sets the list of sons of this layer.
248 208
     * @param children
249 209
     */
250
    public void setChildren(ArrayList children) {
210
    public void setChildren(List<WMSLayerNode> children) {
251 211
        this.children = children;
252 212
    }
253 213

  
254
    /*
255
     * (non-Javadoc)
256
     * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#getParent()
257
     */
258 214
    public WMSLayerNode getParent() {
259 215
        return _parent;
260 216
    }
261 217
    
262
    /*
263
     * (non-Javadoc)
264
     * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#setParent(org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode)
265
     */
266 218
    public void setParent(WMSLayerNode parentNode) {
267 219
        this._parent = parentNode;
268 220
    }
269 221

  
270
    /*
271
     * (non-Javadoc)
272
     * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteLayerNode#getDimensions()
273
     */
274
    public ArrayList<RemoteTimeDimension> getDimensions() {
222
    public List<RemoteTimeDimension> getDimensions() {
275 223
        return dimensions;
276 224
    }
277 225

  

Also available in: Unified diff