root / branches / Mobile_Compatible_Hito_1 / libFMap / src / es / prodevelop / gvsig / mobile / fmap / driver / raster / RasterAdapter.java @ 21606
History | View | Annotate | Download (3.71 KB)
1 |
/*
|
---|---|
2 |
* Created on 20-dic-2004
|
3 |
*/
|
4 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
5 |
*
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Generalitat Valenciana
|
25 |
* Conselleria d'Infraestructures i Transport
|
26 |
* Av. Blasco Ib??ez, 50
|
27 |
* 46010 VALENCIA
|
28 |
* SPAIN
|
29 |
*
|
30 |
* +34 963862235
|
31 |
* gvsig@gva.es
|
32 |
* www.gvsig.gva.es
|
33 |
*
|
34 |
* or
|
35 |
*
|
36 |
* IVER T.I. S.A
|
37 |
* Salamanca 50
|
38 |
* 46005 Valencia
|
39 |
* Spain
|
40 |
*
|
41 |
* +34 963163400
|
42 |
* dac@iver.es
|
43 |
*/
|
44 |
/************************************************
|
45 |
* *
|
46 |
* Modfied By: *
|
47 |
* Prodevelop Integraci?n de Tecnolog?as SL *
|
48 |
* Conde Salvatierra de ?lava , 34-10 *
|
49 |
* 46004 Valencia *
|
50 |
* Spain *
|
51 |
* *
|
52 |
* +34 963 510 612 *
|
53 |
* +34 963 510 968 *
|
54 |
* gis@prodevelop.es *
|
55 |
* http://www.prodevelop.es *
|
56 |
* *
|
57 |
* gvSIG Mobile Team 2006 *
|
58 |
* *
|
59 |
************************************************/
|
60 |
|
61 |
package es.prodevelop.gvsig.mobile.fmap.driver.raster; |
62 |
|
63 |
import java.awt.Graphics2D; |
64 |
import java.awt.geom.Rectangle2D; |
65 |
|
66 |
import es.prodevelop.gvsig.mobile.fmap.driver.FMapDriverException; |
67 |
import es.prodevelop.gvsig.mobile.fmap.viewport.ViewPort; |
68 |
|
69 |
public class RasterAdapter { |
70 |
private boolean driverInitialized = false; |
71 |
private RasterDriver driver;
|
72 |
|
73 |
/**
|
74 |
* Establece el driver sobre el que act?a el adaptador
|
75 |
*/
|
76 |
public void setDriver(RasterDriver drv) { |
77 |
this.driver = drv;
|
78 |
} |
79 |
|
80 |
/**
|
81 |
* Obtiene una referencia al objeto que implementa la interfaz vectorial con
|
82 |
* el fin de que las Strategy puedan optimizar en funci?n del driver.
|
83 |
*/
|
84 |
public RasterDriver getDriver(){
|
85 |
return driver;
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* Obtiene el valor de transparencia
|
90 |
* @return entero que representa el valor de transparencia
|
91 |
*/
|
92 |
public int getTransparency() { |
93 |
return ((RasterDriver) driver).getTransparency();
|
94 |
} |
95 |
|
96 |
/**
|
97 |
* Asigna el valor de transparencia
|
98 |
* @param trans entero que representa el valor de transparencia
|
99 |
*/
|
100 |
public void setTransparency(int trans) { |
101 |
((RasterDriver) driver).setTransparency(trans); |
102 |
} |
103 |
|
104 |
/**
|
105 |
* @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, ISymbol)
|
106 |
*/
|
107 |
public void draw(Graphics2D g, ViewPort vp) throws FMapDriverException { |
108 |
((RasterDriver) driver).draw(g, vp); |
109 |
} |
110 |
|
111 |
/**
|
112 |
* Obtiene la lista de atributos de raster
|
113 |
* @return lista de atributos. Cada elmento de la lista es un array Object
|
114 |
* con dos elementos. El primero el nombre del atributo y el segundo el valor
|
115 |
* del mismo.
|
116 |
*/
|
117 |
|
118 |
/**
|
119 |
* Obtiene el n?mero de bandas de la imagen
|
120 |
* @return n?mero de bandas
|
121 |
*/
|
122 |
public int getNumBands(){ |
123 |
return ((RasterDriver)driver).getNumBands();
|
124 |
} |
125 |
|
126 |
/**
|
127 |
* Obtiene el extent de la vista
|
128 |
* @return extent
|
129 |
*/
|
130 |
public Rectangle2D getFullExtent(){ |
131 |
return ((RasterDriver)driver).getFullExtent();
|
132 |
} |
133 |
|
134 |
public boolean isGeoreferenced() { |
135 |
return ((GeorreferencedRasterDriver)driver).isGeoreferenced();
|
136 |
} |
137 |
|
138 |
} |