Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / layerOperations / LayerCollection.java @ 20098

History | View | Annotate | Download (5.44 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 com.iver.cit.gvsig.fmap.layers.layerOperations;
42

    
43
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException;
44
import com.iver.cit.gvsig.fmap.layers.CancelationException;
45
import com.iver.cit.gvsig.fmap.layers.FLayer;
46
import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener;
47

    
48

    
49
/**
50
 * <p>Interface with methods for a collection of layers.</p> 
51
 */
52
public interface LayerCollection {
53
        /**
54
         * <p>Adds a listener of events produced on a collection of layers.</p>
55
         *
56
         * @param listener a <code>LayerCollectionListener</code>
57
         * 
58
         * @see #removeLayerCollectionListener(LayerCollectionListener)
59
         */
60
        public void addLayerCollectionListener(LayerCollectionListener listener);
61

    
62
        /**
63
         * <p>Removes a listener of events produced on a collection of layers.</p>
64
         *
65
         * @param listener a <code>LayerCollectionListener</code>
66
         * 
67
         * @see #addLayerCollectionListener(LayerCollectionListener)
68
         */
69
        public void removeLayerCollectionListener(LayerCollectionListener listener);
70

    
71
        /**
72
         * <p>Adds a new layer to this collection.</p>
73
         *
74
         * @param layer the new layer
75
         *
76
         * @throws CancelationException any exception produced during the cancellation of the driver.
77
         * @throws LoadLayerException any exception produced loading the layer.
78
         * 
79
         * @see #removeLayer(FLayer)
80
         * @see #removeLayer(int)
81
         * @see #removeLayer(String)
82
         */
83
        public void addLayer(FLayer layer) throws CancelationException, LoadLayerException;
84

    
85
        /**
86
         * <p>Moves a layer of the collection to another position in internal list. It doesn't consider sub-nodes of layers.</p>
87
         *
88
         * @param from origin position
89
         * @param to destination position
90
         *
91
         * @throws CancelationException any exception produced during the cancellation of the driver.
92
         */
93
        public void moveTo(int from, int to) throws CancelationException;
94

    
95
        /**
96
         * <p>Removes a layer from this collection.</p>
97
         *
98
         * @param lyr a layer
99
         *
100
         * @throws CancelationException any exception produced during the cancellation of the driver.
101
         * 
102
         * @see #removeLayer(int)
103
         * @see #removeLayer(String)
104
         * @see #addLayer(FLayer)
105
         */
106
        public void removeLayer(FLayer lyr) throws CancelationException;
107

    
108
        /**
109
         * <p>Removes a layer using its identifier.</p>
110
         *
111
         * @param idLayer layer identifier
112
         * 
113
         * @see #removeLayer(FLayer)
114
         * @see #removeLayer(String)
115
         * @see #addLayer(FLayer)
116
         */
117
        public void removeLayer(int idLayer);
118

    
119
        /**
120
         * <p>Removes a layer using its name.</p>
121
         *
122
         * @param layerName the name of the layer
123
         * 
124
         * @see #removeLayer(FLayer)
125
         * @see #removeLayer(int)
126
         * @see #addLayer(FLayer)
127
         */
128
        public void removeLayer(String layerName);
129

    
130
        /**
131
         * <p>Returns an array with all visible layers in this collection.</p>
132
         *
133
         * @return array with first-level visible layer nodes, or <code>null</code> if no there is no layer visible
134
         * 
135
         * @see #setAllVisibles(boolean)
136
         */
137
        public FLayer[] getVisibles();
138

    
139
        /**
140
         * <p>Returns an array with all active layers in this collection.</p>
141
         *
142
         * @return array with first-level active layer nodes, or <code>null</code> if no there is no layer actived
143
         * 
144
         * @see #setAllActives(boolean)
145
         */
146
        public FLayer[] getActives();
147

    
148
        /**
149
         * <p>Returns the ith-output directed son (from bottom up) of this collection.</p>
150
         *
151
         * @param index index of the ith-output layer in this collection.
152
         *
153
         * @return a layer
154
         * 
155
         * @see #getLayer(String)
156
         */
157
        public FLayer getLayer(int index);
158

    
159
        /**
160
         * <p>Returns a first-level layer of this collection, using its name.</p>
161
         *
162
         * @param layerName name of a layer of this collection
163
         *
164
         * @return a layer
165
         * 
166
         * @see #getLayer(int)
167
         */
168
        public FLayer getLayer(String layerName);
169

    
170
        /**
171
         * <p>Returns the number of layers that are at the first level inside this one.</p>
172
         * 
173
         * <p>Doesn't counts the sublayers (of <code>FLayers</code> subnodes).</p>
174
         *
175
         * @return number >= 0 with layers that are at the same first-level
176
         * 
177
         * @see #getLayer(int)
178
         * @see #getLayer(String)
179
         */
180
        public int getLayersCount();
181

    
182
        /**
183
         * <p>Changes the status of all layers to active or inactive.</p>
184
         *
185
         * @param active a boolean value
186
         * 
187
         * @see #getActives()
188
         */
189
        public void setAllActives(boolean active);
190

    
191
        /**
192
         * <p>Changes the status of all layers to visible or invisible.</p>
193
         *
194
         * @param visible a boolean value
195
         * 
196
         * @see #getVisibles()
197
         */
198
        public void setAllVisibles(boolean visible);
199
}