svn-gvsig-desktop / branches / Mobile_Compatible_Hito_1 / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / layers / FLayer.java @ 22123
History | View | Annotate | Download (22 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; |
42 |
|
43 |
import java.awt.Graphics2D; |
44 |
import java.awt.Image; |
45 |
import java.awt.geom.Point2D; |
46 |
import java.awt.geom.Rectangle2D; |
47 |
import java.awt.image.BufferedImage; |
48 |
import java.net.URI; |
49 |
import java.util.List; |
50 |
import java.util.Map; |
51 |
|
52 |
import javax.print.attribute.PrintRequestAttributeSet; |
53 |
import javax.swing.ImageIcon; |
54 |
|
55 |
import org.gvsig.projection.cts.ICoordTrans; |
56 |
import org.gvsig.projection.geo.Projected; |
57 |
import org.gvsig.data.ReadException; |
58 |
import org.gvsig.exceptions.BaseException; |
59 |
import org.gvsig.fmap.mapcontext.MapContext; |
60 |
import org.gvsig.fmap.mapcontext.ViewPort; |
61 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
62 |
import org.gvsig.fmap.mapcontext.exceptions.ReloadLayerException; |
63 |
import org.gvsig.fmap.mapcontext.exceptions.StartEditionLayerException; |
64 |
import org.gvsig.fmap.mapcontext.layers.operations.ComposedLayer; |
65 |
|
66 |
import com.iver.utiles.XMLEntity; |
67 |
import com.iver.utiles.swing.threads.Cancellable; |
68 |
|
69 |
/**
|
70 |
* <p>Definition of the basic functionality that all kind of <i>FMap</i> layers should implement.</p>
|
71 |
*
|
72 |
* <p>This kind of layers store their data, are drawable, projectable (with a projection), can be a node of a tree of layers, and
|
73 |
* could be editable and have a cache with previous draws. They also can be visible or not, and active or not.</p>
|
74 |
*
|
75 |
* <p>A layer can also store information about errors produced working with it, and have a name (kind of layer) and
|
76 |
* a brief summary explaining what's for.</p>
|
77 |
*
|
78 |
* <p>Each particular implementation can add new properties, and limit or expand the functionality.</p>
|
79 |
*
|
80 |
* @see Projected
|
81 |
*/
|
82 |
public interface FLayer extends Projected { |
83 |
/**
|
84 |
* <p>Returns an entity that represents this layer.</p>
|
85 |
*
|
86 |
* <p>This XML entity has elements that represent and store information about this layer.</p>
|
87 |
*
|
88 |
* @return an XML entity with information of this layer
|
89 |
* @throws org.gvsig.fmap.mapcontext.layers.XMLException if there is an error obtaining the object.
|
90 |
*
|
91 |
* @see #setXMLEntity(XMLEntity)
|
92 |
* @see #setXMLEntity03(XMLEntity)
|
93 |
*/
|
94 |
XMLEntity getXMLEntity() throws XMLException;
|
95 |
|
96 |
/**
|
97 |
* <p>Inserts information to this layer from an XML entity.</p>
|
98 |
*
|
99 |
* <p>This XML entity has elements that represent and store information about this layer.</p>
|
100 |
*
|
101 |
* @param xml an <code>XMLEntity</code> with the information
|
102 |
*
|
103 |
* @throws org.gvsig.fmap.mapcontext.layers.XMLException if there is an error setting the object.
|
104 |
*
|
105 |
* @see #getXMLEntity()
|
106 |
* @see #setXMLEntity03(XMLEntity)
|
107 |
*/
|
108 |
void setXMLEntity(XMLEntity xml) throws XMLException; |
109 |
|
110 |
/**
|
111 |
* Inserts some properties to this layer.
|
112 |
*
|
113 |
* @param xml an <code>XMLEntity</code> with the information
|
114 |
*
|
115 |
* @throws org.gvsig.fmap.mapcontext.layers.XMLException if there is an error obtaining the object.
|
116 |
*
|
117 |
* @see #getXMLEntity()
|
118 |
* @see #setXMLEntity(XMLEntity)
|
119 |
*/
|
120 |
void setXMLEntity03(XMLEntity xml) throws XMLException; |
121 |
|
122 |
/**
|
123 |
* <p>Changes the status of this layer to active or inactive.</p>
|
124 |
* <p>One layer is active if is selected in TOC.</p>
|
125 |
*
|
126 |
* @param selected the boolean to be set
|
127 |
*
|
128 |
* @see #isActive()
|
129 |
*/
|
130 |
void setActive(boolean selected); |
131 |
|
132 |
/**
|
133 |
* <p>Returns if this layer is active or not in TOC.</p>
|
134 |
* <p>One layer is active if is selected in TOC.</p>
|
135 |
*
|
136 |
* @return <code>true</code> if this layer is active; <code>false</code> otherwise
|
137 |
*
|
138 |
* @see #setActive(boolean)
|
139 |
*/
|
140 |
boolean isActive();
|
141 |
|
142 |
/**
|
143 |
* Sets a name to this layer.
|
144 |
*
|
145 |
* @param name the string that is to be this layer's name
|
146 |
*
|
147 |
* @see #getName()
|
148 |
*/
|
149 |
void setName(String name); |
150 |
|
151 |
/**
|
152 |
* Returns the name of this layer.
|
153 |
*
|
154 |
* @return an string with this layer's name
|
155 |
*
|
156 |
* @see #setName(String)
|
157 |
*/
|
158 |
String getName();
|
159 |
|
160 |
/**
|
161 |
* <p>Executes the initialization operations of this layer. This method is invoked
|
162 |
* only one time during the life of this layer and just before visualize it.</p>
|
163 |
*
|
164 |
* @throws org.gvsig.fmap.drivers.reading.DriverIOException if fails loading the layer.
|
165 |
*
|
166 |
* @see #reload()
|
167 |
*/
|
168 |
void load() throws LoadLayerException; |
169 |
/**
|
170 |
* <p>Changes the status of this layer to visible or not.</p>
|
171 |
* <p>One layer is visible if it's check box associated is selected. This means
|
172 |
* that layer will tried to be painted. If the data associated isn't available,
|
173 |
* then this property will change to <code>false</code>.</p>
|
174 |
*
|
175 |
* @param visibility the boolean to be set
|
176 |
*
|
177 |
* @see #isVisible()
|
178 |
* @see #visibleRequired()
|
179 |
* @see #isAvailable()
|
180 |
*/
|
181 |
void setVisible(boolean visibility); |
182 |
|
183 |
/**
|
184 |
* <p>Returns if this layer is visible and available.</p>
|
185 |
* <p>One layer is visible if it's check box associated is selected. This means
|
186 |
* that layer will tried to be painted.</p>
|
187 |
* <p>One layer is available if the source of data is on-line.</p>
|
188 |
* <p>It's probably that one layer selected hadn't available it's data, for example
|
189 |
* in a remote service.</p>
|
190 |
*
|
191 |
* @return <code>true</code> if this layer is visible and available; <code>false</code> otherwise
|
192 |
*
|
193 |
* @see #isAvailable()
|
194 |
* @see #setAvailable(boolean)
|
195 |
* @see #visibleRequired()
|
196 |
*/
|
197 |
boolean isVisible();
|
198 |
|
199 |
/**
|
200 |
* Returns the parent {@link FLayers FLayers} node of this layer.
|
201 |
*
|
202 |
* @return the parent of this layer, or <code>null</code> if hasn't parent
|
203 |
*
|
204 |
* @see #setParentLayer(FLayers)
|
205 |
*/
|
206 |
public FLayers getParentLayer();
|
207 |
|
208 |
/**
|
209 |
* <p>Returns a reference to the model of this layer, or null if this layer has no model.</p>
|
210 |
*
|
211 |
* @return the model of this layer
|
212 |
*/
|
213 |
public MapContext getMapContext();
|
214 |
|
215 |
/**
|
216 |
* Inserts the parent {@link FLayers FLayers} node of the layer.
|
217 |
*
|
218 |
* @param root a <code>FLayers</code> object
|
219 |
*
|
220 |
* @see #getParentLayer()
|
221 |
*/
|
222 |
public void setParentLayer(FLayers root); |
223 |
/**
|
224 |
* Returns the full extension of the layer node.
|
225 |
*
|
226 |
* @return location and dimension of this layer node
|
227 |
*
|
228 |
* @throws com.iver.cit.gvsig.fmap.DriverException if fails the driver used in this method.
|
229 |
*/
|
230 |
Rectangle2D getFullExtent() throws ReadException; |
231 |
|
232 |
/**
|
233 |
* Draws the layer using a buffer.
|
234 |
*
|
235 |
* @param image an image used to accelerate the screen draw
|
236 |
* @param g for rendering 2-dimensional shapes, text and images on the Java(tm) platform
|
237 |
* @param viewPort information for drawing this layer
|
238 |
* @param cancel an object thread that implements the <code>Cancellable</code> interface, and will allow to cancel the draw
|
239 |
* @param scale value that represents the scale
|
240 |
*
|
241 |
* @throws com.iver.cit.gvsig.fmap.DriverException if fails the driver used in this method.
|
242 |
*
|
243 |
* @see #print(Graphics2D, ViewPort, Cancellable, double, PrintRequestAttributeSet)
|
244 |
*/
|
245 |
void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, |
246 |
Cancellable cancel,double scale) throws ReadException; |
247 |
|
248 |
/**
|
249 |
* Prints this layer according to some properties requested.
|
250 |
*
|
251 |
* @param g for rendering 2-dimensional shapes, text and images on the Java(tm) platform
|
252 |
* @param viewPort the information for drawing the layers
|
253 |
* @param cancel an object thread that implements the {@link Cancellable Cancellable} interface, and will allow to cancel the draw
|
254 |
* @param scale the scale of the view. Must be between {@linkplain FLayer#getMinScale()} and {@linkplain FLayer#getMaxScale()}.
|
255 |
* @param properties a set with the settings to be applied to a whole print job and to all the docs in the print job
|
256 |
*
|
257 |
* @throws com.iver.cit.gvsig.fmap.DriverException if fails the driver used in this method.
|
258 |
*
|
259 |
* @see #draw(BufferedImage, Graphics2D, ViewPort, Cancellable, double)
|
260 |
*/
|
261 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties) |
262 |
throws ReadException;
|
263 |
|
264 |
/**
|
265 |
* Inserts the transformation coordinates.
|
266 |
*
|
267 |
* @param ct transformation coordinates
|
268 |
*
|
269 |
* @see #getCoordTrans()
|
270 |
*/
|
271 |
void setCoordTrans(ICoordTrans ct);
|
272 |
|
273 |
/**
|
274 |
* Returns the transformation coordinates.
|
275 |
*
|
276 |
* @return transformation coordinates
|
277 |
*
|
278 |
* @see #setCoordTrans(ICoordTrans)
|
279 |
*/
|
280 |
ICoordTrans getCoordTrans(); |
281 |
|
282 |
/**
|
283 |
* Adds a <code>LayerListener</code> to the listener list.
|
284 |
*
|
285 |
* @param o a layer listener
|
286 |
*
|
287 |
* @return <code>true</code> if hasn't been any problem during the insertion of the listener
|
288 |
*
|
289 |
* @see #getLayerListeners()
|
290 |
* @see #removeLayerListener(LayerListener)
|
291 |
*/
|
292 |
public boolean addLayerListener(LayerListener o); |
293 |
/**
|
294 |
* Returns all <code>LayerListener</code>s of this layer as an array.
|
295 |
*
|
296 |
* @return an array with all layer listeners associated to this layer
|
297 |
*
|
298 |
* @see #addLayerListener(LayerListener)
|
299 |
* @see #removeLayerListener(LayerListener)
|
300 |
*/
|
301 |
public LayerListener[] getLayerListeners(); |
302 |
/**
|
303 |
* Removes the <code>LayerListener</code> argument from this layer.
|
304 |
*
|
305 |
* @param o a layer listener
|
306 |
*
|
307 |
* @return <code>true</code> if hasn't been any problem doing this process
|
308 |
*
|
309 |
* @see #addLayerListener(LayerListener)
|
310 |
* @see #getLayerListeners()
|
311 |
*/
|
312 |
public boolean removeLayerListener(LayerListener o); |
313 |
/**
|
314 |
* <p>Returns if the value of <code>scale</code> argument
|
315 |
* is within the maximum and minimum scale of this layer.</p>
|
316 |
*
|
317 |
* @param scale the scale > 0
|
318 |
*
|
319 |
* @return <code>true</code> if the <code>scale</code> argument is within the range of scales of this layer; <code>false</code> otherwise
|
320 |
*
|
321 |
* @see #setMinScale(double)
|
322 |
* @see #setMaxScale(double)
|
323 |
*/
|
324 |
public boolean isWithinScale(double scale); |
325 |
|
326 |
|
327 |
/**
|
328 |
* Returns the minimum scale visible. Lower scales won't be drawn.
|
329 |
*
|
330 |
* @return the minimum scale > 0, -1 if not defined
|
331 |
*
|
332 |
* @see #setMinScale(double)
|
333 |
*/
|
334 |
public double getMinScale(); |
335 |
|
336 |
/**
|
337 |
* Returns the maximum scale visible. Higher scales won't be drawn.
|
338 |
*
|
339 |
* @return the maximum scale > 0, -1 if not defined
|
340 |
*
|
341 |
* @see #setMaxScale(double)
|
342 |
*/
|
343 |
public double getMaxScale(); |
344 |
/**
|
345 |
* Sets the minimum scale visible. Lower scales won't be drawn.
|
346 |
*
|
347 |
* @param minScale the scale > 0, -1 if not defined
|
348 |
*
|
349 |
* @see #getMinScale()
|
350 |
*/
|
351 |
public void setMinScale(double minScale); |
352 |
/**
|
353 |
* Sets the maximum scale visible. Higher scales won't be drawn.
|
354 |
*
|
355 |
* @param maxScale the scale > 0, -1 if not defined
|
356 |
*
|
357 |
* @see #getMaxScale()
|
358 |
*/
|
359 |
public void setMaxScale(double maxScale); |
360 |
/**
|
361 |
* <p>Changes the status of this layer to editable or not.</p>
|
362 |
* <p>One layer is editable if user can modify its information with graphical tools.</p>
|
363 |
*
|
364 |
* @param b the boolean to be set
|
365 |
*
|
366 |
* @throws com.iver.cit.gvsig.fmap.edition.EditionException if fails enabling for edition this kind of layer.
|
367 |
*
|
368 |
* @see #isEditing()
|
369 |
*/
|
370 |
public void setEditing(boolean b) throws StartEditionLayerException; |
371 |
/**
|
372 |
* <p>Returns if this layer is editable.</p>
|
373 |
* <p>One layer is editable if user can modify its information with graphical tools.</p>
|
374 |
*
|
375 |
* @return <code>true</code> if this layer is editable; <code>false</code> otherwise
|
376 |
*
|
377 |
* @see #setEditing(boolean)
|
378 |
*/
|
379 |
public boolean isEditing(); |
380 |
/**
|
381 |
* <p>Uses or not a <code>BufferedImage</code> image that represents the drawn layers.</p>
|
382 |
*
|
383 |
* @return <code>true</code> if uses that kind of image; <code>false</code> otherwise
|
384 |
*
|
385 |
* @see #setCachingDrawnLayers(boolean)
|
386 |
*/
|
387 |
public boolean isCachingDrawnLayers(); |
388 |
/**
|
389 |
* <p>Set <code>true</code> if you want this layer to store an image of previous layers.
|
390 |
* Then, if you perform a <code>FLayers#invalidateLayer()</code>, the system will
|
391 |
* redraw only this layers you are requesting.</p>
|
392 |
*
|
393 |
* @param bCacheDrawnLayers the boolean to be set
|
394 |
*
|
395 |
* @see #isCachingDrawnLayers()
|
396 |
*/
|
397 |
// * <p>Another option could be store an image of each layer drawn, and call each one using something
|
398 |
// * like "invalidate()". On having rendered, it's possible to see if it's invalidated, and if itsn't,
|
399 |
// * paste the cached image.</p>
|
400 |
// *
|
401 |
// * <p> ERROR!: You can't cache that image, because if the background has changed, the antialiasing
|
402 |
// * will affect the draw of that layer. However, it would be useful draw the cached image of each layer
|
403 |
// * that aren't invalidated, and from that appears one of them invalidated, the rest already have to draw.
|
404 |
// * The problem is that continues spending more memory</p>
|
405 |
// *
|
406 |
// * @param bCacheDrawnLayers
|
407 |
// */
|
408 |
public void setCachingDrawnLayers(boolean bCacheDrawnLayers); |
409 |
|
410 |
/**
|
411 |
* Returns the image icon that will be shown in the TOC next to this layer.
|
412 |
*
|
413 |
* @return a reference to the image icon, or <code>null</code> if there isn't any
|
414 |
*/
|
415 |
public ImageIcon getTocImageIcon(); |
416 |
|
417 |
/**
|
418 |
* <p>Returns if this layer appears in the TOC.</p>
|
419 |
* <p>If doesn't appears, remains in the view and in the project.</p>
|
420 |
*
|
421 |
* @return <code>true</code> if this layer appears in the TOC; <code>false</code> otherwise
|
422 |
*/
|
423 |
boolean isInTOC();
|
424 |
/**
|
425 |
* <p>Sets that this layer appears or not in the TOC.</p>
|
426 |
*
|
427 |
* @param b <code>true</code> if appears in the TOC; <code>false</code> otherwise
|
428 |
*/
|
429 |
void setInTOC(boolean b); |
430 |
/**
|
431 |
* <p>Returns if this layer needs or doesn't need a repaint.
|
432 |
*
|
433 |
* @return <code>true</code> if this layer need a repaint; <code>false</code> otherwise
|
434 |
*
|
435 |
* @see #setDirty(boolean)
|
436 |
*/
|
437 |
public boolean isDirty(); |
438 |
|
439 |
/**
|
440 |
* <p>Changes the status of this layer to dirty if needs a repaint.</p>
|
441 |
*
|
442 |
* <p>By default, all layers will be set to dirty when the extent changes. But for events like changing
|
443 |
* its legend, or editing a layer, we could perform some optimization using the private method <code>MapContext#prepareDrawing</code> from <code>MapContext</code>.</p>
|
444 |
*
|
445 |
* @param dirty <code>true</code> if this layer needs a repaint
|
446 |
*
|
447 |
* @see #isDirty()
|
448 |
*/
|
449 |
public void setDirty(boolean dirty); |
450 |
/**
|
451 |
* Returns the image with bands, of the drawn layers.
|
452 |
*
|
453 |
* @return an image with bands
|
454 |
*
|
455 |
* @see #setCacheImageDrawnLayers(BufferedImage)
|
456 |
*/
|
457 |
public BufferedImage getCacheImageDrawnLayers(); |
458 |
/**
|
459 |
* Sets the image with bands, for the drawn layers.
|
460 |
*
|
461 |
* @param cacheImageDrawnLayers an image with bands
|
462 |
*
|
463 |
* @see #getCacheImageDrawnLayers()
|
464 |
*/
|
465 |
public void setCacheImageDrawnLayers(BufferedImage cacheImageDrawnLayers); |
466 |
/**
|
467 |
* Returns the status of this layer.
|
468 |
*
|
469 |
* @return the status stored in a <code>FLayerStatus</code> object
|
470 |
*
|
471 |
* @see #setFLayerStatus(FLayerStatus)
|
472 |
*/
|
473 |
public FLayerStatus getFLayerStatus();
|
474 |
/**
|
475 |
* Sets the status of this layer.
|
476 |
*
|
477 |
* @param status information of the status for this layer
|
478 |
*
|
479 |
* @see #getFLayerStatus()
|
480 |
*/
|
481 |
public void setFLayerStatus(FLayerStatus status); |
482 |
/*
|
483 |
* This stuff is to save error's info that causes
|
484 |
* unavailable status.
|
485 |
* */
|
486 |
/**
|
487 |
* <p>Returns if this layer hasn't got errors.</p>
|
488 |
*
|
489 |
* @return <code>true</code> if this layer hasn't got errors; <code>false</code> otherwise
|
490 |
*/
|
491 |
public boolean isOk(); |
492 |
/**
|
493 |
* Returns the number of errors which causes this layer to be in unavailable status.
|
494 |
*
|
495 |
* @return number of errors >= 0
|
496 |
*
|
497 |
* @see #getError(int)
|
498 |
* @see #getErrors()
|
499 |
* @see #addError(DriverException)
|
500 |
*/
|
501 |
public int getNumErrors(); |
502 |
|
503 |
/**
|
504 |
* Returns the specified error.
|
505 |
*
|
506 |
* @param i index of the error >= 0 && < <code>getNumErrors</code>
|
507 |
*
|
508 |
* @return a singular error
|
509 |
*
|
510 |
* @see #getNumErrors()
|
511 |
* @see #getErrors()
|
512 |
*/
|
513 |
public BaseException getError(int i); |
514 |
|
515 |
/**
|
516 |
* Adds an error reason that describes this layer's wrong status.
|
517 |
*
|
518 |
* @param error a <code>DriverException</code> with the information of the error
|
519 |
*
|
520 |
* @see #getNumErrors()
|
521 |
* @see #getError(int)
|
522 |
* @see #getErrors()
|
523 |
*/
|
524 |
public void addError(BaseException exception); |
525 |
|
526 |
/**
|
527 |
* Returns a list with all layer errors.
|
528 |
*
|
529 |
* @return an <code>ArrayList</code> with the errors
|
530 |
*
|
531 |
* @see #getError(int)
|
532 |
* @see #getNumErrors()
|
533 |
*/
|
534 |
public List getErrors(); |
535 |
/**
|
536 |
* <p>Changes the status of availability of this layer.</p>
|
537 |
* <p>One layer is available if the source of data is on-line.</p>
|
538 |
*
|
539 |
* @param the boolean to be set
|
540 |
*
|
541 |
* @see #isAvailable()
|
542 |
*/
|
543 |
public void setAvailable(boolean available); |
544 |
/**
|
545 |
* <p>Returns the status of availability of this layer.</p>
|
546 |
* <p>One layer is available if the source of data is on-line.</p>
|
547 |
*
|
548 |
* @return <code>true</code> if the source of data is on-line; <code>false</code> otherwise
|
549 |
*
|
550 |
* @see #setAvailable(boolean)
|
551 |
* @see #isVisible()
|
552 |
*/
|
553 |
public boolean isAvailable(); |
554 |
/**
|
555 |
* <p>Tries recover a layer of a possible error.</p>
|
556 |
* <p>If it has any problem during the load, marks the availability
|
557 |
* to false and throws an exception.</p>
|
558 |
*
|
559 |
* @throws DriverIOException if it's thrown a <code>DriverException</code> or an <code>IOException</code> during the load of this layer.
|
560 |
*
|
561 |
* @see #load()
|
562 |
*/
|
563 |
public void reload() throws ReloadLayerException; |
564 |
|
565 |
/**
|
566 |
* Returns <code>true</code> if this layer has the visible status enabled.
|
567 |
*
|
568 |
* @return <code>true</code> if visible this layer has the visible status enabled, otherwise <code>false</code>
|
569 |
*
|
570 |
* @see #isVisible()
|
571 |
* @see #setVisible(boolean)
|
572 |
*/
|
573 |
boolean visibleRequired();
|
574 |
/**
|
575 |
* Returns an string with the information of this layer.
|
576 |
*
|
577 |
* @return the string that is to be this component's information
|
578 |
*/
|
579 |
public String getInfoString(); |
580 |
/**
|
581 |
* <p>Returns the writing status of this layer.</p>
|
582 |
* <p>One layer is writable if there is a writing driver for this layer.</p>
|
583 |
*
|
584 |
* @return <code>true</code> if there is a writing driver for this layer; <code>false</code> otherwise
|
585 |
*/
|
586 |
public boolean isWritable(); |
587 |
|
588 |
/**
|
589 |
* <p>This method can be used to have a fast cloned layer.</p>
|
590 |
* <p>The implementations should take care of not recreate this layer. Instead of this,
|
591 |
* is better to use the same source (driver) and <i>deepclone</i> the legend. Exception:
|
592 |
* the labels aren't <i>deepcloned</i> to avoid memory consumption.</p>
|
593 |
* <p><i>Note</i>: Labels are memory consuming to speed up layers like PostGIS and so on.</p>
|
594 |
*
|
595 |
* @return a layer that is a clonation of this layer
|
596 |
*
|
597 |
* @throws java.lang.Exception any exception produced during the cloning of this layer.
|
598 |
*/
|
599 |
public FLayer cloneLayer() throws Exception; |
600 |
|
601 |
|
602 |
|
603 |
/**
|
604 |
* <p>Returns a reference to an object (property) associated to this layer.</p>
|
605 |
*
|
606 |
* <p>For example, you can attach a network definition to key "network" and check
|
607 |
* if a layer has a network loaded using <i>getAssociatedObject("network")</i> and
|
608 |
* that it's not null.</p>
|
609 |
*
|
610 |
* @param key the key associated to the property
|
611 |
*
|
612 |
* @return <code>null</code> if key is not found
|
613 |
*
|
614 |
* @see #getExtendedProperties()
|
615 |
* @see #setProperty(Object, Object)
|
616 |
*/
|
617 |
public Object getProperty(Object key); |
618 |
|
619 |
/**
|
620 |
* Insets an object as a property to this layer.
|
621 |
*
|
622 |
* @param key the key associated to the property
|
623 |
* @param obj the property
|
624 |
*
|
625 |
* @see #getProperty(Object)
|
626 |
* @see #getExtendedProperties()
|
627 |
*/
|
628 |
public void setProperty(Object key, Object obj); |
629 |
/**
|
630 |
* Returns a hash map with all new properties associated to this layer.
|
631 |
*
|
632 |
* @return hash table with the added properties
|
633 |
*
|
634 |
* @see #getProperty(Object)
|
635 |
* @see #setProperty(Object, Object)
|
636 |
*/
|
637 |
public Map getExtendedProperties(); |
638 |
|
639 |
/**
|
640 |
* <p>Returns a new instance of {@link ComposedLayer ComposedLayer}.</p>
|
641 |
*
|
642 |
* <p>This allows make a single draw for a group
|
643 |
* of layers with the same source.</p>
|
644 |
*
|
645 |
* <p>If this operation isn't applicable for this
|
646 |
* kind of layer, this method returns null.</p>
|
647 |
*
|
648 |
* <p>By default this operation is not supported.</p>
|
649 |
*
|
650 |
* @see org.gvsig.fmap.mapcontext.layers.operations.ComposedLayer
|
651 |
*
|
652 |
* @return a new composed layer or <code>null</code> if not supported
|
653 |
*/
|
654 |
public ComposedLayer newComposedLayer();
|
655 |
|
656 |
/**
|
657 |
* Returns the image icon that will be shown in the TOC next to this layer, according its status.
|
658 |
*
|
659 |
* @return the image
|
660 |
*/
|
661 |
Image getTocStatusImage();
|
662 |
|
663 |
// M?todos para la utilizaci?n de HyperLinks
|
664 |
|
665 |
/**
|
666 |
* Returns information about if the layer allows HyperLink or not
|
667 |
* @return boolean true if allows Link, false if not
|
668 |
*/
|
669 |
public boolean allowLinks(); |
670 |
|
671 |
/**
|
672 |
* Returns an instance of AbstractLinkProperties that contains the information
|
673 |
* of the HyperLink
|
674 |
* @return Abstra
|
675 |
*/
|
676 |
public AbstractLinkProperties getLinkProperties();
|
677 |
|
678 |
/**
|
679 |
* Provides an array with URIs. Returns one URI by geometry that includes the point
|
680 |
* in its own geometry limits with a allowed tolerance.
|
681 |
* @param layer, the layer
|
682 |
* @param point, the point to check that is contained or not in the geometries in the layer
|
683 |
* @param tolerance, the tolerance allowed. Allowed margin of error to detect if the point
|
684 |
* is contained in some geometries of the layer
|
685 |
* @return
|
686 |
* @throws ReadException
|
687 |
* @throws BehaviorException
|
688 |
*/
|
689 |
public URI[] getLink(Point2D point, double tolerance) throws ReadException; |
690 |
|
691 |
} |