root / trunk / libraries / libGPE / src-test / org / gvsig / gpe / containers / Layer.java @ 37959
History | View | Annotate | Download (4.08 KB)
1 |
package org.gvsig.gpe.containers; |
---|---|
2 |
|
3 |
import java.util.ArrayList; |
4 |
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
6 |
*
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
8 |
*
|
9 |
* This program is free software; you can redistribute it and/or
|
10 |
* modify it under the terms of the GNU General Public License
|
11 |
* as published by the Free Software Foundation; either version 2
|
12 |
* of the License, or (at your option) any later version.
|
13 |
*
|
14 |
* This program is distributed in the hope that it will be useful,
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
* GNU General Public License for more details.
|
18 |
*
|
19 |
* You should have received a copy of the GNU General Public License
|
20 |
* along with this program; if not, write to the Free Software
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
22 |
*
|
23 |
* For more information, contact:
|
24 |
*
|
25 |
* Generalitat Valenciana
|
26 |
* Conselleria d'Infraestructures i Transport
|
27 |
* Av. Blasco Ib??ez, 50
|
28 |
* 46010 VALENCIA
|
29 |
* SPAIN
|
30 |
*
|
31 |
* +34 963862235
|
32 |
* gvsig@gva.es
|
33 |
* www.gvsig.gva.es
|
34 |
*
|
35 |
* or
|
36 |
*
|
37 |
* IVER T.I. S.A
|
38 |
* Salamanca 50
|
39 |
* 46005 Valencia
|
40 |
* Spain
|
41 |
*
|
42 |
* +34 963163400
|
43 |
* dac@iver.es
|
44 |
*/
|
45 |
/* CVS MESSAGES:
|
46 |
*
|
47 |
* $Id: Layer.java 81 2007-05-02 11:46:50Z jorpiell $
|
48 |
* $Log$
|
49 |
* Revision 1.3 2007/05/02 11:46:07 jorpiell
|
50 |
* Writing tests updated
|
51 |
*
|
52 |
* Revision 1.2 2007/04/19 07:23:20 jorpiell
|
53 |
* Add the add methods to teh contenhandler and change the register mode
|
54 |
*
|
55 |
* Revision 1.1 2007/04/14 16:06:35 jorpiell
|
56 |
* Add the container classes
|
57 |
*
|
58 |
*
|
59 |
*/
|
60 |
/**
|
61 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
62 |
*/
|
63 |
public class Layer { |
64 |
private String name = null; |
65 |
private String description = null; |
66 |
private String id = null; |
67 |
private Layer parentLayer = null; |
68 |
private ArrayList features = new ArrayList(); |
69 |
private ArrayList metadata = new ArrayList(); |
70 |
private ArrayList layers = new ArrayList(); |
71 |
private String srs = null; |
72 |
private Bbox bbox = null; |
73 |
|
74 |
/**
|
75 |
* @return the bbox
|
76 |
*/
|
77 |
public Bbox getBbox() {
|
78 |
return bbox;
|
79 |
} |
80 |
|
81 |
/**
|
82 |
* @param bbox the bbox to set
|
83 |
*/
|
84 |
public void setBbox(Object bbox) { |
85 |
if (bbox != null){ |
86 |
this.bbox = (Bbox)bbox;
|
87 |
} |
88 |
} |
89 |
|
90 |
/**
|
91 |
* @return the srs
|
92 |
*/
|
93 |
public String getSrs() { |
94 |
return srs;
|
95 |
} |
96 |
|
97 |
/**
|
98 |
* @param srs the srs to set
|
99 |
*/
|
100 |
public void setSrs(String srs) { |
101 |
this.srs = srs;
|
102 |
} |
103 |
|
104 |
public Layer() {
|
105 |
super();
|
106 |
} |
107 |
|
108 |
/**
|
109 |
* @return the description
|
110 |
*/
|
111 |
public String getDescription() { |
112 |
return description;
|
113 |
} |
114 |
|
115 |
/**
|
116 |
* @param description the description to set
|
117 |
*/
|
118 |
public void setDescription(String description) { |
119 |
this.description = description;
|
120 |
} |
121 |
|
122 |
/**
|
123 |
* @return the id
|
124 |
*/
|
125 |
public String getId() { |
126 |
return id;
|
127 |
} |
128 |
|
129 |
/**
|
130 |
* @param id the id to set
|
131 |
*/
|
132 |
public void setId(String id) { |
133 |
this.id = id;
|
134 |
} |
135 |
|
136 |
/**
|
137 |
* @return the name
|
138 |
*/
|
139 |
public String getName() { |
140 |
return name;
|
141 |
} |
142 |
|
143 |
/**
|
144 |
* @param name the name to set
|
145 |
*/
|
146 |
public void setName(String name) { |
147 |
this.name = name;
|
148 |
} |
149 |
|
150 |
/**
|
151 |
* @return the features
|
152 |
*/
|
153 |
public ArrayList getFeatures() { |
154 |
return features;
|
155 |
} |
156 |
|
157 |
/**
|
158 |
* Adds a new feature
|
159 |
* @param layer
|
160 |
*/
|
161 |
public void addFeature(Feature feature){ |
162 |
features.add(feature); |
163 |
} |
164 |
|
165 |
/**
|
166 |
* Adds a new layer
|
167 |
* @param layer
|
168 |
*/
|
169 |
public void addLayer(Layer layer){ |
170 |
layers.add(layer); |
171 |
} |
172 |
|
173 |
/**
|
174 |
* Adds a new layer
|
175 |
* @param layer
|
176 |
*/
|
177 |
public void addFeature(Object feature){ |
178 |
if (feature instanceof Feature){ |
179 |
features.add(feature); |
180 |
} |
181 |
} |
182 |
|
183 |
/**
|
184 |
* @return the parentLayer
|
185 |
*/
|
186 |
public Layer getParentLayer() {
|
187 |
return parentLayer;
|
188 |
} |
189 |
|
190 |
/**
|
191 |
* @param parentLayer the parentLayer to set
|
192 |
*/
|
193 |
public void setParentLayer(Object parentLayer) { |
194 |
if (parentLayer != null){ |
195 |
this.parentLayer = (Layer)parentLayer;
|
196 |
} |
197 |
} |
198 |
|
199 |
/**
|
200 |
* @return the layers
|
201 |
*/
|
202 |
public ArrayList getLayers() { |
203 |
return layers;
|
204 |
} |
205 |
|
206 |
|
207 |
/**
|
208 |
* @return the layer at position i
|
209 |
* @param i
|
210 |
* Layer position
|
211 |
*/
|
212 |
public Layer getLayerAt(int i) { |
213 |
return (Layer)layers.get(i);
|
214 |
} |
215 |
|
216 |
public void addMetadata(MetaData subData) { |
217 |
if (subData instanceof MetaData){ |
218 |
this.metadata.add(subData);
|
219 |
} |
220 |
|
221 |
} |
222 |
} |