root / branches / v2_0_0_prep / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / layers / operations / LayerCollection.java @ 21200
History | View | Annotate | Download (5.64 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package org.gvsig.fmap.mapcontext.layers.operations; |
42 |
|
43 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
44 |
import org.gvsig.fmap.mapcontext.layers.CancelationException; |
45 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
46 |
import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener; |
47 |
|
48 |
|
49 |
|
50 |
/**
|
51 |
* <p>Interface with methods for a collection of layers.</p>
|
52 |
*/
|
53 |
public interface LayerCollection { |
54 |
/**
|
55 |
* <p>Adds a listener of events produced on a collection of layers.</p>
|
56 |
*
|
57 |
* @param listener a <code>LayerCollectionListener</code>
|
58 |
*
|
59 |
* @see #removeLayerCollectionListener(LayerCollectionListener)
|
60 |
*/
|
61 |
public void addLayerCollectionListener(LayerCollectionListener listener); |
62 |
|
63 |
/**
|
64 |
* <p>Removes a listener of events produced on a collection of layers.</p>
|
65 |
*
|
66 |
* @param listener a <code>LayerCollectionListener</code>
|
67 |
*
|
68 |
* @see #addLayerCollectionListener(LayerCollectionListener)
|
69 |
*/
|
70 |
public void removeLayerCollectionListener(LayerCollectionListener listener); |
71 |
|
72 |
/**
|
73 |
* <p>Adds a new layer to this collection.</p>
|
74 |
*
|
75 |
* @param layer the new layer
|
76 |
*
|
77 |
* @throws CancelationException any exception produced during the cancellation of the driver.
|
78 |
* @throws LoadLayerException any exception produced loading the layer.
|
79 |
*
|
80 |
* @see #removeLayer(FLayer)
|
81 |
* @see #removeLayer(int)
|
82 |
* @see #removeLayer(String)
|
83 |
*/
|
84 |
public void addLayer(FLayer layer) throws CancelationException, LoadLayerException; |
85 |
|
86 |
/**
|
87 |
* <p>Moves a layer of the collection to another position in internal list. It doesn't consider sub-nodes of layers.</p>
|
88 |
*
|
89 |
* @param from origin position
|
90 |
* @param to destination position
|
91 |
*
|
92 |
* @throws CancelationException any exception produced during the cancellation of the driver.
|
93 |
*/
|
94 |
public void moveTo(int from, int to) throws CancelationException; |
95 |
|
96 |
/**
|
97 |
* <p>Removes a layer from this collection.</p>
|
98 |
*
|
99 |
* @param lyr a layer
|
100 |
*
|
101 |
* @throws CancelationException any exception produced during the cancellation of the driver.
|
102 |
*
|
103 |
* @see #removeLayer(int)
|
104 |
* @see #removeLayer(String)
|
105 |
* @see #addLayer(FLayer)
|
106 |
*/
|
107 |
public void removeLayer(FLayer lyr) throws CancelationException; |
108 |
|
109 |
/**
|
110 |
* <p>Removes a layer using its identifier.</p>
|
111 |
*
|
112 |
* @param idLayer layer identifier
|
113 |
*
|
114 |
* @see #removeLayer(FLayer)
|
115 |
* @see #removeLayer(String)
|
116 |
* @see #addLayer(FLayer)
|
117 |
*/
|
118 |
public void removeLayer(int idLayer); |
119 |
|
120 |
/**
|
121 |
* <p>Removes a layer using its name.</p>
|
122 |
*
|
123 |
* @param layerName the name of the layer
|
124 |
*
|
125 |
* @see #removeLayer(FLayer)
|
126 |
* @see #removeLayer(int)
|
127 |
* @see #addLayer(FLayer)
|
128 |
*/
|
129 |
public void removeLayer(String layerName); |
130 |
|
131 |
/**
|
132 |
* <p>Returns an array with all visible layers in this collection.</p>
|
133 |
*
|
134 |
* @return array with first-level visible layer nodes, or <code>null</code> if no there is no layer visible
|
135 |
*
|
136 |
* @see #setAllVisibles(boolean)
|
137 |
*/
|
138 |
public FLayer[] getVisibles(); |
139 |
|
140 |
/**
|
141 |
* <p>Returns an array with all active layers in this collection.</p>
|
142 |
*
|
143 |
* @return array with first-level active layer nodes, or <code>null</code> if no there is no layer actived
|
144 |
*
|
145 |
* @see #setAllActives(boolean)
|
146 |
*/
|
147 |
public FLayer[] getActives(); |
148 |
|
149 |
/**
|
150 |
* <p>Returns the ith-output directed son (from bottom up) of this collection.</p>
|
151 |
*
|
152 |
* @param index index of the ith-output layer in this collection.
|
153 |
*
|
154 |
* @return a layer
|
155 |
*
|
156 |
* @see #getLayer(String)
|
157 |
*/
|
158 |
public FLayer getLayer(int index); |
159 |
|
160 |
/**
|
161 |
* <p>Returns a first-level layer of this collection, using its name.</p>
|
162 |
*
|
163 |
* @param layerName name of a layer of this collection
|
164 |
*
|
165 |
* @return a layer
|
166 |
*
|
167 |
* @see #getLayer(int)
|
168 |
*/
|
169 |
public FLayer getLayer(String layerName); |
170 |
|
171 |
/**
|
172 |
* <p>Returns the number of layers that are at the first level inside this one.</p>
|
173 |
*
|
174 |
* <p>Doesn't counts the sublayers (of <code>FLayers</code> subnodes).</p>
|
175 |
*
|
176 |
* @return number >= 0 with layers that are at the same first-level
|
177 |
*
|
178 |
* @see #getLayer(int)
|
179 |
* @see #getLayer(String)
|
180 |
*/
|
181 |
public int getLayersCount(); |
182 |
|
183 |
/**
|
184 |
* <p>Changes the status of all layers to active or inactive.</p>
|
185 |
*
|
186 |
* @param active a boolean value
|
187 |
*
|
188 |
* @see #getActives()
|
189 |
*/
|
190 |
public void setAllActives(boolean active); |
191 |
|
192 |
/**
|
193 |
* <p>Changes the status of all layers to visible or invisible.</p>
|
194 |
*
|
195 |
* @param visible a boolean value
|
196 |
*
|
197 |
* @see #getVisibles()
|
198 |
*/
|
199 |
public void setAllVisibles(boolean visible); |
200 |
} |