Statistics
| Revision:

gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.swing / org.gvsig.raster.georeferencing.swing.api / src / main / java / org / gvsig / raster / georeferencing / swing / view / GeorefCanvas.java @ 1717

History | View | Annotate | Download (5.86 KB)

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

    
24
import java.awt.Color;
25
import java.awt.geom.Point2D;
26
import java.awt.geom.Rectangle2D;
27
import java.awt.image.BufferedImage;
28
import java.util.List;
29

    
30
/**
31
 * Zona de dibujado del raster
32
 * 21/12/2007
33
 * @author Nacho Brodin nachobrodin@gmail.com
34
 */
35
public interface GeorefCanvas  {
36
        
37
    
38
    /**
39
         * Asigna los par?metros de dibujado
40
         * @param img Buffer con un ?rea de datos
41
         * @param ext Rectangle2D del ?rea de datos dada 
42
         * @param pixelSize Tama?o de pixel
43
         * @param center Punto del ?rea de datos donde se quiere centrar el dibujado del buffer
44
         */
45
        public void setDrawParams(BufferedImage img, Rectangle2D ext, double pixelSize, Point2D center);
46
        
47
        /**
48
         * Asigna el listener de eventos de la vista
49
         * @param listener
50
         */
51
        public void setViewListener(ViewListener listener);
52
        
53
        /**
54
         * Asigna un nuevo centro de visualizaci?n
55
         * @param center
56
         */
57
        public void setCenter(Point2D center);
58
        
59
        public void repaint();
60
        
61
        /**
62
         * Conversi?n de un punto en coordenadas del canvas a reales
63
         * @param p
64
         * @return
65
         */
66
        public Point2D viewCoordsToWorld(Point2D p);
67
        
68
        /**
69
         * Conversi?n de un punto en coordenadas del canvas a reales
70
         * @param p
71
         * @return
72
         */
73
        public Point2D viewCoordsFromWorld(Point2D p);
74
        
75
        /**
76
         * Obtiene el extent del canvas en coordenadas del mundo real
77
         * @return Rectangle2D
78
         */
79
        public Rectangle2D getExtent();
80
        
81
        /**
82
         * Asigna un nuevo centro de visualizaci?n en coordenadas del
83
         * componente.
84
         * @param center
85
         */
86
        public void setViewCenter(Point2D c);
87
        
88
        /**
89
         * Asigna un nuevo centro de visualizaci?n en coordenadas pixel
90
         * del ?rea de dibujado (canvas). El nuevo centro ser? calculado en coordenadas
91
         * del mapa.
92
         * @param center
93
         */
94
        public void setPixelCenter(Point2D c);
95
        
96
        /**
97
         * Asigna un nuevo centro de visualizaci?n en coordenadas pixel. Esta llamada tiene
98
         * en cuenta solo p?xeles completos. No centra sobre porciones de pixel cuando el zoom es
99
         * mayor de 1:1. El nuevo centro es en coordenadas del mapa pero siempre centrar?
100
         * en la esquina inferior izquierda del pixel.
101
         * @param center
102
         */
103
        public void setPixelCenter(int x, int y);
104
        
105
        /**
106
         * Asigna una capa gr?fica
107
         * @param layer IGraphicLayer
108
         */
109
        public void setGraphicLayer(IGraphicLayer layer);
110
        
111
        /**
112
         * Obtiene la lista de capas gr?ficas
113
         * @return
114
         */
115
        public List<IGraphicLayer> getGraphicLayers();
116
        
117
        /**
118
         * Asigna la escala para el nuevo zoom
119
         * @param scale
120
         */
121
        public void setZoom(double scale);
122
        
123
        /**
124
         * Obtiene la escala aplicada en el dibujado
125
         * @return double
126
         */
127
        public double getZoom();
128
        
129
        /**
130
         * Obtiene el extent actual asignado al canvas
131
         * @return Rectangle2D
132
         */
133
        public Rectangle2D getCanvasExtent();
134
        
135
        /**
136
         * Asigna el extent del canvas
137
         * @param r
138
         */
139
        public void setCanvasExtent(Rectangle2D r);
140
        
141
        /**
142
         * Obtiene el tama?o de pixel
143
         * @return double
144
         */
145
        public double getPixelSize();
146
        
147
        /**
148
         * Obtiene el centro del canvas
149
         * @return Point2D
150
         */
151
        public Point2D getCenter();
152

    
153
        /**
154
         * Asigna la tool seleccionada
155
         * @param selectedTool
156
         */
157
        //public void setSelectedTool(BaseViewTool selectedTool);
158
        
159
        /**
160
         * Obtiene la herramienta seleccionada
161
         * @return BaseViewTool
162
         */
163
        //public BaseViewTool getSelectedTool();
164

    
165
        /**
166
         * Activa o desactiva el mostrado de informaci?n
167
         * @param showInfo
168
         */
169
        public void setShowInfo(boolean showInfo);
170
        
171
        /**
172
         * Asigna el valor para el flag minxMaxyUL. Este flag informa de que la esquina 
173
         * superior izquierda corresponde con el valor de m?nimo X y m?ximo Y. En caso 
174
         * de ser false esta esquina ser?a de m?nimo X y m?nimo Y.
175
         * @param v
176
         */
177
        public void setMinxMaxyUL(boolean v);
178
        
179
        /**
180
         * Obtiene el valor para el flag minxMaxyUL. Este flag informa de que la esquina 
181
         * superior izquierda corresponde con el valor de m?nimo X y m?ximo Y. En caso 
182
         * de ser false esta esquina ser?a de m?nimo X y m?nimo Y.
183
         * @param v
184
         */
185
        public boolean getMinxMaxyUL();
186

    
187
        /**
188
         * Asigna el color del texto
189
         * @param textColor
190
         */
191
        public void setTextColor(Color textColor);
192

    
193
        /**
194
         * Obtiene el color del texto
195
         * @return
196
         */
197
        public Color getTextColor();
198

    
199
        /**
200
         * Obtiene el color de fondo
201
         * @return
202
         */
203
        public Color getBackgroundColor();
204

    
205
        /**
206
         * Asigna el color de fondo
207
         * @param backgroundColor
208
         */
209
        public void setBackgroundColor(Color backgroundColor);
210

    
211
        /**
212
         * Normalmente no se hace una petici?n al dibujado del raster si el extent no ha variado. Si esta variable
213
     * est? a true fuerza que haya una petici?n de redibujado aunque el extent del raster no haya cambiado.
214
     * Esto solo se hace para una petici?n. La siguiente vuelve a estar a false.
215
         * @return
216
         */
217
        public boolean isForceRequest();
218

    
219
        /**
220
         * Normalmente no se hace una petici?n al dibujado del raster si el extent no ha variado. Si esta variable
221
     * est? a true fuerza que haya una petici?n de redibujado aunque el extent del raster no haya cambiado.
222
     * Esto solo se hace para una petici?n. La siguiente vuelve a estar a false.
223
         * @param forceRequest
224
         */
225
        public void setForceRequest(boolean forceRequest);
226
}