Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / layers / operations / LayerCollection.java @ 26225

History | View | Annotate | Download (5.83 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 java.awt.Graphics2D;
44

    
45
import org.gvsig.fmap.mapcontext.ViewPort;
46
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
47
import org.gvsig.fmap.mapcontext.layers.CancelationException;
48
import org.gvsig.fmap.mapcontext.layers.FLayer;
49
import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener;
50

    
51

    
52

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

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

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

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

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

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

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

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

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

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

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

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

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

    
195
        /**
196
         * <p>Changes the status of all layers to visible or invisible.</p>
197
         *
198
         * @param visible a boolean value
199
         *
200
         * @see #getVisibles()
201
         */
202
        public void setAllVisibles(boolean visible);
203

    
204

    
205
        public void beginDraw(Graphics2D g, ViewPort viewPort);
206
        public void endDraw(Graphics2D g, ViewPort viewPort);
207

    
208
}