root / trunk / libraries / libGPE / src-test / org / gvsig / gpe / containers / Layer.java @ 11663
History | View | Annotate | Download (3.87 KB)
1 | 11209 | jorpiell | 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$
|
||
48 | * $Log$
|
||
49 | 11435 | jorpiell | * 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 | 11247 | jorpiell | * 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 | 11209 | jorpiell | * 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 | 11435 | jorpiell | private ArrayList layers = new ArrayList(); |
70 | 11209 | jorpiell | private String srs = null; |
71 | private Bbox bbox = null; |
||
72 | |||
73 | /**
|
||
74 | * @return the bbox
|
||
75 | */
|
||
76 | public Bbox getBbox() {
|
||
77 | return bbox;
|
||
78 | } |
||
79 | |||
80 | /**
|
||
81 | * @param bbox the bbox to set
|
||
82 | */
|
||
83 | public void setBbox(Object bbox) { |
||
84 | if (bbox != null){ |
||
85 | this.bbox = (Bbox)bbox;
|
||
86 | } |
||
87 | } |
||
88 | |||
89 | /**
|
||
90 | * @return the srs
|
||
91 | */
|
||
92 | public String getSrs() { |
||
93 | return srs;
|
||
94 | } |
||
95 | |||
96 | /**
|
||
97 | * @param srs the srs to set
|
||
98 | */
|
||
99 | public void setSrs(String srs) { |
||
100 | this.srs = srs;
|
||
101 | } |
||
102 | |||
103 | public Layer() {
|
||
104 | super();
|
||
105 | } |
||
106 | |||
107 | /**
|
||
108 | * @return the description
|
||
109 | */
|
||
110 | public String getDescription() { |
||
111 | return description;
|
||
112 | } |
||
113 | |||
114 | /**
|
||
115 | * @param description the description to set
|
||
116 | */
|
||
117 | public void setDescription(String description) { |
||
118 | this.description = description;
|
||
119 | } |
||
120 | |||
121 | /**
|
||
122 | * @return the id
|
||
123 | */
|
||
124 | public String getId() { |
||
125 | return id;
|
||
126 | } |
||
127 | |||
128 | /**
|
||
129 | * @param id the id to set
|
||
130 | */
|
||
131 | public void setId(String id) { |
||
132 | this.id = id;
|
||
133 | } |
||
134 | |||
135 | /**
|
||
136 | * @return the name
|
||
137 | */
|
||
138 | public String getName() { |
||
139 | return name;
|
||
140 | } |
||
141 | |||
142 | /**
|
||
143 | * @param name the name to set
|
||
144 | */
|
||
145 | public void setName(String name) { |
||
146 | this.name = name;
|
||
147 | } |
||
148 | |||
149 | /**
|
||
150 | * @return the features
|
||
151 | */
|
||
152 | public ArrayList getFeatures() { |
||
153 | return features;
|
||
154 | } |
||
155 | |||
156 | /**
|
||
157 | 11435 | jorpiell | * Adds a new feature
|
158 | 11209 | jorpiell | * @param layer
|
159 | */
|
||
160 | public void addFeature(Feature feature){ |
||
161 | features.add(feature); |
||
162 | } |
||
163 | 11247 | jorpiell | |
164 | /**
|
||
165 | * Adds a new layer
|
||
166 | * @param layer
|
||
167 | */
|
||
168 | 11435 | jorpiell | public void addLayer(Layer layer){ |
169 | layers.add(layer); |
||
170 | } |
||
171 | |||
172 | /**
|
||
173 | * Adds a new layer
|
||
174 | * @param layer
|
||
175 | */
|
||
176 | 11247 | jorpiell | public void addFeature(Object feature){ |
177 | if (feature instanceof Feature){ |
||
178 | features.add(feature); |
||
179 | } |
||
180 | } |
||
181 | 11209 | jorpiell | |
182 | /**
|
||
183 | * @return the parentLayer
|
||
184 | */
|
||
185 | public Layer getParentLayer() {
|
||
186 | return parentLayer;
|
||
187 | } |
||
188 | |||
189 | /**
|
||
190 | * @param parentLayer the parentLayer to set
|
||
191 | */
|
||
192 | public void setParentLayer(Object parentLayer) { |
||
193 | if (parentLayer != null){ |
||
194 | this.parentLayer = (Layer)parentLayer;
|
||
195 | } |
||
196 | } |
||
197 | 11435 | jorpiell | |
198 | /**
|
||
199 | * @return the layers
|
||
200 | */
|
||
201 | public ArrayList getLayers() { |
||
202 | return layers;
|
||
203 | } |
||
204 | |||
205 | |||
206 | /**
|
||
207 | * @return the layer at position i
|
||
208 | * @param i
|
||
209 | * Layer position
|
||
210 | */
|
||
211 | public Layer getLayerAt(int i) { |
||
212 | return (Layer)layers.get(i);
|
||
213 | } |
||
214 | 11209 | jorpiell | } |