Statistics
| Revision:

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

History | View | Annotate | Download (5.23 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 of a collection of layers.</p> 
51
 */
52
public interface LayerCollection {
53
        /**
54
         * Adds a listener about the events produced on a layers collection.
55
         *
56
         * @param listener a <code>LayerCollectionListener</code>
57
         * 
58
         * @see #removeLayerCollectionListener(LayerCollectionListener)
59
         */
60
        public void addLayerCollectionListener(LayerCollectionListener listener);
61
        /**
62
         * Removes a listener about the events produced on a layers collection.
63
         *
64
         * @param listener a <code>LayerCollectionListener</code>
65
         * 
66
         * @see #addLayerCollectionListener(LayerCollectionListener)
67
         */
68
        public void removeLayerCollectionListener(LayerCollectionListener listener);
69

    
70
        /**
71
         * Adds a layer at the end of the layers list.
72
         *
73
         * @param layer a layer
74
         *
75
         * @throws CancelationException any exception produced during the cancellation of the driver.
76
         * 
77
         * @see #removeLayer(FLayer)
78
         * @see #removeLayer(int)
79
         * @see #removeLayer(String)
80
         */
81
        public void addLayer(FLayer layer) throws CancelationException, LoadLayerException;
82

    
83
        /**
84
         * <p>Moves a layer of the collection to another position in internal list. It does not consider subnodes.</p>
85
         *
86
         * @param from origin position
87
         * @param to destination position
88
         *
89
         * @throws CancelationException any exception produced during the cancellation of the driver.
90
         */
91
        public void moveTo(int from, int to) throws CancelationException;
92

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

    
106
        /**
107
         * Removes a layer using its identifier.
108
         *
109
         * @param idLayer layer id
110
         * 
111
         * @see #removeLayer(FLayer)
112
         * @see #removeLayer(String)
113
         * @see #addLayer(FLayer)
114
         */
115
        public void removeLayer(int idLayer);
116
        /**
117
         * Removes a layer using its name.
118
         *
119
         * @param layerName the name of the layer
120
         * 
121
         * @see #removeLayer(FLayer)
122
         * @see #removeLayer(int)
123
         * @see #addLayer(FLayer)
124
         */
125
        public void removeLayer(String layerName);
126
        /**
127
         * Returns an array with all visible layers in this collection.
128
         *
129
         * @return array with layers, or <code>null</code> if no there is no layer visible
130
         * 
131
         * @see #setAllVisibles(boolean)
132
         */
133
        public FLayer[] getVisibles();
134
        /**
135
         * Returns an array with all active layers in this collection.
136
         *
137
         * @return array with layers, or <code>null</code> if no there is no layer active
138
         * 
139
         * @see #setAllActives(boolean)
140
         */
141
        public FLayer[] getActives();
142
        /**
143
         * Returns the ith-output directed son (from bottom up) of this collection.
144
         *
145
         * @param index index of the ith-output layer in this collection.
146
         *
147
         * @return a layer
148
         * 
149
         * @see #getLayer(String)
150
         */
151
        public FLayer getLayer(int index);
152

    
153

    
154
        /**
155
         * Returns a directed son layer of this collection, using its name.
156
         *
157
         * @param layerName name of a layer of this collection
158
         *
159
         * @return a layer
160
         * 
161
         * @see #getLayer(int)
162
         */
163
        public FLayer getLayer(String layerName);
164

    
165
        /**
166
         * <p>Returns the number of layers that are at the same level as this one.</p>
167
         * 
168
         * <p>Doesn't counts the sublayers of a <code>FLayers</code> node object.</p>
169
         *
170
         * @return number >= 0 with layers that are at the same level
171
         * 
172
         * @see #getLayer(int)
173
         * @see #getLayer(String)
174
         */
175
        public int getLayersCount();
176

    
177
        /**
178
         * Changes the status of all layers to active or inactive.
179
         *
180
         * @param active the boolean to be set
181
         * 
182
         * @see #getActives()
183
         */
184
        public void setAllActives(boolean active);
185

    
186
        /**
187
         * Changes the status of all layers to visible or invisible.
188
         *
189
         * @param visible the boolean to be set
190
         * 
191
         * @see #getVisibles()
192
         */
193
        public void setAllVisibles(boolean visible);
194
}