Revision 4181 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrRaster.java

View differences:

FLyrRaster.java
2 2
*
3 3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4 4
* of the Valencian Government (CIT)
5
* 
5
*
6 6
* This program is free software; you can redistribute it and/or
7 7
* modify it under the terms of the GNU General Public License
8 8
* as published by the Free Software Foundation; either version 2
9 9
* of the License, or (at your option) any later version.
10
* 
10
*
11 11
* This program is distributed in the hope that it will be useful,
12 12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 14
* GNU General Public License for more details.
15
* 
15
*
16 16
* You should have received a copy of the GNU General Public License
17 17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 19
* MA  02110-1301, USA.
20
* 
20
*
21 21
*/
22 22
package org.gvsig.raster.fmap.layers;
23 23

  
......
26 26
import java.awt.geom.Point2D;
27 27
import java.awt.image.BufferedImage;
28 28
import java.io.File;
29
import java.net.URI;
29 30
import java.util.ArrayList;
30 31
import java.util.List;
31 32

  
32 33
import org.cresques.cts.IProjection;
34

  
33 35
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
34 36
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
35 37
import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
......
51 53

  
52 54
/**
53 55
 * All kind of raster layers should implement this interface.
54
 * 
56
 *
55 57
 * @author Nacho Brodin (nachobrodin@gmail.com)
56 58
 */
57 59
@SuppressWarnings("deprecation")
58 60
public interface FLyrRaster extends FLayer {
59 61
	/**
60 62
	 * Sets the layer as initialized. That's implies that the layer has
61
	 * the right filters and is opened, 
63
	 * the right filters and is opened,
62 64
	 * @param initialized
63 65
	 */
64 66
	public void setLayerInitialized(boolean initialized);
65
	
67

  
66 68
	/**
67 69
	 * Gets the uniform resource identifier
68 70
	 * @return
69 71
	 */
70
	public String getURI();
71
	
72
	public URI getURI();
73

  
72 74
	/**
73 75
	 * Returns true if a color table exists
74 76
	 * @return
75 77
	 */
76 78
	public boolean existColorTable();
77
	
79

  
78 80
	/**
79 81
	 * Define la ultima leyenda valida de la capa o se pone a null para que la
80 82
	 * capa busque una leyenda valida.
81 83
	 * @param ct
82 84
	 */
83 85
	public void setLastLegend(ColorTable ct);
84
	
86

  
85 87
	/**
86 88
	 * Crea el objeto renderizador de raster
87 89
	 * @return Rendering
88 90
	 */
89 91
	public Render getRender();
90
	
92

  
91 93
	/**
92 94
	 * Gets the MapContext object
93 95
	 * @return
94 96
	 */
95 97
	public MapContext getMapContext();
96
	
98

  
97 99
	/**
98 100
	 * Gets the full extent
99 101
	 * @return
100 102
	 */
101 103
	public Extent getFullRasterExtent();
102
	
104

  
103 105
	/**
104 106
	 * Gets the DataStore
105 107
	 * @return
106 108
	 */
107 109
	public RasterDataStore getDataStore();
108
	
110

  
109 111
	/**
110 112
	 * Metodo para consultar si una capa puede ser un RGB. Suponemos que es un RGB
111 113
	 * si el tipo de datos es de tipo byte y su interpretacion de color tiene
......
113 115
	 * @return boolean
114 116
	 */
115 117
	public boolean isRGB();
116
	
118

  
117 119
	/**
118 120
	 * Returns true if the drawn is going to be tiled
119 121
	 * @return
120 122
	 */
121 123
	public boolean isTiled();
122
	
124

  
123 125
	/**
124 126
	 * Gets the regions of interest
125
	 * @return 
126
	 * @throws ROIException 
127
	 * @return
128
	 * @throws ROIException
127 129
	 */
128 130
	public List<ROI> getRois() throws ROIException;
129
	
131

  
130 132
	/**
131 133
	 * Sets the regions of interest
132 134
	 */
133 135
	public void setRois(List<ROI> rois);
134
	
136

  
135 137
	/**
136 138
	 * Sets the files which contain the regions of interest. This method is temporal until
137 139
	 * after the refactoring of ROIs.
......
139 141
	 * @throws RmfSerializerException
140 142
	 */
141 143
	public void setROIsFiles(List<File> file) throws RmfSerializerException;
142
	
144

  
143 145
	/**
144 146
	 * Gets the files which contain the regions of interest. This method is temporal until
145 147
	 * after the refactoring of ROIs.
......
147 149
	 * @throws RmfSerializerException
148 150
	 */
149 151
	public List<File> getROIsFiles() throws RmfSerializerException;
150
	
152

  
151 153
	/**
152 154
	 * Obtiene la proyecci?n del fichero.
153 155
	 * @return IProjection
154 156
	 */
155 157
	public IProjection readProjection() throws RasterDriverException;
156
	
158

  
157 159
	/**
158 160
	 * Gets the tile size
159 161
	 * @return
160 162
	 */
161 163
	public int[] getTileSize();
162
	
164

  
163 165
	/**
164 166
	 * Obtiene el valor NoData asociado al raster.
165 167
	 * @return double
166 168
	 */
167 169
	public NoData getNoDataValue();
168
	
170

  
169 171
	/**
170 172
	 * Returs a string with the extension of the first file
171 173
	 */
172 174
	public String getFileFormat();
173
	
175

  
174 176
	/**
175 177
	 * Obtiene el flag que dice si la imagen est? o no georreferenciada
176 178
	 * @return true si est? georreferenciada y false si no lo est?.
177 179
	 */
178 180
	public boolean isGeoreferenced();
179
	
181

  
180 182
	/**
181 183
	 * Returns the number of bands of each dataset
182 184
	 * @return
183 185
	 */
184 186
	public int[] getBandCountFromDataset();
185
	
187

  
186 188
	/**
187 189
	 * Gets the projection in well known text format
188 190
	 * @return
189 191
	 * @throws RasterDriverException
190 192
	 */
191 193
	public String getWktProjection() throws RasterDriverException;
192
	
194

  
193 195
	/**
194 196
	 * Gets the color interpretation
195 197
	 * @param band
......
197 199
	 * @return
198 200
	 */
199 201
	public String getColorInterpretation(int band, int dataset);
200
	
202

  
201 203
	/**
202 204
	 * When a process is using information of this layer this variable will contain
203 205
	 * the thread ID.
204 206
	 * @param readingData
205 207
	 */
206 208
	public void setReadingData(String readingData);
207
	
209

  
208 210
	/**
209 211
	 * Sets the nodata value for this layer
210 212
	 * @param noDataValue the noDataValue to set
211 213
	 */
212 214
	public void setNoDataValue(NoData noDataValue);
213
	
215

  
214 216
	/**
215 217
	 * Sets the minimum scale visible. Lower scales won't be drawn.
216 218
	 *
......
218 220
	 * @see #getMinScale()
219 221
	 */
220 222
	public void setMinScale(double minScale);
221
	
223

  
222 224
	/**
223 225
	 * Sets the maximum scale visible. Higher scales won't be drawn.
224 226
	 *
......
234 236
	 * @see #setMaxScale(double)
235 237
	 */
236 238
	public double getMaxScale();
237
	
239

  
238 240
	/**
239 241
	 * Returns the minimum scale visible. Lower scales won't be drawn.
240 242
	 *
......
242 244
	 * @see #setMinScale(double)
243 245
	 */
244 246
	public double getMinScale();
245
	
247

  
246 248
	/**
247 249
	 * @return Returns the removeRasterFlag.
248 250
	 */
......
254 256
	 * @param removeRasterFlag The removeRasterFlag to set.
255 257
	 */
256 258
	public void setRemoveRasterFlag(boolean removeRasterFlag);
257
	
259

  
258 260
	/**
259 261
	 * Borra de la lista de listeners el que se pasa como par?metro.
260 262
	 *
......
263 265
	 * @return True si ha sido correcto el borrado del Listener.
264 266
	 */
265 267
	public boolean removeLayerListener(LayerListener o);
266
	
268

  
267 269
	/**
268 270
	 * @throws ReadException
269 271
	 * @throws ReadDriverException
......
272 274
	 * 		com.iver.utiles.swing.threads.Cancellable)
273 275
	 */
274 276
	public void draw(BufferedImage image, Graphics2D g, ViewPort vp, Cancellable cancel, double scale) throws ReadException;
275
	
277

  
276 278
	/**
277 279
	 * Clones this layer
278 280
	 * @return
279 281
	 * @throws Exception
280 282
	 */
281 283
	public FLayer cloneLayer() throws Exception;
282
	
284

  
283 285
	/**
284 286
	 * Gets a layer which the source is a file
285 287
	 * @return
286
	 * @throws RasterDriverException 
288
	 * @throws RasterDriverException
287 289
	 */
288 290
	public FLayer getFileLayer() throws RasterDriverException;
289
	
291

  
290 292
	/**
291
	 * Gets the position of the alpha band  
293
	 * Gets the position of the alpha band
292 294
	 * @return
293 295
	 */
294 296
	public int getAlphaBandNumber();
295
	
297

  
296 298
	public String getName();
297
	
299

  
298 300
	/**
299 301
	 * Gets the projection
300 302
	 * @return
301 303
	 */
302 304
	public IProjection getProjection();
303
	
305

  
304 306
	/**
305 307
	 * Devuelve si es reproyectable o no la capa
306 308
	 * @return
307 309
	 */
308 310
	public boolean isReproyectable();
309
	
311

  
310 312
	/**
311 313
	 * Recupera del raster la matriz de transformaci?n que lo situa en cualquier parte de la vista
312 314
	 * @return AffineTransform
313 315
	 */
314 316
	public AffineTransform getAffineTransform();
315
	
317

  
316 318
	/**
317 319
	 * Obtiene la lista de transformaciones que se han ido aplicando al raster.
318 320
	 * @return Historical. Lista de AffineTransform
319 321
	 */
320 322
	public Historical getAffineTransformHistorical();
321
	
323

  
322 324
	/**
323 325
	 * Asigna al raster la matriz de transformaci?n para situarlo en cualquier parte de la vista
324 326
	 * @param transf
325 327
	 */
326 328
	public void setAffineTransform(AffineTransform transf);
327
	
329

  
328 330
	/**
329 331
	 * Asigna al raster la matriz de transformaci?n para situarlo en cualquier parte de la vista.
330 332
	 * Esta versi?n no guarda en el historico.
331 333
	 * @param transf
332 334
	 */
333 335
	public void setAffineTransformWithoutHistorical(AffineTransform transf);
334
	
336

  
335 337
	/**
336 338
	 * Salva la georreferenciaci?n a fichero rmf.
337 339
	 * @param fName
338 340
	 * @throws RmfSerializerException
339 341
	 */
340 342
	public void saveGeoToRmf() throws RmfSerializerException;
341
	
343

  
342 344
	/**
343 345
	 * Metodo que obtiene si un punto cae dentro de los l?mites de la capa
344 346
	 * o fuera de ellos.
......
346 348
	 * @return true si est? dentro de los l?mites y false si est? fuera
347 349
	 */
348 350
	public boolean isInside(Point2D p);
349
	
351

  
350 352
	/**
351 353
	 * Returns true if this layer is remote
352 354
	 * @return
353 355
	 */
354 356
	public boolean isRemote();
355
	
357

  
356 358
	/**
357 359
	 * Gets the attribute list
358 360
	 * <UL>
......
365 367
	 * @return ArrayList<Object>
366 368
	 */
367 369
	public ArrayList<Object> getAttributes();
368
	
370

  
369 371
	/**
370 372
	 * Returns the full bounding box of this layer
371 373
	 * @return
372 374
	 */
373 375
	public Envelope getFullEnvelope();
374
	
376

  
375 377
	/**
376 378
	 * Ajusta las coordenadas especificadas en el par?metro al ?rea m?xima
377 379
	 * del raster en p?xeles.
378 380
	 * @param req Punto a ajustar dentro del extener del raster
379 381
	 */
380 382
	public Point2D adjustWorldRequest(Point2D req);
381
	
383

  
382 384
	/**
383
	 * Adds a new file. The behavior of this function depends on 
385
	 * Adds a new file. The behavior of this function depends on
384 386
	 * the kind of provider and its implementation.
385 387
	 * @param file
386
	 * @throws InvalidSourceException 
388
	 * @throws InvalidSourceException
387 389
	 */
388
	public void addFile(String file) throws InvalidSourceException;
389
	
390
	public void addFile(File file) throws InvalidSourceException;
391

  
390 392
	/**
391
	 * Removes a file. The behavior of this function depends on 
393
	 * Removes a file. The behavior of this function depends on
392 394
	 * the kind of provider and its implementation.
393 395
	 * @param file
394 396
	 */
395
	public void removeFile(String file);
396
	
397
	public void removeFile(File file);
398

  
397 399
	/**
398 400
	 * When this flag is true then renderice nodata value as transparent
399 401
	 * @param t
400 402
	 */
401 403
	public void setNoDataTransparent(boolean t);
402
	
404

  
403 405
	/**
404 406
	 * Sets the layer projection
405 407
	 * @param proj

Also available in: Unified diff