Statistics
| Revision:

svn-gvsig-desktop / tags / v1_1_Build_1014 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / layerOperations / LayerCollection.java @ 13593

History | View | Annotate | Download (5.15 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.fmap.layers.CancelationException;
44
import com.iver.cit.gvsig.fmap.layers.FLayer;
45
import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener;
46

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

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

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

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

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

    
105
        /**
106
         * Removes a layer using its identifier.
107
         *
108
         * @param idLayer layer id
109
         * 
110
         * @see #removeLayer(FLayer)
111
         * @see #removeLayer(String)
112
         * @see #addLayer(FLayer)
113
         */
114
        public void removeLayer(int idLayer);
115

    
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
        /**
128
         * Returns an array with all visible layers in this collection.
129
         *
130
         * @return array with layers, or <code>null</code> if no there is no layer visible
131
         * 
132
         * @see #setAllVisibles(boolean)
133
         */
134
        public FLayer[] getVisibles();
135

    
136
        /**
137
         * Returns an array with all active layers in this collection.
138
         *
139
         * @return array with layers, or <code>null</code> if no there is no layer active
140
         * 
141
         * @see #setAllActives(boolean)
142
         */
143
        public FLayer[] getActives();
144

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

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

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

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

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