Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / FLayer.java @ 20100

History | View | Annotate | Download (21.5 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 java.awt.Graphics2D;
44
import java.awt.Image;
45
import java.awt.geom.Rectangle2D;
46
import java.awt.image.BufferedImage;
47
import java.util.List;
48
import java.util.Map;
49

    
50
import javax.print.attribute.PrintRequestAttributeSet;
51
import javax.swing.ImageIcon;
52

    
53
import org.cresques.cts.ICoordTrans;
54
import org.cresques.cts.IProjection;
55
import org.cresques.geo.Projected;
56

    
57
import com.iver.cit.gvsig.fmap.DriverException;
58
import com.iver.cit.gvsig.fmap.MapContext;
59
import com.iver.cit.gvsig.fmap.MapControl;
60
import com.iver.cit.gvsig.fmap.ViewPort;
61
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
62
import com.iver.cit.gvsig.fmap.edition.EditionException;
63
import com.iver.cit.gvsig.fmap.layers.layerOperations.ComposedLayer;
64
import com.iver.utiles.XMLEntity;
65
import com.iver.utiles.swing.threads.Cancellable;
66

    
67

    
68
/**
69
 * <p>Definition of the basic functionality that all kind of layers should implement.</p>
70
 *
71
 * <p>This kind of layers, store their data, are drawable, projectable, can be a node of a tree of layers, and
72
 *  could be editable, and have a cache with previous draws. They also can be visible or not, and active or not.</p>
73
 *
74
 * <p>A layer can also store information about errors produced working with it, and have a name (kind of layer) and
75
 *  a brief summary explaining what's for.</p>
76
 *
77
 * <p>Each particular implementation can add new properties, and limit or expand the functionality.</p>
78
 *
79
 * @see Projected
80
 */
81
public interface FLayer extends Projected {
82
        /**
83
         * <p>Returns an entity that represents this layer.</p>
84
         *
85
         * <p>This XML entity has elements that represent and store information about this layer.</p>
86
         *
87
         * @return an XML entity with information of this layer
88
         * @throws com.iver.cit.gvsig.fmap.layers.XMLException if there is an error obtaining the object.
89
         *
90
         * @see #setXMLEntity(XMLEntity)
91
         * @see #setXMLEntity03(XMLEntity)
92
         */
93
        XMLEntity getXMLEntity() throws XMLException;
94

    
95
        /**
96
         * <p>Inserts information to this layer from an XML entity.</p>
97
         *
98
         * <p>This XML entity has elements that represent and store information about this layer.</p>
99
         *
100
         * @param xml an <code>XMLEntity</code> with the information
101
         *
102
         * @throws com.iver.cit.gvsig.fmap.layers.XMLException if there is an error setting the object.
103
         *
104
         * @see #getXMLEntity()
105
         * @see #setXMLEntity03(XMLEntity)
106
         */
107
        void setXMLEntity(XMLEntity xml) throws XMLException;
108

    
109
        /**
110
         * <p>Inserts some properties to this layer.</p>
111
         *
112
         * @param xml an <code>XMLEntity</code> with the information
113
         *
114
         * @throws com.iver.cit.gvsig.fmap.layers.XMLException if there is an error obtaining the object.
115
         *
116
         * @see #getXMLEntity()
117
         * @see #setXMLEntity(XMLEntity)
118
         */
119
        void setXMLEntity03(XMLEntity xml) throws XMLException;
120

    
121
        /**
122
         * <p>Changes the status of this layer to active or inactive.</p>
123
         * <p>One layer is active if is selected in TOC.</p>
124
         *
125
         * @param selected the boolean to be set
126
         *
127
         * @see #isActive()
128
         */
129
        void setActive(boolean selected);
130

    
131
        /**
132
         * <p>Returns if this layer is active or not in TOC.</p>
133
         * <p>One layer is active if is selected in TOC.</p>
134
         *
135
         * @return <code>true</code> if this layer is active; <code>false</code> otherwise
136
         *
137
         * @see #setActive(boolean)
138
         */
139
        boolean isActive();
140

    
141
        /**
142
         * <p>Sets a name to this layer.</p>
143
         *
144
         * @param name the string that is to be this layer's name
145
         *
146
         * @see #getName()
147
         */
148
        void setName(String name);
149

    
150
        /**
151
         * <p>Returns the name of this layer.</p>
152
         *
153
         * @return an string with this layer's name
154
         *
155
         * @see #setName(String)
156
         */
157
        String getName();
158

    
159
        /**
160
         * <p>Executes the initialization operations of this layer. This method is invoked
161
         * only one time during the life of this layer and just before visualize it.</p>
162
         *
163
         * @throws com.iver.cit.gvsig.fmap.drivers.DriverIOException if fails loading the layer.
164
         *
165
         * @see #reload()
166
         */
167
        void load() throws DriverIOException;
168

    
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 be changed to <code>false</code>.</p>
174
         *
175
         * @param visibility a boolean value
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
         * <p>Returns the parent {@link FLayers FLayers} node of this layer.</p>
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 that contains this layer, or <code>null</code> if this layer isn't
210
         *  added in any model.</p>
211
         *
212
         * @return the model of this layer, or <code>null</code> if no model contains this layer
213
         */
214
        public MapContext getMapContext();
215

    
216
        /**
217
         * <p>Inserts the parent {@link FLayers FLayers} node of the layer.</p>
218
         *
219
         * @param root a <code>FLayers</code> object
220
         *
221
         * @see #getParentLayer()
222
         */
223
        public void setParentLayer(FLayers root);
224

    
225
        /**
226
         * <p>Returns the full extension of the layer node.</p>
227
         *
228
         * @return location and dimension of this layer node
229
         *
230
         * @throws com.iver.cit.gvsig.fmap.DriverException if fails the driver used in this method.
231
         */
232
        Rectangle2D getFullExtent() throws DriverException;
233

    
234
        /**
235
         * <p>Draws the layer using a buffer.</p>
236
         *
237
         * @param image a double-buffered image used to accelerate the screen drawn
238
         * @param g object for rendering 2-dimensional shapes, text and images on the Java(tm) platform
239
         * @param viewPort information for displaying this layer
240
         * @param cancel shared object that determines if this layer can continue being drawn
241
         * @param scale the scale of the view. Must be between {@linkplain FLayer#getMinScale()} and {@linkplain FLayer#getMaxScale()}
242
         *
243
         * @throws com.iver.cit.gvsig.fmap.DriverException if fails the driver used in this method.
244
         *
245
         * @see #print(Graphics2D, ViewPort, Cancellable, double, PrintRequestAttributeSet)
246
         */
247
        void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
248
                Cancellable cancel, double scale) throws DriverException;
249

    
250
        /**
251
         * <p>Prints this layer according to some properties requested.</p>
252
         *
253
         * @param g for rendering 2-dimensional shapes, text and images on the Java(tm) platform
254
         * @param viewPort the information for displaying the layers
255
         * @param cancel shared object that determines if this layer can continue being drawn
256
         * @param scale the scale of the view. Must be between {@linkplain FLayer#getMinScale()} and {@linkplain FLayer#getMaxScale()}
257
         * @param properties a set with all settings to be applied to a whole print job and all documents in the print job
258
         *
259
         * @throws com.iver.cit.gvsig.fmap.DriverException if fails the driver used in this method.
260
         *
261
         * @see #draw(BufferedImage, Graphics2D, ViewPort, Cancellable, double)
262
         */
263
        void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties)
264
                throws DriverException;
265

    
266
        /**
267
         * <p>Inserts the transformation coordinates.</p>
268
         *
269
         * @param ct transformation coordinates
270
         *
271
         * @see #getCoordTrans()
272
         */
273
        void setCoordTrans(ICoordTrans ct);
274

    
275
        /**
276
         * <p>Returns the transformation coordinates.</p>
277
         *
278
         * @return transformation coordinates
279
         *
280
         * @see #setCoordTrans(ICoordTrans)
281
         */
282
        ICoordTrans getCoordTrans();
283

    
284
        /**
285
         * <p>Registers a <code>LayerListener</code> to this layer.</p>
286
         *
287
         * @param o a layer listener
288
         *
289
         * @return <code>true</code> if hasn't been any problem during the insertion of the listener
290
         *
291
         * @see #getLayerListeners()
292
         * @see #removeLayerListener(LayerListener)
293
         */
294
        public boolean addLayerListener(LayerListener o);
295

    
296
        /**
297
         * <p>Returns all <code>LayerListener</code> registered in this layer.</p>
298
         *
299
         * @return an array with all layer listeners associated to this layer
300
         *
301
         * @see #addLayerListener(LayerListener)
302
         * @see #removeLayerListener(LayerListener)
303
         */
304
        public LayerListener[] getLayerListeners();
305

    
306
        /**
307
         * <p>Removes the <code>o</code> layer listener from this layer.</p>
308
         *
309
         * @param o a layer listener
310
         *
311
         * @return <code>true</code> if hasn't been any problem doing this process
312
         *
313
         * @see #addLayerListener(LayerListener)
314
         * @see #getLayerListeners()
315
         */
316
        public boolean removeLayerListener(LayerListener o);
317

    
318
        /**
319
         * <p>Returns if the value of <code>scale</code> argument
320
         *  is within the maximum and minimum scale of this layer.</p>
321
         *
322
         * @param scale the scale > 0
323
         *
324
         * @return <code>true</code> if the <code>scale</code> argument is within the range of scales of this layer; <code>false</code> otherwise
325
         *
326
         * @see #setMinScale(double)
327
         * @see #setMaxScale(double)
328
         */
329
        public boolean isWithinScale(double scale);
330

    
331
        /**
332
         * <p>Returns the minimum scale visible. Lower scales won't be drawn.</p>
333
         *
334
         * @return the minimum scale > 0, -1 if not defined
335
         *
336
         * @see #setMinScale(double)
337
         */
338
        public double getMinScale();
339

    
340
        /**
341
         * <p>Returns the maximum scale visible. Higher scales won't be drawn.</p>
342
         *
343
         * @return the maximum scale > 0, -1 if not defined
344
         *
345
         * @see #setMaxScale(double)
346
         */
347
        public double getMaxScale();
348

    
349
        /**
350
         * <p>Sets the minimum scale visible. Lower scales won't be drawn.</p>
351
         *
352
         * @param minScale the scale > 0, -1 if not defined
353
         *
354
         * @see #getMinScale()
355
         */
356
        public void setMinScale(double minScale);
357

    
358
        /**
359
         * <p>Sets the maximum scale visible. Higher scales won't be drawn.</p>
360
         *
361
         * @param maxScale the scale > 0, -1 if not defined
362
         *
363
         * @see #getMaxScale()
364
         */
365
        public void setMaxScale(double maxScale);
366

    
367
        /**
368
         * <p>Changes the status of this layer to editable or not.</p>
369
         * <p>One layer is editable if user can modify its information with graphical tools.</p>
370
         *
371
         * @param b the boolean to be set
372
         *
373
         * @throws com.iver.cit.gvsig.fmap.edition.EditionException if fails enabling for edition this kind of layer.
374
         *
375
         * @see #isEditing()
376
         */
377
        public void setEditing(boolean b) throws EditionException;
378

    
379
        /**
380
         * <p>Returns if this layer is editable.</p>
381
         * <p>One layer is editable if user can modify its information with graphical tools.</p>
382
         *
383
         * @return <code>true</code> if this layer is editable; <code>false</code> otherwise
384
         *
385
         * @see #setEditing(boolean)
386
         */
387
        public boolean isEditing();
388

    
389
        /**
390
         * <p>Uses or not a <code>BufferedImage</code> image that represents the drawn layers.</p>
391
         *
392
         * @return <code>true</code> if uses that kind of image; <code>false</code> otherwise
393
         *
394
         * @see #setCachingDrawnLayers(boolean)
395
         */
396
        public boolean isCachingDrawnLayers();
397

    
398
        /**
399
         * <p>Set <code>true</code> if you want this layer to store an image of previous layers.
400
         *  Then, if you perform a <code>FLayers#invalidateLayer()</code>, the system will
401
         *  redraw only the layers you are requesting.</p>
402
         *
403
         *  @param bCacheDrawnLayers the boolean to be set
404
         *
405
         *  @see #isCachingDrawnLayers()
406
         */
407
//         * <p>Another option could be store an image of each layer drawn, and call each one using something
408
//         *  like "invalidate()". On having rendered, it's possible to see if it's invalidated, and if itsn't,
409
//         *  paste the cached image.</p>
410
//         *
411
//         * <p> ERROR!: You can't cache that image, because if the background has changed, the antialiasing
412
//         *  will affect the draw of that layer. However, it would be useful draw the cached image of each layer
413
//         *  that aren't invalidated, and from that appears one of them invalidated, the rest already have to draw.
414
//         *  The problem is that continues spending more memory</p>
415
//         *
416
//         * @param bCacheDrawnLayers
417
//         */
418
        public void setCachingDrawnLayers(boolean bCacheDrawnLayers);
419

    
420
        /**
421
         * <p>Returns the image icon that will be shown in the TOC next to this layer.</p>
422
         *
423
         * @return a reference to the image icon, or <code>null</code> if there isn't any
424
         */
425
        public ImageIcon getTocImageIcon();
426

    
427
        /**
428
         * <p>Returns if this layer appears in the TOC.</p>
429
         *
430
         * @return <code>true</code> if this layer appears in the TOC; <code>false</code> otherwise
431
         */
432
        boolean isInTOC();
433

    
434
        /**
435
     * <p>Sets that this layer appears or not in the TOC.</p>
436
     * 
437
     * @param b <code>true</code> if appears in the TOC; <code>false</code> otherwise
438
     */
439
        void setInTOC(boolean b);
440

    
441
        /**
442
         * <p>Returns if this layer needs or doesn't need a repaint.
443
         *
444
         * @return <code>true</code> if this layer need a repaint; <code>false</code> otherwise
445
         *
446
         * @see #setDirty(boolean)
447
         */
448
        public boolean isDirty();
449

    
450
        /**
451
         * <p>Changes the status of this layer to dirty if needs a repaint.</p>
452
         *
453
         * <p>By default, all layers will be set to dirty when the extent changes. But for events like <i>changing
454
         * its legend</i>, or <i>editing a layer</i>, a developer can perform some optimization using
455
         * the private method <code>MapContext#prepareDrawing</code> from the <code>MapContext</code> that
456
         * contains this layer.</p>
457
         *
458
         * @param dirty <code>true</code> if this layer needs a repaint
459
         *
460
         * @see #isDirty()
461
         */
462
        public void setDirty(boolean dirty);
463

    
464
        /**
465
         * <p>Returns the image with bands, of the drawn layers.</p>
466
         *
467
         * @return an image with bands
468
         *
469
         * @see #setCacheImageDrawnLayers(BufferedImage)
470
         */
471
        public BufferedImage getCacheImageDrawnLayers();
472

    
473
        /**
474
         * <p>Sets the image with bands, for the drawn layers.</p>
475
         *
476
         * @param cacheImageDrawnLayers an image with bands
477
         *
478
         * @see #getCacheImageDrawnLayers()
479
         */
480
        public void setCacheImageDrawnLayers(BufferedImage cacheImageDrawnLayers);
481

    
482
        /**
483
         * <p>Returns the status of this layer.</p>
484
         *
485
         * @return the status stored in a <code>FLayerStatus</code> object
486
         *
487
         * @see #setFLayerStatus(FLayerStatus)
488
         */
489
        public FLayerStatus getFLayerStatus();
490

    
491
        /**
492
         * <p>Sets the status of this layer.</p>
493
         *
494
         * @param status information of the status for this layer
495
         *
496
         * @see #getFLayerStatus()
497
         */
498
        public void setFLayerStatus(FLayerStatus status);
499

    
500
        /*
501
         * This stuff is to save error's info that causes
502
         * unavailable status.
503
         * */
504
        /**
505
         * <p>Returns if this layer hasn't got errors.</p>
506
         *
507
         * @return <code>true</code> if this layer hasn't got errors; <code>false</code> otherwise
508
         */
509
        public boolean isOk();
510

    
511
        /**
512
         * <p>Returns the number of errors which causes this layer to be in unavailable status.</p>
513
         *
514
         * @return number of errors >= 0
515
         *
516
         * @see #getError(int)
517
         * @see #getErrors()
518
         * @see #addError(DriverException)
519
         */
520
        public int getNumErrors();
521

    
522
        /**
523
         * <p>Returns the specified error.</p>
524
         *
525
         * @param i index of the error >= 0 && < {@link #getNumErrors() #getNumErrors()}
526
         *
527
         * @return a singular error
528
         *
529
         * @see #getNumErrors()
530
         * @see #getErrors()
531
         */
532
        public DriverException getError(int i);
533

    
534
        /**
535
         * <p>Adds an error that describes this layer's wrong status.</p>
536
         *
537
         * @param error a <code>DriverException</code> with the information of the error
538
         *
539
         * @see #getNumErrors()
540
         * @see #getError(int)
541
         * @see #getErrors()
542
         */
543
        public void addError(DriverException error);
544

    
545
        /**
546
         * <p>Returns a list with all layer errors.</p>
547
         *
548
         * @return an <code>ArrayList</code> with the errors
549
         *
550
         * @see #getError(int)
551
         * @see #getNumErrors()
552
         */
553
        public List getErrors();
554

    
555
        /**
556
         * <p>Changes the status of availability of this layer.</p>
557
         * <p>One layer is available if the source of data is on-line.</p>
558
         * 
559
         * @param the boolean to be set
560
         *
561
         * @see #isAvailable()
562
         */
563
        public void setAvailable(boolean available);
564

    
565
        /**
566
         * <p>Returns the status of availability of this layer.</p>
567
         * <p>One layer is available if the source of data is on-line.</p>
568
         *
569
         * @return <code>true</code> if the source of data is on-line; <code>false</code> otherwise
570
         *
571
         * @see #setAvailable(boolean)
572
         * @see #isVisible()
573
         */
574
        public boolean isAvailable();
575

    
576
        /**
577
         * <p>Tries recover a layer of a possible error.</p>
578
         * <p>If it has any problem during the load, marks the availability
579
         *  to <code>false</code> and throws an exception.</p>
580
         *
581
         * @throws DriverIOException if it's thrown a <code>DriverException</code> or an <code>IOException</code> during the load of this layer.
582
         *
583
         * @see #load()
584
         */
585
        public void reload() throws DriverIOException;
586

    
587
        /**
588
         * <p>Returns <code>true</code> if this layer has the visible status enabled.</p>
589
         *
590
         * @return <code>true</code> if visible this layer has the visible status enabled, otherwise <code>false</code>
591
         *
592
         * @see #isVisible()
593
         * @see #setVisible(boolean)
594
         */
595
        boolean visibleRequired();
596

    
597
        /**
598
         * <p>Returns an string with the information of this layer.</p>
599
         *
600
         * @return string with the information of this layer
601
         */
602
        public String getInfoString();
603

    
604
        /**
605
         * <p>Returns the writing status of this layer.</p>
606
         * <p>One layer is writable if there is a writing driver for this layer.</p>
607
         *
608
         * @return <code>true</code> if there is a writing driver for this layer; <code>false</code> otherwise
609
         */
610
        public boolean isWritable();
611

    
612
        /**
613
         * <p>Returns a reference to an object (property) associated to this layer.</p>
614
         *
615
         * <p>For example, you can attach a network definition to key "network" and check
616
         *  if a layer has a network loaded using <i>getAssociatedObject("network")</i> and
617
         *  isn't <code>null</code>.</p>
618
         *
619
         * @param key the key associated to the property
620
         *
621
         * @return <code>null</code> if key is not found
622
         *
623
         * @see #getExtendedProperties()
624
         * @see #setProperty(Object, Object)
625
         */
626
        public Object getProperty(Object key);
627

    
628
        /**
629
         * <p>Insets an object as a property to this layer.</p>
630
         *
631
         * @param key the key associated to the property
632
         * @param obj the property
633
         *
634
         * @see #getProperty(Object)
635
         * @see #getExtendedProperties()
636
         */
637
        public void setProperty(Object key, Object obj);
638

    
639
        /**
640
         * <p>This method can be used to have a fast cloned layer.</p>
641
         * 
642
         * <p>Implementations of this method should avoid recreate this layer processing a <i>deepclone</i>,
643
         * in order to increasing only the least needed used memory.</p>
644
         * 
645
         * @return a layer that's a light clonation of this layer
646
         *
647
         * @throws java.lang.Exception any exception produced during the cloning of this layer.
648
         */
649
        public FLayer cloneLayer() throws Exception;
650

    
651
        /**
652
         * <p>Returns a hash map with all properties associated to this layer.</p>
653
         *
654
         * @return hash table with the added properties
655
         *
656
         * @see #getProperty(Object)
657
         * @see #setProperty(Object, Object)
658
         */
659
        public Map getExtendedProperties();
660

    
661
        /**
662
         * <p>Returns a new instance of {@link ComposedLayer ComposedLayer}.</p>
663
         *
664
         * <p>Permits executing a single draw of a group
665
         * of layers with the same source.</p>
666
         *
667
         * <p>If this operation isn't applicable for this
668
         * kind of layer, this method returns <code>null</code>.</p>
669
         *
670
         * <p>By default this operation is not supported.</p>
671
         *
672
         * @see com.iver.cit.gvsig.fmap.layers.layerOperations.ComposedLayer
673
         *
674
         * @return a new composed layer or <code>null</code> if not supported
675
         */
676
        public ComposedLayer newComposedLayer();
677

    
678
        /**
679
         * <p>Returns the image icon that will be shown in the TOC next to this layer, according its current status.</p>
680
         *
681
         * @return the image
682
         */
683
        Image getTocStatusImage();
684

    
685
        /**
686
         * <p>Returns if the projection of the layer can be changed.</p>
687
         *
688
         * @return <code>true</code> if can be changed its projection; otherwise <code>false</code>
689
         *
690
         * @see #reProject(MapControl)
691
         * @see #setProjection(IProjection)
692
         */
693
        public boolean isReprojectable();
694

    
695
        /**
696
         * <p>Changes the projection of this layer.</p>
697
         * <p>This method will be overloaded in each kind of layer, according its specific nature.</p>
698
         *
699
         * @param mapC <code>MapControl</code> instance that will reproject this layer
700
         *
701
         * @return <code>true<code> if the layer has been created calling {@link FLayers#addLayer(FLayer) FLayers#addLayer}. But returns <code>false</code>
702
         *  if the load control logic of this layer is in the reprojection method
703
         *
704
         * @see #isReprojectable()
705
         * @see #setProjection(IProjection)
706
         */
707
        public boolean reProject(MapControl mapC);
708

    
709
        /**
710
         * <p>Inserts the projection to this layer.</p>
711
         *
712
         * @param proj information about the new projection
713
         *
714
         * @see #isReprojectable()
715
         * @see #reProject(MapControl)
716
         */
717
        public void setProjection(IProjection proj);
718
}