svn-gvsig-desktop / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / FLayer.java @ 3981
History | View | Annotate | Download (5.69 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; |
42 |
|
43 |
import com.iver.cit.gvsig.fmap.DriverException; |
44 |
import com.iver.cit.gvsig.fmap.FMap; |
45 |
import com.iver.cit.gvsig.fmap.ViewPort; |
46 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
47 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
48 |
|
49 |
import com.iver.utiles.XMLEntity; |
50 |
|
51 |
import org.cresques.cts.ICoordTrans; |
52 |
|
53 |
import org.cresques.geo.Projected; |
54 |
|
55 |
import java.awt.Graphics2D; |
56 |
import java.awt.geom.Rectangle2D; |
57 |
import java.awt.image.BufferedImage; |
58 |
|
59 |
|
60 |
/**
|
61 |
* Interfaz que tienen que implementar todas las capas.
|
62 |
*/
|
63 |
public interface FLayer extends Projected { |
64 |
/**
|
65 |
* Obtiene una representaci?n de la colecci?n de capas de forma recursiva
|
66 |
*
|
67 |
* @return XMLEntity.
|
68 |
* @throws XMLException
|
69 |
*/
|
70 |
XMLEntity getXMLEntity() throws XMLException;
|
71 |
|
72 |
/**
|
73 |
* Inserta las propiedades del XMLEntity al objeto actual.
|
74 |
*
|
75 |
* @param xml XMLEntity
|
76 |
*
|
77 |
* @throws XMLException
|
78 |
*/
|
79 |
void setXMLEntity(XMLEntity xml) throws XMLException; |
80 |
|
81 |
/**
|
82 |
* Inserta las propiedades del XMLEntity al objeto actual.
|
83 |
*
|
84 |
* @param xml XMLEntity
|
85 |
*
|
86 |
* @throws XMLException
|
87 |
*/
|
88 |
void setXMLEntity03(XMLEntity xml) throws XMLException; |
89 |
|
90 |
/**
|
91 |
* Pone la capa actual a activa o inactiva seg?n el boolean que se pasa
|
92 |
* como par?metro.
|
93 |
*
|
94 |
* @param selected activa.
|
95 |
*/
|
96 |
void setActive(boolean selected); |
97 |
|
98 |
/**
|
99 |
* Devuelve true si la capa esta activa.
|
100 |
*
|
101 |
* @return activa.
|
102 |
*/
|
103 |
boolean isActive();
|
104 |
|
105 |
/**
|
106 |
* Inserta un nombre a la capa.
|
107 |
*
|
108 |
* @param name nombre.
|
109 |
*/
|
110 |
void setName(String name); |
111 |
|
112 |
/**
|
113 |
* Devuelve el nombre de la capa.
|
114 |
*
|
115 |
* @return nombre de la capa.
|
116 |
*/
|
117 |
String getName();
|
118 |
|
119 |
/**
|
120 |
* Realiza las operaciones de inicializaci?n de la capa. El m?todo es
|
121 |
* invocado una ?nica vez durante la vida de la capa y justo antes de
|
122 |
* visualizar la capa
|
123 |
*
|
124 |
* @throws DriverIOException
|
125 |
*/
|
126 |
void load() throws DriverIOException; |
127 |
|
128 |
/**
|
129 |
* Pone la capa en modo visible o no visible.
|
130 |
*
|
131 |
* @param visibility visibilidad.
|
132 |
*/
|
133 |
void setVisible(boolean visibility); |
134 |
|
135 |
/**
|
136 |
* Devuelve true si la capa es visible.
|
137 |
*
|
138 |
* @return visibilidad.
|
139 |
*/
|
140 |
boolean isVisible();
|
141 |
|
142 |
/**
|
143 |
* Devuelve el FLayers padre de la capa.
|
144 |
*
|
145 |
* @return FLayers padre de la capa.
|
146 |
*/
|
147 |
public FLayers getParentLayer();
|
148 |
|
149 |
/**
|
150 |
* Devuelve el FMap al que est? a?adida la capa o null si la capa no ha
|
151 |
* sido a?adida a ning?n FMap
|
152 |
*
|
153 |
* @return FMap
|
154 |
*/
|
155 |
public FMap getFMap();
|
156 |
|
157 |
/**
|
158 |
* Inserta el FLayers padre de la capa.
|
159 |
*
|
160 |
* @param root capa padre.
|
161 |
*/
|
162 |
public void setParentLayer(FLayers root); |
163 |
|
164 |
/**
|
165 |
* Obtiene la extensi?n completa de la capa
|
166 |
*
|
167 |
* @return FullExtent.
|
168 |
*
|
169 |
* @throws DriverException
|
170 |
*/
|
171 |
Rectangle2D getFullExtent() throws DriverException; |
172 |
|
173 |
/**
|
174 |
* Dibuja la capa
|
175 |
*
|
176 |
* @param image Imagen utilizada para acelerar el dibujado en pantalla.
|
177 |
* @param g Graphics2D sobre el que dibujar.
|
178 |
* @param viewPort Propiedades de la vista.
|
179 |
* @param cancel PAra poder cancelar el dibujado.
|
180 |
*
|
181 |
* @throws DriverException
|
182 |
*/
|
183 |
void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, |
184 |
Cancellable cancel,double scale) throws DriverException; |
185 |
|
186 |
/**
|
187 |
* Dibuja la capa
|
188 |
*
|
189 |
* @param g Graphics2D de la impresora sobre el que dibujar.
|
190 |
* @param viewPort Propiedades de la vista.
|
191 |
* @param cancel
|
192 |
*
|
193 |
* @throws DriverException
|
194 |
*/
|
195 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale) |
196 |
throws DriverException;
|
197 |
|
198 |
/**
|
199 |
* Inserta las coordenadas de transformaci?n.
|
200 |
*
|
201 |
* @param ct Coordenadas de transformaci?n.
|
202 |
*/
|
203 |
void setCoordTrans(ICoordTrans ct);
|
204 |
|
205 |
/**
|
206 |
* Devuelve las coordenadas de transformaci?n.
|
207 |
*
|
208 |
* @return Coordenadas de transformaci?n.
|
209 |
*/
|
210 |
ICoordTrans getCoordTrans(); |
211 |
|
212 |
/**
|
213 |
* A?ade un listener LayerListener a la lista de listeners.
|
214 |
*
|
215 |
* @param o Listener.
|
216 |
*
|
217 |
* @return True si es correcta la inserci?n del listener.
|
218 |
*/
|
219 |
public boolean addLayerListener(LayerListener o); |
220 |
|
221 |
/**
|
222 |
* Borra de la lista el LayerListener que se pasa como par?metro.
|
223 |
*
|
224 |
* @param o Listener.
|
225 |
*
|
226 |
* @return True si es correcto el borrado del listener.
|
227 |
*/
|
228 |
public boolean removeLayerListener(LayerListener o); |
229 |
|
230 |
public boolean isWithinScale(double scale); |
231 |
|
232 |
|
233 |
/**
|
234 |
* La capa no se visualiza si est? por debajo de esa escala
|
235 |
* @return la escala minima de visualizaci?n
|
236 |
*/
|
237 |
public double getMinScale(); |
238 |
|
239 |
/**
|
240 |
* La capa no se visualiza si est? por encima de esa escala
|
241 |
* @return la escala m?xima de visualizaci?n
|
242 |
*/
|
243 |
public double getMaxScale(); |
244 |
|
245 |
public void setMinScale(double minScale); |
246 |
public void setMaxScale(double maxScale); |
247 |
public void setEditing(boolean b); |
248 |
public boolean isEditing(); |
249 |
} |