svn-gvsig-desktop / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / layout / fframes / IFFrame.java @ 33647
History | View | Annotate | Download (8.9 KB)
1 |
/*
|
---|---|
2 |
* Created on 20-feb-2004
|
3 |
*
|
4 |
*/
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
6 |
*
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
8 |
*
|
9 |
* This program is free software; you can redistribute it and/or
|
10 |
* modify it under the terms of the GNU General Public License
|
11 |
* as published by the Free Software Foundation; either version 2
|
12 |
* of the License, or (at your option) any later version.
|
13 |
*
|
14 |
* This program is distributed in the hope that it will be useful,
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
* GNU General Public License for more details.
|
18 |
*
|
19 |
* You should have received a copy of the GNU General Public License
|
20 |
* along with this program; if not, write to the Free Software
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
22 |
*
|
23 |
* For more information, contact:
|
24 |
*
|
25 |
* Generalitat Valenciana
|
26 |
* Conselleria d'Infraestructures i Transport
|
27 |
* Av. Blasco Ib??ez, 50
|
28 |
* 46010 VALENCIA
|
29 |
* SPAIN
|
30 |
*
|
31 |
* +34 963862235
|
32 |
* gvsig@gva.es
|
33 |
* www.gvsig.gva.es
|
34 |
*
|
35 |
* or
|
36 |
*
|
37 |
* IVER T.I. S.A
|
38 |
* Salamanca 50
|
39 |
* 46005 Valencia
|
40 |
* Spain
|
41 |
*
|
42 |
* +34 963163400
|
43 |
* dac@iver.es
|
44 |
*/
|
45 |
package org.gvsig.app.project.documents.layout.fframes; |
46 |
|
47 |
import java.awt.Graphics2D; |
48 |
import java.awt.Image; |
49 |
import java.awt.event.MouseEvent; |
50 |
import java.awt.geom.AffineTransform; |
51 |
import java.awt.geom.Point2D; |
52 |
import java.awt.geom.Rectangle2D; |
53 |
import java.awt.image.BufferedImage; |
54 |
|
55 |
import org.gvsig.app.project.documents.layout.LayoutContext; |
56 |
import org.gvsig.app.project.documents.layout.LayoutControl; |
57 |
import org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable; |
58 |
import org.gvsig.tools.lang.Cloneable; |
59 |
import org.gvsig.tools.persistence.Persistent; |
60 |
|
61 |
|
62 |
|
63 |
/**
|
64 |
* Interface que implementa FFrame.
|
65 |
*
|
66 |
* @author Vicente Caballero Navarro
|
67 |
*/
|
68 |
public interface IFFrame extends IPrintable, Persistent, Cloneable{ |
69 |
public static final int N = 1; |
70 |
public static final int NE = 2; |
71 |
public static final int E = 3; |
72 |
public static final int SE = 4; |
73 |
public static final int S = 5; |
74 |
public static final int SO = 6; |
75 |
public static final int O = 7; |
76 |
public static final int NO = 8; |
77 |
public static final int RECT = 9; |
78 |
/** FFrame no selecccionado. */
|
79 |
public static final int NOSELECT = 0; |
80 |
|
81 |
/**
|
82 |
* Devuelve el boundingBox del fframe en funci?n de la transformada af?n
|
83 |
* que se pasa como par?metro. Si se pasa como par?metro null, devuelve el
|
84 |
* ?ltimo boundingbox que se calcul?.
|
85 |
*
|
86 |
* @param at Transformada af?n
|
87 |
*
|
88 |
* @return Rect?ngulo que representa el BoundingBox del fframe.
|
89 |
*/
|
90 |
public Rectangle2D.Double getBoundingBox(AffineTransform at); |
91 |
|
92 |
/**
|
93 |
* Devuelve el rect?ngulo que representa el fframe en cent?metros.
|
94 |
*
|
95 |
* @return Rect?ngulo en centimetros.
|
96 |
*/
|
97 |
public Rectangle2D.Double getBoundBox(); |
98 |
|
99 |
/**
|
100 |
* Rellena con el rect?ngulo que se pasa como par?metro el boundBox(en
|
101 |
* cent?metros) del fframe del cual con una transformaci?n se podr?
|
102 |
* calcular el BoundingBox (en pixels).
|
103 |
*
|
104 |
* @param rect Rect?ngulo en cent?metros.
|
105 |
*/
|
106 |
public void setBoundBox(Rectangle2D rect); |
107 |
|
108 |
/**
|
109 |
* Este m?todo se implementa en cada una de las fframe, ya que cada una se
|
110 |
* dibuja de una forma diferente sobre el graphics. M?todo que dibuja
|
111 |
* sobre el graphics que se le pasa como par?metro, seg?n la transformada
|
112 |
* afin que se debe de aplicar y el rect?ngulo que se debe de dibujar.
|
113 |
*
|
114 |
* @param g Graphics
|
115 |
* @param at Transformada afin.
|
116 |
* @param r rect?ngulo sobre el que hacer un clip.
|
117 |
* @param imgBase Imagen para acelerar el dibujado.
|
118 |
* @throws ReadDriverException TODO
|
119 |
*/
|
120 |
public void draw(Graphics2D g, AffineTransform at, Rectangle2D r, |
121 |
BufferedImage imgBase);
|
122 |
|
123 |
// /**
|
124 |
// * Implementado para imprimir.
|
125 |
// *
|
126 |
// * @param g Graphics2D de la impresora sobre el que dibujar.
|
127 |
// * @param at DOCUMENT ME!
|
128 |
// */
|
129 |
// public void print(Graphics2D g, AffineTransform at, FShape shape)
|
130 |
// throws ReadDriverException;
|
131 |
|
132 |
/**
|
133 |
* Devuelve el nombre que representa al fframe.
|
134 |
*
|
135 |
* @return String nombre del FFrame.
|
136 |
*/
|
137 |
public String getName(); |
138 |
|
139 |
/**
|
140 |
* Devuelve true, si el punto que se pasa como par?metro esta contenido
|
141 |
* dentro del boundingbox del fframe.
|
142 |
*
|
143 |
* @param p punto a comprobar.
|
144 |
*
|
145 |
* @return true si el punto esta dentro del boundingbox.
|
146 |
*/
|
147 |
public boolean contains(Point2D p); |
148 |
|
149 |
/**
|
150 |
* Dibuja los handlers sobre el boundingBox en el graphics que se pasa como
|
151 |
* par?metro.
|
152 |
*
|
153 |
* @param g Graphics sobre el que dibujar.
|
154 |
*/
|
155 |
public void drawHandlers(Graphics2D g); |
156 |
|
157 |
/**
|
158 |
* Pasando como par?metro true, se toma como que est? seleccionado el
|
159 |
* fframe y si es false como que esta sin seleccionar, de esta forma se
|
160 |
* selecciona un fframe directamente sin comprobar si un punto est?
|
161 |
* contenido en ?l.
|
162 |
*
|
163 |
* @param b true si se quiere seleccionar y false si se quiere
|
164 |
* deseleccionar.
|
165 |
*/
|
166 |
public void setSelected(Point2D b, MouseEvent e); |
167 |
|
168 |
/**
|
169 |
* Establece que tipo de selecci?n se realiza sobre el fframe.
|
170 |
*
|
171 |
* @param b punto sobre el que se debe de establecer si se selecciona o no
|
172 |
* el fframe.
|
173 |
*/
|
174 |
public void setSelected(boolean b); |
175 |
|
176 |
/**
|
177 |
* Devuelve un entero que representa el tipo de selecci?n que se ha
|
178 |
* realizado sobre el fframe.
|
179 |
*
|
180 |
* @return tipo de selecci?n que se ha realizado.
|
181 |
*/
|
182 |
public int getSelected(); |
183 |
|
184 |
/**
|
185 |
* Devuelve un entero que representa donde esta contenido el punto que se
|
186 |
* pasa como par?metro.
|
187 |
*
|
188 |
* @param p punto a comparar.
|
189 |
*
|
190 |
* @return entero que representa como esta contenido el punto.
|
191 |
*/
|
192 |
public int getContains(Point2D p); |
193 |
|
194 |
/**
|
195 |
* Devuelve el Cursor adecuado seg?n como est? contenido el punto, si es
|
196 |
* para desplazamiento, o cambio de tama?o.
|
197 |
*
|
198 |
* @param p punto a comprobar.
|
199 |
*
|
200 |
* @return Cursor adecuado a la posici?n.
|
201 |
*/
|
202 |
public Image getMapCursor(Point2D p); |
203 |
|
204 |
/**
|
205 |
* Devuelve el rect?ngulo a partir del desplazamiento en el eje x y el
|
206 |
* desplazamiento en el eje y.
|
207 |
*
|
208 |
* @param difx desplazamiento sobre el eje x.
|
209 |
* @param dify desplazamiento sobre el eje y.
|
210 |
*
|
211 |
* @return rect?ngulo modificado en funci?n del desplazamiento realizado.
|
212 |
*/
|
213 |
public Rectangle2D getMovieRect(int difx, int dify); |
214 |
|
215 |
/**
|
216 |
* Dibuja un rect?ngulo de color gris, con el nombre en el centro y
|
217 |
* escalado en forma de borrador.
|
218 |
*
|
219 |
* @param g Graphics sobre el que se dibuja.
|
220 |
*/
|
221 |
public void drawDraft(Graphics2D g); |
222 |
|
223 |
/**
|
224 |
* Actualiza el BoundBox del FFrame a partir de su rect?ngulo en pixels y
|
225 |
* la matriz de transformaci?n.
|
226 |
*
|
227 |
* @param r Rect?ngulo.
|
228 |
* @param at Matriz de transformaci?n.
|
229 |
*/
|
230 |
public void updateRect(Rectangle2D r, AffineTransform at); |
231 |
|
232 |
/**
|
233 |
* Devuelve true si el rect?ngulo primero es null o si es distinto de null
|
234 |
* e intersecta.
|
235 |
*
|
236 |
* @param rv Rect?ngulo
|
237 |
* @param r Rect?ngulo
|
238 |
*
|
239 |
* @return True si intersecta o es null.
|
240 |
*/
|
241 |
public boolean intersects(Rectangle2D rv, Rectangle2D r); |
242 |
|
243 |
/**
|
244 |
* Introduce el n?mero de FFrame en el que de que se trata.
|
245 |
*
|
246 |
* @param i n?mero de FFrame
|
247 |
*/
|
248 |
public void setNum(int i); |
249 |
|
250 |
|
251 |
/**
|
252 |
* Devuelve el nombre que representa al tipo de FFrame.
|
253 |
*
|
254 |
* @return nombre del elemento.
|
255 |
*/
|
256 |
public String getNameFFrame(); |
257 |
|
258 |
/**
|
259 |
* Rellena el tag.
|
260 |
*
|
261 |
* @param s valor del tag.
|
262 |
*/
|
263 |
public void setTag(String s); |
264 |
|
265 |
/**
|
266 |
* Devuelve el valor del tag.
|
267 |
*
|
268 |
* @return String del valor del tag.
|
269 |
*/
|
270 |
public String getTag(); |
271 |
|
272 |
/**
|
273 |
* Dibuja el s?mbolo que indica que el FFrame contiene un tag.
|
274 |
*
|
275 |
* @param g Graphics sobre el que dibujar.
|
276 |
*/
|
277 |
public void drawSymbolTag(Graphics2D g); |
278 |
|
279 |
/**
|
280 |
* Rellena la rotaci?n del BoundingBox.
|
281 |
*
|
282 |
* @param rotation rotaci?n que se quiere aplicar.
|
283 |
*/
|
284 |
public void setRotation(double rotation); |
285 |
|
286 |
/**
|
287 |
* Devuelve la rotaci?n del BoundingBox.
|
288 |
*
|
289 |
* @return Rotaci?n del BoundingBox.
|
290 |
*/
|
291 |
public double getRotation(); |
292 |
|
293 |
/**
|
294 |
* Devuelve el nivel al que se encuentra el FFrame en el Layout.
|
295 |
*
|
296 |
* @return nivel.
|
297 |
*/
|
298 |
public int getLevel(); |
299 |
|
300 |
/**
|
301 |
* Inserta el nivel de dibujado del FFrame respecto del resto de fframes
|
302 |
* del Layout.
|
303 |
*
|
304 |
* @param l nivel.
|
305 |
*/
|
306 |
public void setLevel(int l); |
307 |
public Rectangle2D getLastMoveRect(); |
308 |
|
309 |
public void setLayoutContext(LayoutContext layoutContext); |
310 |
public LayoutContext getLayoutContext();
|
311 |
|
312 |
public void setLayoutControl(LayoutControl layoutControl); |
313 |
public LayoutControl getLayoutControl();
|
314 |
|
315 |
public void setFrameFactory(FrameFactory frameFactory); |
316 |
public FrameFactory getFrameFactory();
|
317 |
} |