root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / layout / Layout.java @ 6036
History | View | Annotate | Download (44.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 com.iver.cit.gvsig.gui.layout; |
46 |
|
47 |
import java.awt.Color; |
48 |
import java.awt.Component; |
49 |
import java.awt.Cursor; |
50 |
import java.awt.Graphics; |
51 |
import java.awt.Graphics2D; |
52 |
import java.awt.Image; |
53 |
import java.awt.Point; |
54 |
import java.awt.Rectangle; |
55 |
import java.awt.Toolkit; |
56 |
import java.awt.event.ActionEvent; |
57 |
import java.awt.event.KeyEvent; |
58 |
import java.awt.geom.AffineTransform; |
59 |
import java.awt.geom.Rectangle2D; |
60 |
import java.awt.image.BufferedImage; |
61 |
import java.awt.print.PageFormat; |
62 |
import java.awt.print.Printable; |
63 |
import java.awt.print.PrinterException; |
64 |
import java.awt.print.PrinterJob; |
65 |
import java.beans.PropertyChangeEvent; |
66 |
import java.beans.PropertyChangeListener; |
67 |
import java.io.File; |
68 |
import java.util.ArrayList; |
69 |
import java.util.Hashtable; |
70 |
|
71 |
import javax.print.Doc; |
72 |
import javax.print.DocFlavor; |
73 |
import javax.print.DocPrintJob; |
74 |
import javax.print.PrintException; |
75 |
import javax.print.PrintService; |
76 |
import javax.print.PrintServiceLookup; |
77 |
import javax.print.ServiceUI; |
78 |
import javax.print.SimpleDoc; |
79 |
import javax.print.attribute.PrintRequestAttributeSet; |
80 |
import javax.print.event.PrintJobAdapter; |
81 |
import javax.print.event.PrintJobEvent; |
82 |
import javax.print.event.PrintJobListener; |
83 |
import javax.swing.AbstractAction; |
84 |
import javax.swing.Action; |
85 |
import javax.swing.ImageIcon; |
86 |
import javax.swing.JFileChooser; |
87 |
import javax.swing.JOptionPane; |
88 |
import javax.swing.JPanel; |
89 |
import javax.swing.KeyStroke; |
90 |
import javax.swing.filechooser.FileFilter; |
91 |
|
92 |
import org.apache.log4j.Logger; |
93 |
|
94 |
import com.iver.andami.PluginServices; |
95 |
import com.iver.andami.messages.NotificationManager; |
96 |
import com.iver.andami.ui.mdiManager.SingletonView; |
97 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
98 |
import com.iver.andami.ui.mdiManager.ViewListener; |
99 |
import com.iver.cit.gvsig.AddLayer; |
100 |
import com.iver.cit.gvsig.fmap.ColorEvent; |
101 |
import com.iver.cit.gvsig.fmap.DriverException; |
102 |
import com.iver.cit.gvsig.fmap.ExtentEvent; |
103 |
import com.iver.cit.gvsig.fmap.ProjectionEvent; |
104 |
import com.iver.cit.gvsig.fmap.ViewPortListener; |
105 |
import com.iver.cit.gvsig.fmap.core.adapter.CircleAdapter; |
106 |
import com.iver.cit.gvsig.fmap.core.adapter.GeometryAdapter; |
107 |
import com.iver.cit.gvsig.fmap.core.adapter.PointAdapter; |
108 |
import com.iver.cit.gvsig.fmap.core.adapter.PolyLineAdapter; |
109 |
import com.iver.cit.gvsig.fmap.core.adapter.PolygonAdapter; |
110 |
import com.iver.cit.gvsig.fmap.core.adapter.RectangleAdapter; |
111 |
import com.iver.cit.gvsig.fmap.edition.commands.CommandListener; |
112 |
import com.iver.cit.gvsig.fmap.layers.XMLException; |
113 |
import com.iver.cit.gvsig.gui.layout.commands.DefaultEditableFeatureSource; |
114 |
import com.iver.cit.gvsig.gui.layout.commands.EditableFeatureSource; |
115 |
import com.iver.cit.gvsig.gui.layout.dialogs.FConfigLayoutDialog; |
116 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrame; |
117 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameTable; |
118 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics; |
119 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup; |
120 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend; |
121 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameNorth; |
122 |
import com.iver.cit.gvsig.gui.layout.fframes.FFramePicture; |
123 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar; |
124 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameText; |
125 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameView; |
126 |
import com.iver.cit.gvsig.gui.layout.fframes.IFFrame; |
127 |
import com.iver.cit.gvsig.gui.layout.fframes.IFFrameEditableVertex; |
128 |
import com.iver.cit.gvsig.gui.layout.fframes.IFFrameLayoutDependence; |
129 |
import com.iver.cit.gvsig.gui.layout.fframes.IFFrameUseFMap; |
130 |
import com.iver.cit.gvsig.gui.layout.fframes.IFFrameViewDependence; |
131 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameBoxDialog; |
132 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameGraphicsDialog; |
133 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameGroupDialog; |
134 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameLegendDialog; |
135 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameNorthDialog; |
136 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFramePictureDialog; |
137 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameScaleBarDialog; |
138 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameTextDialog; |
139 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameViewDialog; |
140 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog; |
141 |
import com.iver.cit.gvsig.gui.project.MapProperties; |
142 |
import com.iver.cit.gvsig.gui.project.OpenException; |
143 |
import com.iver.cit.gvsig.gui.project.SaveException; |
144 |
import com.iver.cit.gvsig.project.Project; |
145 |
import com.iver.cit.gvsig.project.ProjectMap; |
146 |
import com.iver.utiles.GenericFileFilter; |
147 |
import com.iver.utiles.XMLEntity; |
148 |
|
149 |
/**
|
150 |
* Mapa.
|
151 |
*
|
152 |
* @author Vicente Caballero Navarro
|
153 |
*/
|
154 |
public class Layout extends JPanel implements SingletonView, ViewPortListener, |
155 |
ViewListener, CommandListener { |
156 |
private static Logger logger = Logger.getLogger(Layout.class.getName()); |
157 |
|
158 |
public static final int ZOOM_MAS = 1; |
159 |
|
160 |
public static final int ZOOM_MENOS = 2; |
161 |
|
162 |
public static final int PAN = 3; |
163 |
|
164 |
public static final int DESACTUALIZADO = 4; |
165 |
|
166 |
public static final int ACTUALIZADO = 5; |
167 |
|
168 |
public static final int SELECT = 6; |
169 |
|
170 |
public static final int RECTANGLE = 10; |
171 |
|
172 |
public static final int RECTANGLEVIEW = 11; |
173 |
|
174 |
public static final int RECTANGLEPICTURE = 12; |
175 |
|
176 |
public static final int RECTANGLESCALEBAR = 13; |
177 |
|
178 |
public static final int RECTANGLELEGEND = 14; |
179 |
|
180 |
public static final int RECTANGLETEXT = 15; |
181 |
|
182 |
public static final int RECTANGLEGROUP = 16; |
183 |
|
184 |
public static final int RECTANGLESYMBOL = 17; |
185 |
|
186 |
public static final int RECTANGLENORTH = 18; |
187 |
|
188 |
public static final int RECTANGLEBOX = 19; |
189 |
|
190 |
public static final int GRAPHICS = 20; |
191 |
|
192 |
public static final int POINT = 21; |
193 |
|
194 |
public static final int LINE = 22; |
195 |
|
196 |
public static final int POLYLINE = 23; |
197 |
|
198 |
public static final int RECTANGLESIMPLE = 24; |
199 |
|
200 |
public static final int CIRCLE = 25; |
201 |
|
202 |
public static final int POLYGON = 26; |
203 |
|
204 |
public static final int VIEW_ZOOMIN = 30; |
205 |
|
206 |
public static final int VIEW_ZOOMOUT = 31; |
207 |
|
208 |
public static final int VIEW_FULL = 32; |
209 |
|
210 |
public static final int VIEW_PAN = 33; |
211 |
|
212 |
public static final int SET_TAG = 34; |
213 |
|
214 |
public static final int EDIT = 40; |
215 |
|
216 |
public static final Image iLayoutpan = new ImageIcon(AddLayer.class |
217 |
.getClassLoader().getResource("images/LayoutHand.gif")).getImage();
|
218 |
|
219 |
public static final Image ipan = new ImageIcon(AddLayer.class |
220 |
.getClassLoader().getResource("images/Hand.gif")).getImage();
|
221 |
|
222 |
public static final Image iLayoutzoomin = new ImageIcon(AddLayer.class |
223 |
.getClassLoader().getResource("images/LayoutZoomInCursor.gif"))
|
224 |
.getImage(); |
225 |
|
226 |
public static final Image izoomin = new ImageIcon(AddLayer.class |
227 |
.getClassLoader().getResource("images/ZoomInCursor.gif"))
|
228 |
.getImage(); |
229 |
|
230 |
public static final Image iLayoutzoomout = new ImageIcon(AddLayer.class |
231 |
.getClassLoader().getResource("images/LayoutZoomOutCursor.gif"))
|
232 |
.getImage(); |
233 |
|
234 |
public static final Image izoomout = new ImageIcon(AddLayer.class |
235 |
.getClassLoader().getResource("images/ZoomOutCursor.gif"))
|
236 |
.getImage(); |
237 |
|
238 |
public static final Image iinfo = new ImageIcon(AddLayer.class |
239 |
.getClassLoader().getResource("images/InfoCursor.gif")).getImage();
|
240 |
|
241 |
public static final Image icrux = new ImageIcon(AddLayer.class |
242 |
.getClassLoader().getResource("images/CruxCursor.png")).getImage();
|
243 |
|
244 |
public static final Image itag = new ImageIcon(AddLayer.class |
245 |
.getClassLoader().getResource("images/tagCursor.gif")).getImage();
|
246 |
|
247 |
public static final Image iPoint = new ImageIcon(AddLayer.class |
248 |
.getClassLoader().getResource("images/PointCursor.png")).getImage();
|
249 |
|
250 |
public static final Image iRect = new ImageIcon(AddLayer.class |
251 |
.getClassLoader().getResource("images/RectCursor.png")).getImage();
|
252 |
|
253 |
public static final Image iLine = new ImageIcon(AddLayer.class |
254 |
.getClassLoader().getResource("images/LineCursor.png")).getImage();
|
255 |
|
256 |
public static final Image iRectangle = new ImageIcon(AddLayer.class |
257 |
.getClassLoader().getResource("images/RectangleCursor.png"))
|
258 |
.getImage(); |
259 |
|
260 |
public static final Image iCircle = new ImageIcon(AddLayer.class |
261 |
.getClassLoader().getResource("images/CircleCursor.png"))
|
262 |
.getImage(); |
263 |
|
264 |
public static final Image iPoligon = new ImageIcon(AddLayer.class |
265 |
.getClassLoader().getResource("images/PoligonCursor.png"))
|
266 |
.getImage(); |
267 |
|
268 |
public static Hashtable nums = new Hashtable(); |
269 |
|
270 |
private Point origin = new Point(50, 50); |
271 |
|
272 |
private Point rectOrigin = new Point(origin); |
273 |
|
274 |
private Rectangle2D.Double rect = new Rectangle2D.Double(rectOrigin.x, |
275 |
rectOrigin.y, 400, 300); |
276 |
|
277 |
private Point m_FirstPoint = new Point(0, 0); |
278 |
|
279 |
private Point m_PointAnt = new Point(0, 0); |
280 |
|
281 |
private Point m_LastPoint = new Point(0, 0); |
282 |
|
283 |
private EventsHandler events;
|
284 |
|
285 |
private int tool = ZOOM_MAS; |
286 |
|
287 |
private int status = DESACTUALIZADO; |
288 |
|
289 |
private BufferedImage img = null; |
290 |
|
291 |
private BufferedImage imgRuler = null; |
292 |
|
293 |
private AffineTransform m_MatrizTransf; |
294 |
|
295 |
private Rectangle2D rectVisible; |
296 |
|
297 |
private IFFrameDialog fframedialog = null; |
298 |
|
299 |
private IFFrame[] fframes; |
300 |
|
301 |
private MapProperties m_propertiesLayout = null; |
302 |
|
303 |
private Attributes m_attributes = null; |
304 |
|
305 |
private PrintService[] m_cachePrintServices = null; |
306 |
|
307 |
private PrintService m_cachePrintService = null; |
308 |
|
309 |
private boolean m_bCancelDrawing = false; |
310 |
|
311 |
private boolean isCuadricula = false; |
312 |
|
313 |
private boolean initial = true; |
314 |
|
315 |
private ProjectMap map = null; |
316 |
|
317 |
private Rectangle reSel = null; |
318 |
|
319 |
private boolean isReSel = true; |
320 |
|
321 |
private boolean m_showRuler = true; |
322 |
|
323 |
private FLayoutDraw layoutDraw = null; |
324 |
|
325 |
private boolean isDrawCuadricula = true; |
326 |
|
327 |
private Doc doc = null; |
328 |
|
329 |
private PrintRequestAttributeSet att = null; |
330 |
|
331 |
private GeometryAdapter geometryAdapter = new PolyLineAdapter(); |
332 |
|
333 |
private DefaultEditableFeatureSource efs;
|
334 |
|
335 |
private boolean isEditable = true; |
336 |
|
337 |
private ViewInfo m_viewInfo = null; |
338 |
|
339 |
private int numBefore = 0; |
340 |
|
341 |
private int numBehind = 0; |
342 |
|
343 |
/**
|
344 |
* Lo usamos cuando estamos haciendo una ficha y asignando tags Se pone en
|
345 |
* modo debug cuando hacemos un VIEW_TAGS
|
346 |
*/
|
347 |
private boolean bModeDebug = false; |
348 |
|
349 |
private boolean editGroup; |
350 |
|
351 |
/**
|
352 |
* Creates a new Layout object.
|
353 |
*/
|
354 |
public Layout() {
|
355 |
efs = new DefaultEditableFeatureSource();
|
356 |
updateFFrames(); |
357 |
this.setLayout(null); |
358 |
events = new EventsHandler(this); |
359 |
layoutDraw = new FLayoutDraw(this); |
360 |
addComponentListener(events); |
361 |
addMouseMotionListener(events); |
362 |
addMouseListener(events); |
363 |
addKeyListener(events); |
364 |
m_MatrizTransf = new AffineTransform(); |
365 |
m_MatrizTransf.setToIdentity(); |
366 |
this.initComponents();
|
367 |
} |
368 |
|
369 |
/**
|
370 |
* Rellena el ProjectMap del Layout.
|
371 |
*
|
372 |
* @param m
|
373 |
* ProjectMap.
|
374 |
*/
|
375 |
public void setProjectMap(ProjectMap m) { |
376 |
map = m; |
377 |
this.setName(m.getName());
|
378 |
map.addPropertyChangeListener(new PropertyChangeListener() { |
379 |
public void propertyChange(PropertyChangeEvent evt) { |
380 |
if (evt.getPropertyName().equals("name")) { |
381 |
PluginServices.getMDIManager().getViewInfo(Layout.this) |
382 |
.setTitle( |
383 |
PluginServices.getText(this, "Mapa") |
384 |
+ " : "
|
385 |
+ (String) evt.getNewValue());
|
386 |
} |
387 |
} |
388 |
}); |
389 |
} |
390 |
|
391 |
/**
|
392 |
* Devuelve el rect?ngulo de selecci?n por rect?ngulo.
|
393 |
*
|
394 |
* @return Rect?ngulo de selecci?n.
|
395 |
*/
|
396 |
public Rectangle getReSel() { |
397 |
return reSel;
|
398 |
} |
399 |
|
400 |
/**
|
401 |
* Devuelve true si se debe dibujar el rect?ngulo de selecci?n y realizar la
|
402 |
* sellecci?n.
|
403 |
*
|
404 |
* @return true si se realiza la selecci?n por rect?ngulo.
|
405 |
*/
|
406 |
public boolean isReSel() { |
407 |
return isReSel;
|
408 |
} |
409 |
|
410 |
/**
|
411 |
* Rellena con true si se debe de dibujar y seleccionar por rect?ngulo de
|
412 |
* selecci?n.
|
413 |
*
|
414 |
* @param b
|
415 |
* boolean.
|
416 |
*/
|
417 |
public void setIsReSel(boolean b) { |
418 |
isReSel = b; |
419 |
} |
420 |
|
421 |
/**
|
422 |
* Devuelve true si el dibujado ha sido cancelado.
|
423 |
*
|
424 |
* @return true si el dibujado ha sido cancelado.
|
425 |
*/
|
426 |
public synchronized boolean isDrawingCancelled() { |
427 |
return m_bCancelDrawing;
|
428 |
} |
429 |
|
430 |
/**
|
431 |
* Pone el dibuja a cancelado o no seg?n se quiera.
|
432 |
*
|
433 |
* @param b
|
434 |
* true si se quiere cancelar el dibujado.
|
435 |
*/
|
436 |
public synchronized void setCancelDrawing(boolean b) { |
437 |
m_bCancelDrawing = b; |
438 |
|
439 |
for (int i = 0; i < getFFrames().length; i++) { |
440 |
IFFrame fframe = (IFFrame) getFFrame(i); |
441 |
|
442 |
if (fframe instanceof IFFrameUseFMap |
443 |
&& (((IFFrameUseFMap) fframe).getFMap() != null)) {
|
444 |
// //TODO((FFrameView)
|
445 |
// getFFrames().get(i)).getFMap().setCancelDrawing(b);
|
446 |
} |
447 |
} |
448 |
} |
449 |
|
450 |
/**
|
451 |
* Obtiene el ArrayList con todos los FFrames que se han a?adido al Layout.
|
452 |
*
|
453 |
* @return Array con todos los fframes que contiene el Layout.
|
454 |
*/
|
455 |
public IFFrame[] getFFrames() { |
456 |
return fframes;
|
457 |
} |
458 |
|
459 |
public IFFrame getFFrame(int i) { |
460 |
return fframes[i];
|
461 |
} |
462 |
|
463 |
public void updateFFrames() { |
464 |
ArrayList frames = new ArrayList(); |
465 |
IFFrame[] auxfframes = efs.getFFrames();
|
466 |
for (int j = numBehind; j <= numBefore; j++) { |
467 |
for (int i = 0; i < auxfframes.length; i++) { |
468 |
if (auxfframes[i].getLevel() == j) {
|
469 |
frames.add(auxfframes[i]); |
470 |
continue;
|
471 |
} |
472 |
} |
473 |
} |
474 |
fframes = (IFFrame[]) frames.toArray(new IFFrame[0]); |
475 |
} |
476 |
|
477 |
/**
|
478 |
* Obtiene el rect que se ajusta al tama?o de la ventana, para ver el folio
|
479 |
* entero.
|
480 |
*/
|
481 |
public void fullRect() { |
482 |
rect.setRect(origin.x, origin.y, getWidth() - (origin.x * 2),
|
483 |
getHeight() - (origin.x * 2));
|
484 |
|
485 |
if (m_attributes.isLandSpace()) {
|
486 |
rect = m_attributes.getRectangleLandscape(rect, getWidth(), |
487 |
getHeight()); |
488 |
} else {
|
489 |
rect = m_attributes.getRectanglePortrait(rect, getWidth(), |
490 |
getHeight()); |
491 |
} |
492 |
refresh(); |
493 |
} |
494 |
|
495 |
/**
|
496 |
* M?todo para imprimir el Layout sin modificar la matriz de transformaci?n.
|
497 |
*
|
498 |
* @param g2
|
499 |
*/
|
500 |
public void drawLayoutPrint(Graphics2D g2) { |
501 |
setCancelDrawing(false);
|
502 |
|
503 |
setCursor(Cursor.getDefaultCursor());
|
504 |
|
505 |
double scale = 0; |
506 |
scale = rect.height / m_attributes.m_sizePaper.getAlto() * 1;
|
507 |
AffineTransform escalado = new AffineTransform(); |
508 |
AffineTransform translacion = new AffineTransform(); |
509 |
translacion.setToTranslation(rect.getMinX(), rect.getMinY()); |
510 |
escalado.setToScale(scale, scale); |
511 |
m_MatrizTransf.setToIdentity(); |
512 |
m_MatrizTransf.concatenate(translacion); |
513 |
m_MatrizTransf.concatenate(escalado); |
514 |
m_attributes.setDistanceUnitX(rect); |
515 |
m_attributes.setDistanceUnitY(rect); |
516 |
|
517 |
for (int i = 0; i < getFFrames().length; i++) { |
518 |
try {
|
519 |
((IFFrame) getFFrame(i)).print(g2, getAT()); |
520 |
} catch (DriverException e) {
|
521 |
NotificationManager.addError(e.getMessage(), e); |
522 |
} |
523 |
} |
524 |
|
525 |
// TODO Esto es para ver el rect?ngulo que representa el folio en la
|
526 |
// impresi?n.
|
527 |
g2.drawRect(0, 0, (int) rect.getWidth(), (int) rect.getHeight()); |
528 |
// setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
529 |
} |
530 |
|
531 |
/**
|
532 |
* Clip sobre el rect?ngulo visible.
|
533 |
*
|
534 |
* @param g2d
|
535 |
* Graphics sobre el que hacer el clip.
|
536 |
*/
|
537 |
private void clipVisibleRect(Graphics2D g2d) { |
538 |
rectVisible = this.getVisibleRect();
|
539 |
g2d.clipRect((int) rectVisible.getMinX(), (int) rectVisible.getMinY(), |
540 |
(int) rectVisible.getWidth(), (int) rectVisible.getHeight()); |
541 |
} |
542 |
|
543 |
/**
|
544 |
* Inicializa los componentes.
|
545 |
*/
|
546 |
private void initComponents() { |
547 |
m_attributes = new Attributes(); |
548 |
m_attributes.setDistanceUnitX(rect); |
549 |
m_attributes.setDistanceUnitY(rect); |
550 |
actionDelFFrame(); |
551 |
setDoubleBuffered(true);
|
552 |
} |
553 |
|
554 |
/**
|
555 |
* Crea un ActionEvent para controlar las teclas que se pulsen cuando este
|
556 |
* el Layout Focusable a true.
|
557 |
*/
|
558 |
private void actionDelFFrame() { |
559 |
Action doNothing = new AbstractAction() { |
560 |
public void actionPerformed(ActionEvent e) { |
561 |
delFFrameSelected(); |
562 |
refresh(); |
563 |
} |
564 |
}; |
565 |
|
566 |
this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), |
567 |
"doNothing");
|
568 |
this.getInputMap().put(
|
569 |
KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), "doNothing"); |
570 |
this.getActionMap().put("doNothing", doNothing); |
571 |
} |
572 |
|
573 |
/**
|
574 |
* paintComponent del Layout.
|
575 |
*
|
576 |
* @param g
|
577 |
* Graphics del Layout.
|
578 |
*/
|
579 |
protected void paintComponent(Graphics g) { |
580 |
super.paintComponent(g);
|
581 |
|
582 |
clipVisibleRect((Graphics2D) g);
|
583 |
|
584 |
Rectangle rClip = g.getClipBounds();
|
585 |
|
586 |
if (rClip == null) { |
587 |
System.err.println("clip = null"); |
588 |
} |
589 |
|
590 |
switch (status) {
|
591 |
case ZOOM_MAS:
|
592 |
logger.debug("zoom mas");
|
593 |
layoutDraw.drawRectangle((Graphics2D) g);
|
594 |
|
595 |
g.drawImage(img, 0, 0, this); |
596 |
|
597 |
g.setClip(rClip); |
598 |
g.drawImage(imgRuler, 0, 0, this); |
599 |
g.setColor(Color.black);
|
600 |
g.setXORMode(Color.white);
|
601 |
|
602 |
Rectangle r = new Rectangle(); |
603 |
|
604 |
r.setFrameFromDiagonal(m_FirstPoint, m_LastPoint); |
605 |
g.drawRect(r.x, r.y, r.width, r.height); |
606 |
|
607 |
break;
|
608 |
|
609 |
case RECTANGLE:
|
610 |
logger.debug("rectangle");
|
611 |
layoutDraw.drawRectangle((Graphics2D) g);
|
612 |
|
613 |
g.drawImage(img, 0, 0, this); |
614 |
|
615 |
g.setClip(rClip); |
616 |
g.drawImage(imgRuler, 0, 0, this); |
617 |
g.setColor(Color.black);
|
618 |
g.setXORMode(Color.white);
|
619 |
|
620 |
Rectangle re = new Rectangle(); |
621 |
re.setFrameFromDiagonal(m_FirstPoint, m_LastPoint); |
622 |
|
623 |
if (isCuadricula()) {
|
624 |
FLayoutUtilities.setRectGrid(re, m_attributes |
625 |
.getUnitInPixelsX(), m_attributes.getUnitInPixelsY(), |
626 |
m_MatrizTransf); |
627 |
} |
628 |
|
629 |
g.drawRect(re.x, re.y, re.width, re.height); |
630 |
|
631 |
break;
|
632 |
|
633 |
case PAN:
|
634 |
logger.debug("pan");
|
635 |
|
636 |
rect.x = rectOrigin.x + (m_LastPoint.x - m_PointAnt.x); |
637 |
rect.y = rectOrigin.y + (m_LastPoint.y - m_PointAnt.y); |
638 |
|
639 |
layoutDraw.drawRectangle((Graphics2D) g);
|
640 |
|
641 |
if (img != null) { |
642 |
g.drawImage(img, (getLastPoint().x - getPointAnt().x), |
643 |
(getLastPoint().y - getPointAnt().y), this);
|
644 |
} |
645 |
|
646 |
g.setClip(rClip); |
647 |
layoutDraw.drawGrid((Graphics2D) g);
|
648 |
layoutDraw.drawRuler((Graphics2D) g, Color.black); |
649 |
break;
|
650 |
|
651 |
case VIEW_PAN:
|
652 |
|
653 |
logger.debug("View pan");
|
654 |
layoutDraw.drawRectangle((Graphics2D) g);
|
655 |
|
656 |
for (int i = 0; i < getFFrames().length; i++) { |
657 |
if (getFFrame(i) instanceof IFFrameUseFMap) { |
658 |
IFFrameUseFMap fframe = (IFFrameUseFMap) getFFrame(i); |
659 |
|
660 |
if (((IFFrame) fframe).getSelected() != IFFrame.NOSELECT) {
|
661 |
Rectangle2D.Double rec = ((IFFrame) fframe)
|
662 |
.getBoundingBox(getAT()); |
663 |
|
664 |
if (img != null) { |
665 |
rec = (Rectangle2D.Double) rec
|
666 |
.createIntersection(getVisibleRect()); |
667 |
} |
668 |
|
669 |
if (fframe.getBufferedImage() != null) { |
670 |
layoutDraw |
671 |
.drawHandlers((Graphics2D) g, Color.black); |
672 |
g.clipRect((int) rec.x, (int) rec.y, |
673 |
(int) rec.width, (int) rec.height); |
674 |
|
675 |
layoutDraw.drawRectangle((Graphics2D) g);
|
676 |
layoutDraw.drawRuler((Graphics2D) g, Color.black); |
677 |
Rectangle2D.Double r1 = ((IFFrame) fframe)
|
678 |
.getBoundingBox(getAT()); |
679 |
g.drawImage(fframe.getBufferedImage(), (int) r1
|
680 |
.getX() |
681 |
+ m_LastPoint.x - m_PointAnt.x, (int) r1
|
682 |
.getY() |
683 |
+ m_LastPoint.y - m_PointAnt.y, this);
|
684 |
|
685 |
fframe.refresh(); |
686 |
} |
687 |
} |
688 |
} |
689 |
} |
690 |
|
691 |
g.setClip(rClip); |
692 |
g.drawImage(imgRuler, 0, 0, this); |
693 |
|
694 |
break;
|
695 |
|
696 |
case SELECT:
|
697 |
logger.debug("select");
|
698 |
layoutDraw.drawRectangle((Graphics2D) g);
|
699 |
|
700 |
g.drawImage(img, 0, 0, this); |
701 |
|
702 |
if (isReSel) {
|
703 |
reSel = new Rectangle(); |
704 |
reSel.setFrameFromDiagonal(m_FirstPoint, m_LastPoint); |
705 |
g.drawRect(reSel.x, reSel.y, reSel.width, reSel.height); |
706 |
} |
707 |
IFFrame[] frames = getFFrameSelected();
|
708 |
for (int i = 0; i < frames.length; i++) { |
709 |
g.setColor(Color.black);
|
710 |
frames[i].drawHandlers((Graphics2D) g);
|
711 |
int difx = (m_LastPoint.x - m_FirstPoint.x);
|
712 |
int dify = (m_LastPoint.y - m_FirstPoint.y);
|
713 |
if ((Math.abs(difx) > 3) || (Math.abs(dify) > 3)) { |
714 |
Rectangle2D rectangle = frames[i].getMovieRect(difx, dify);
|
715 |
if (rectangle == null) |
716 |
return;
|
717 |
((Graphics2D) g).rotate(Math.toRadians(frames[i] |
718 |
.getRotation()), rectangle.getX() |
719 |
+ (rectangle.getWidth() / 2), rectangle.getY()
|
720 |
+ (rectangle.getHeight() / 2));
|
721 |
|
722 |
if (rectangle != null) { |
723 |
if (isCuadricula) {
|
724 |
FLayoutUtilities.setRectGrid(rectangle, |
725 |
m_attributes.getUnitInPixelsX(), |
726 |
m_attributes.getUnitInPixelsY(), |
727 |
m_MatrizTransf); |
728 |
} |
729 |
|
730 |
g.drawRect((int) rectangle.getMinX(), (int) rectangle |
731 |
.getMinY(), (int) rectangle.getWidth(),
|
732 |
(int) rectangle.getHeight());
|
733 |
} |
734 |
|
735 |
((Graphics2D) g).rotate(Math.toRadians(-frames[i] |
736 |
.getRotation()), rectangle.getX() |
737 |
+ (rectangle.getWidth() / 2), rectangle.getY()
|
738 |
+ (rectangle.getHeight() / 2));
|
739 |
|
740 |
} |
741 |
} |
742 |
|
743 |
g.setClip(rClip); |
744 |
g.drawImage(imgRuler, 0, 0, this); |
745 |
|
746 |
break;
|
747 |
case GRAPHICS:
|
748 |
logger.debug("graphics");
|
749 |
layoutDraw.drawRectangle((Graphics2D) g);
|
750 |
g.drawImage(img, 0, 0, this); |
751 |
g.setClip(rClip); |
752 |
layoutDraw.drawHandlers((Graphics2D) g, Color.black); |
753 |
|
754 |
if (getTool() == EDIT) {
|
755 |
IFFrame[] fframeSelect = getFFrameSelected();
|
756 |
for (int i = 0; i < fframeSelect.length; i++) { |
757 |
if (fframeSelect[i] instanceof IFFrameEditableVertex) { |
758 |
((IFFrameEditableVertex) fframeSelect[i]).paint( |
759 |
(Graphics2D) g, getAT());
|
760 |
} |
761 |
} |
762 |
} else {
|
763 |
geometryAdapter.paint((Graphics2D) g, getAT(), true); |
764 |
} |
765 |
g.drawImage(imgRuler, 0, 0, this); |
766 |
break;
|
767 |
|
768 |
case DESACTUALIZADO:
|
769 |
logger.debug("desactualizado");
|
770 |
img = new BufferedImage(getWidth(), getHeight(), |
771 |
BufferedImage.TYPE_INT_ARGB);
|
772 |
imgRuler = new BufferedImage(getWidth(), getHeight(), |
773 |
BufferedImage.TYPE_INT_ARGB);
|
774 |
Graphics gimag = img.getGraphics();
|
775 |
Graphics gimgRuler = imgRuler.getGraphics();
|
776 |
|
777 |
clipVisibleRect((Graphics2D) gimag);
|
778 |
|
779 |
if (initial) {
|
780 |
fullRect(); |
781 |
initial = false;
|
782 |
} |
783 |
|
784 |
try {
|
785 |
layoutDraw.drawLayout((Graphics2D) gimag, img);
|
786 |
} catch (DriverException e) {
|
787 |
e.printStackTrace(); |
788 |
} |
789 |
|
790 |
g.setClip(rClip); |
791 |
layoutDraw.drawRectangle((Graphics2D) g);
|
792 |
|
793 |
g.drawImage(img, 0, 0, this); |
794 |
g.setClip(rClip); |
795 |
|
796 |
layoutDraw.drawHandlers((Graphics2D) g, Color.black); |
797 |
layoutDraw.drawGrid((Graphics2D) gimgRuler);
|
798 |
layoutDraw.drawRuler((Graphics2D) gimgRuler, Color.black); |
799 |
g.drawImage(imgRuler, 0, 0, this); |
800 |
|
801 |
break;
|
802 |
|
803 |
case ACTUALIZADO:
|
804 |
logger.debug("actualizado");
|
805 |
layoutDraw.drawRectangle((Graphics2D) g);
|
806 |
|
807 |
g.drawImage(img, 0, 0, this); |
808 |
|
809 |
g.setClip(rClip); |
810 |
layoutDraw.drawHandlers((Graphics2D) g, Color.black); |
811 |
g.drawImage(imgRuler, 0, 0, this); |
812 |
} |
813 |
} |
814 |
|
815 |
/**
|
816 |
* A?ade un fframe al Arraylist m_fframes.
|
817 |
*
|
818 |
* @param frame
|
819 |
* fframe a a?adir.
|
820 |
* @param clearSelection
|
821 |
* para que se quede seleccionado ?nicamente el que a?adimos y
|
822 |
* false si lo que se pretende es que no se deseleccionen lo que
|
823 |
* ya est?n seleccionados.
|
824 |
* @param select
|
825 |
* Booleano que indica si se tiene que quedar seleccionado el
|
826 |
* FFrame que se a?ade o no.
|
827 |
*/
|
828 |
public void addFFrame(IFFrame frame, boolean clearSelection, boolean select) { |
829 |
IFFrame[] fframes = getFFrames();
|
830 |
if (clearSelection) {
|
831 |
for (int i = fframes.length - 1; i >= 0; i--) { |
832 |
IFFrame fframe1 = fframes[i]; |
833 |
fframe1.setSelected(false);
|
834 |
} |
835 |
} |
836 |
|
837 |
if (nums.containsKey(frame.getClass())) {
|
838 |
nums.put(frame.getClass(), new Integer(Integer.parseInt(nums.get( |
839 |
frame.getClass()).toString()) + 1));
|
840 |
} else {
|
841 |
nums.put(frame.getClass(), new Integer(0)); |
842 |
} |
843 |
|
844 |
frame.setNum(Integer.parseInt(nums.get(frame.getClass()).toString()));
|
845 |
efs.addFFrame(frame); |
846 |
frame.setSelected(select); |
847 |
frame.setLevel(getNumBefore()); |
848 |
updateFFrames(); |
849 |
} |
850 |
|
851 |
/**
|
852 |
* Abre el di?logo de propiedades del folio, pasando como par?metro el
|
853 |
* PrinterJob.
|
854 |
*
|
855 |
* @param job
|
856 |
*/
|
857 |
public void showPagePropertiesWindow(PrinterJob job) { |
858 |
PageFormat pf1;
|
859 |
|
860 |
pf1 = m_attributes.getPageFormat(); |
861 |
pf1 = job.pageDialog(pf1); |
862 |
m_attributes.setPageFormat(pf1); |
863 |
refresh(); |
864 |
} |
865 |
|
866 |
/**
|
867 |
* Refresca el Layout.
|
868 |
*/
|
869 |
public void refresh() { |
870 |
setStatus(DESACTUALIZADO); |
871 |
repaint(); |
872 |
} |
873 |
|
874 |
/**
|
875 |
* Obtiene el rect?ngulo que representa el folio con las caracter?sticas que
|
876 |
* contiene attributes y diferenciando si es para visualizar en pantalla o
|
877 |
* para imprimir.
|
878 |
*
|
879 |
* @param isPrint
|
880 |
* si es para imprimir.
|
881 |
*/
|
882 |
public void obtainRect(boolean isPrint) { |
883 |
m_attributes.obtainRect(isPrint, rect, getWidth(), getHeight()); |
884 |
} |
885 |
|
886 |
/**
|
887 |
* Muestra el di?logo de configuraci?n del Layout.
|
888 |
*/
|
889 |
public void showFConfig() { |
890 |
FConfigLayoutDialog m_configLayout = new FConfigLayoutDialog(this); |
891 |
PluginServices.getMDIManager().addView(m_configLayout); |
892 |
} |
893 |
|
894 |
/**
|
895 |
* Mestra el di?logo de propiedades del Layout.
|
896 |
*/
|
897 |
public void showFProperties() { |
898 |
if (map == null) { |
899 |
map = new ProjectMap();
|
900 |
map.setModel(this);
|
901 |
map.setName(getName()); |
902 |
} |
903 |
|
904 |
m_propertiesLayout = new MapProperties(map);
|
905 |
PluginServices.getMDIManager().addView(m_propertiesLayout); |
906 |
} |
907 |
|
908 |
/**
|
909 |
* Muestra el di?logo de imprimir pasandole el printerJob como par?metro.
|
910 |
*
|
911 |
* @param job
|
912 |
*/
|
913 |
public void showPrintDialog(PrinterJob job) { |
914 |
if (job != null) { |
915 |
job.printDialog(); |
916 |
|
917 |
try {
|
918 |
job.setPrintable((Printable) PluginServices
|
919 |
.getExtension(com.iver.cit.gvsig.Print.class)); |
920 |
job.print(); |
921 |
} catch (PrinterException e) { |
922 |
e.printStackTrace(); |
923 |
} |
924 |
} else {
|
925 |
// Actualizar attributes
|
926 |
att = m_attributes.toPrintAttributes(); |
927 |
|
928 |
// ------------------ The Printing things --------------------- //
|
929 |
DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; |
930 |
|
931 |
// returns the set of printers that support printing a specific
|
932 |
// document type (such as GIF)
|
933 |
// with a specific set of attributes (such as two sided).
|
934 |
// PrintRequestAttributeSet pras = new
|
935 |
// HashPrintRequestAttributeSet();
|
936 |
// interestingly, the printer dialog's default behavior has changed
|
937 |
// with the new API: by default the dialog is not shown.
|
938 |
// So we must use the ServiceUI class to create a print dialog
|
939 |
// returns the default print service.
|
940 |
if (m_cachePrintServices == null) { |
941 |
m_cachePrintServices = PrintServiceLookup.lookupPrintServices(
|
942 |
flavor, null);
|
943 |
} |
944 |
|
945 |
PrintService defaultService = null; |
946 |
|
947 |
if (m_cachePrintService == null) { |
948 |
defaultService = PrintServiceLookup.lookupDefaultPrintService();
|
949 |
} |
950 |
|
951 |
if ((defaultService == null) && (m_cachePrintService == null)) { |
952 |
JOptionPane.showMessageDialog((Component) PluginServices |
953 |
.getMainFrame(), "ninguna_impresora_configurada");
|
954 |
|
955 |
return;
|
956 |
} |
957 |
|
958 |
if (m_cachePrintService == null) { |
959 |
m_cachePrintService = ServiceUI.printDialog(null, 200, 200, |
960 |
m_cachePrintServices, defaultService, flavor, att); |
961 |
|
962 |
// m_cachePrintRequestAtributeSet = new
|
963 |
// HashPrintRequestAttributeSet();
|
964 |
// m_cachePrintRequestAtributeSet.addAll(pras);
|
965 |
} else {
|
966 |
m_cachePrintService = ServiceUI.printDialog(null, 200, 200, |
967 |
m_cachePrintServices, m_cachePrintService, flavor, att); |
968 |
} |
969 |
|
970 |
if (m_cachePrintService != null) { |
971 |
DocPrintJob jobNuevo = m_cachePrintService.createPrintJob();
|
972 |
PrintJobListener pjlistener = new PrintJobAdapter() { |
973 |
public void printDataTransferCompleted(PrintJobEvent e) { |
974 |
System.out.println("Fin de impresi?n"); |
975 |
fullRect(); |
976 |
} |
977 |
}; |
978 |
|
979 |
jobNuevo.addPrintJobListener(pjlistener); |
980 |
|
981 |
// DocAttributeSet das = new HashDocAttributeSet();
|
982 |
doc = new SimpleDoc((Printable) PluginServices |
983 |
.getExtension(com.iver.cit.gvsig.Print.class), flavor, |
984 |
null);
|
985 |
|
986 |
try {
|
987 |
jobNuevo.print(doc, att); |
988 |
|
989 |
// m_attributes.
|
990 |
} catch (PrintException pe) { |
991 |
pe.printStackTrace(); |
992 |
} |
993 |
} |
994 |
} |
995 |
|
996 |
/*
|
997 |
* try { print = job.printDialog(att); } catch (Exception e) {
|
998 |
* logger.error("Abriendo el Di?logo de imprimir");
|
999 |
* //System.out.println("Excepci?n "+e); } if (print) {
|
1000 |
* job.setPrintable((Printable)
|
1001 |
* App.instance.getPc().getExtension(com.iver.cit.gvsig.Print.class));
|
1002 |
* try { job.print(att); } catch (Exception ex) { ex.printStackTrace(); } }
|
1003 |
*/
|
1004 |
} |
1005 |
|
1006 |
/**
|
1007 |
* Sustituye el puntero del rat?n por la imagen que se le pasa como
|
1008 |
* par?metro.
|
1009 |
*
|
1010 |
* @param image
|
1011 |
*/
|
1012 |
public void setMapCursor(Image image) { |
1013 |
Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(image, |
1014 |
new Point(16, 16), ""); |
1015 |
setCursor(cur); |
1016 |
} |
1017 |
|
1018 |
/**
|
1019 |
* Cambia el puntero del raton al cusor que se le introduce como par?metro.
|
1020 |
*
|
1021 |
* @param cursor
|
1022 |
* cursor a mostrar en el puntero del rat?n.
|
1023 |
*/
|
1024 |
public void setMapCursor(Cursor cursor) { |
1025 |
setCursor(cursor); |
1026 |
} |
1027 |
|
1028 |
/**
|
1029 |
* Pone como seleccionada a la herramienta a partir de su n?mero.
|
1030 |
*
|
1031 |
* @param i
|
1032 |
*/
|
1033 |
public void setTool(int i) { |
1034 |
tool = i; |
1035 |
|
1036 |
if (getTool() == PAN) {
|
1037 |
setMapCursor(ipan); |
1038 |
} else if (getTool() == ZOOM_MAS) { |
1039 |
setMapCursor(izoomin); |
1040 |
} else if (getTool() == ZOOM_MENOS) { |
1041 |
setMapCursor(izoomout); |
1042 |
} else if (getTool() == RECTANGLEVIEW) { |
1043 |
setMapCursor(icrux); |
1044 |
} else if (getTool() == RECTANGLEPICTURE) { |
1045 |
setMapCursor(icrux); |
1046 |
} else if (getTool() == RECTANGLESCALEBAR) { |
1047 |
setMapCursor(icrux); |
1048 |
} else if (getTool() == RECTANGLELEGEND) { |
1049 |
setMapCursor(icrux); |
1050 |
} else if (getTool() == RECTANGLETEXT) { |
1051 |
setMapCursor(icrux); |
1052 |
} else if (getTool() == RECTANGLENORTH) { |
1053 |
setMapCursor(icrux); |
1054 |
} else if (getTool() == RECTANGLEBOX) { |
1055 |
setMapCursor(icrux); |
1056 |
} else if (getTool() == SELECT) { |
1057 |
setCursor(Cursor.getDefaultCursor());
|
1058 |
} else if (getTool() == SET_TAG) { |
1059 |
setMapCursor(itag); |
1060 |
} else if (getTool() == POINT) { |
1061 |
setMapCursor(iPoint); |
1062 |
} else if (getTool() == LINE) { |
1063 |
setMapCursor(iRect); |
1064 |
} else if (getTool() == RECTANGLESIMPLE) { |
1065 |
setMapCursor(iRectangle); |
1066 |
} else if (getTool() == POLYLINE) { |
1067 |
setMapCursor(iLine); |
1068 |
} else if (getTool() == POLYGON) { |
1069 |
setMapCursor(iPoligon); |
1070 |
} else if (getTool() == CIRCLE) { |
1071 |
setMapCursor(iCircle); |
1072 |
} |
1073 |
if (getTool() == EDIT) {
|
1074 |
setMapCursor(icrux); |
1075 |
startEdit(); |
1076 |
} else {
|
1077 |
stopEdit(); |
1078 |
} |
1079 |
initGeometryAdapter(); |
1080 |
} |
1081 |
|
1082 |
/**
|
1083 |
* Se crean aqu? los dialogos cada vez que se necesitan.
|
1084 |
*
|
1085 |
* @param fframe
|
1086 |
* Rectangle que representa el lugar que ocupara el elemento
|
1087 |
* a?adido.
|
1088 |
*
|
1089 |
* @return true si se debe de a?adir el fframe.
|
1090 |
*/
|
1091 |
public boolean openFFrameDialog(IFFrame fframe) { |
1092 |
switch (tool) {
|
1093 |
case RECTANGLEVIEW:
|
1094 |
fframedialog = new FFrameViewDialog(this, (FFrameView) fframe); |
1095 |
|
1096 |
break;
|
1097 |
|
1098 |
case RECTANGLEPICTURE:
|
1099 |
fframedialog = new FFramePictureDialog(this, (FFramePicture) fframe); |
1100 |
|
1101 |
break;
|
1102 |
|
1103 |
case RECTANGLESCALEBAR:
|
1104 |
fframedialog = new FFrameScaleBarDialog(this, |
1105 |
(FFrameScaleBar) fframe); |
1106 |
|
1107 |
break;
|
1108 |
|
1109 |
case RECTANGLELEGEND:
|
1110 |
fframedialog = new FFrameLegendDialog(this, (FFrameLegend) fframe); |
1111 |
|
1112 |
break;
|
1113 |
|
1114 |
case RECTANGLETEXT:
|
1115 |
fframedialog = new FFrameTextDialog(this, (FFrameText) fframe); |
1116 |
|
1117 |
break;
|
1118 |
|
1119 |
case GRAPHICS:
|
1120 |
fframedialog = new FFrameGraphicsDialog(this, |
1121 |
(FFrameGraphics) fframe); |
1122 |
|
1123 |
break;
|
1124 |
|
1125 |
case RECTANGLEGROUP:
|
1126 |
fframedialog = new FFrameGroupDialog(this, (FFrameGroup) fframe); |
1127 |
|
1128 |
break;
|
1129 |
case RECTANGLENORTH:
|
1130 |
fframedialog = new FFrameNorthDialog(this, (FFrameNorth) fframe); |
1131 |
|
1132 |
break;
|
1133 |
case RECTANGLEBOX:
|
1134 |
fframedialog = new FFrameBoxDialog(this, (FFrameTable) fframe); |
1135 |
|
1136 |
break;
|
1137 |
default:
|
1138 |
return true; |
1139 |
} |
1140 |
|
1141 |
if (fframedialog != null) { |
1142 |
fframedialog.setRectangle(fframe.getBoundingBox(m_MatrizTransf)); |
1143 |
PluginServices.getMDIManager().addView(fframedialog); |
1144 |
} |
1145 |
|
1146 |
return fframedialog.getIsAcepted();
|
1147 |
} |
1148 |
|
1149 |
/**
|
1150 |
* Devuelve el Rectangle2D que representa en pixels al folio.
|
1151 |
*
|
1152 |
* @return Rectangle2D.Double
|
1153 |
*/
|
1154 |
public Rectangle2D.Double getRect() { |
1155 |
return rect;
|
1156 |
} |
1157 |
|
1158 |
public void setRect(Rectangle2D r) { |
1159 |
rect.setRect(r); |
1160 |
} |
1161 |
|
1162 |
/**
|
1163 |
* Obtiene un entero que representa la herramienta seleccionada.
|
1164 |
*
|
1165 |
* @return entero.
|
1166 |
*/
|
1167 |
public int getTool() { |
1168 |
return tool;
|
1169 |
} |
1170 |
|
1171 |
/**
|
1172 |
* Devuelve la Matriz transformada que se esta plicando al Layout.
|
1173 |
*
|
1174 |
* @return AffineTransform
|
1175 |
*/
|
1176 |
public AffineTransform getAT() { |
1177 |
return m_MatrizTransf;
|
1178 |
} |
1179 |
|
1180 |
/**
|
1181 |
* Devuelve los atributos del Mapa.
|
1182 |
*
|
1183 |
* @return Attributes.
|
1184 |
*/
|
1185 |
public Attributes getAtributes() { |
1186 |
return m_attributes;
|
1187 |
} |
1188 |
|
1189 |
/**
|
1190 |
* Pone el estado que se quiera.
|
1191 |
*
|
1192 |
* @param s
|
1193 |
* estado.
|
1194 |
*/
|
1195 |
public void setStatus(int s) { |
1196 |
status = s; |
1197 |
} |
1198 |
|
1199 |
/**
|
1200 |
* Devuelve el punto que representa la esquina noroeste del mapa.
|
1201 |
*
|
1202 |
* @return un punto.
|
1203 |
*/
|
1204 |
public Point getRectOrigin() { |
1205 |
return rectOrigin;
|
1206 |
} |
1207 |
|
1208 |
/**
|
1209 |
* Devuelve el punto del primer click de rat?n.
|
1210 |
*
|
1211 |
* @return un punto.
|
1212 |
*/
|
1213 |
public Point getFirstPoint() { |
1214 |
return m_FirstPoint;
|
1215 |
} |
1216 |
|
1217 |
/**
|
1218 |
* Devuelve el punto de click de rat?n anterior.
|
1219 |
*
|
1220 |
* @return un punto.
|
1221 |
*/
|
1222 |
public Point getPointAnt() { |
1223 |
return m_PointAnt;
|
1224 |
} |
1225 |
|
1226 |
/**
|
1227 |
* Devuelve el punto donde se solt? el bot?n del rat?n.
|
1228 |
*
|
1229 |
* @return un punto.
|
1230 |
*/
|
1231 |
public Point getLastPoint() { |
1232 |
return m_LastPoint;
|
1233 |
} |
1234 |
|
1235 |
/**
|
1236 |
* Rellena el primer punto de click de rat?n.
|
1237 |
*
|
1238 |
* @param p
|
1239 |
* punto.
|
1240 |
*/
|
1241 |
public void setFirstPoint(Point p) { |
1242 |
m_FirstPoint = p; |
1243 |
} |
1244 |
|
1245 |
/**
|
1246 |
* Rellena el punto de click de rat?n anterior.
|
1247 |
*
|
1248 |
* @param p
|
1249 |
* punto.
|
1250 |
*/
|
1251 |
public void setPointAnt(Point p) { |
1252 |
m_PointAnt = p; |
1253 |
} |
1254 |
|
1255 |
/**
|
1256 |
* Rellena el punto donde se solto el bot?n del rat?n.
|
1257 |
*
|
1258 |
* @param p
|
1259 |
* punto.
|
1260 |
*/
|
1261 |
public void setLastPoint(Point p) { |
1262 |
m_LastPoint = p; |
1263 |
} |
1264 |
|
1265 |
/**
|
1266 |
* This method is used to get <strong>an initial</strong> ViewInfo object
|
1267 |
* for this Map. It is not intended to retrieve the ViewInfo object in a
|
1268 |
* later time. <strong>Use PluginServices.getMDIManager().getViewInfo(view)
|
1269 |
* to retrieve the ViewInfo object at any time after the creation of the
|
1270 |
* object.
|
1271 |
*
|
1272 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
1273 |
*/
|
1274 |
public ViewInfo getViewInfo() {
|
1275 |
if (m_viewInfo == null) { |
1276 |
m_viewInfo = new ViewInfo(ViewInfo.ICONIFIABLE | ViewInfo.RESIZABLE
|
1277 |
| ViewInfo.MAXIMIZABLE); |
1278 |
m_viewInfo.setWidth(500);
|
1279 |
m_viewInfo.setHeight(400);
|
1280 |
|
1281 |
m_viewInfo.setTitle(PluginServices.getText(this, "Mapa") + " : " |
1282 |
+ getName()); |
1283 |
} |
1284 |
return m_viewInfo;
|
1285 |
} |
1286 |
|
1287 |
/**
|
1288 |
* Inserta si se muestra o no la regla del Layout.
|
1289 |
*
|
1290 |
* @param b
|
1291 |
* True si se muestra la regla.
|
1292 |
*/
|
1293 |
public void setRuler(boolean b) { |
1294 |
m_showRuler = b; |
1295 |
} |
1296 |
|
1297 |
/**
|
1298 |
* Devuelve si se muestra la regla del Layout.
|
1299 |
*
|
1300 |
* @return True si se muestra la regla.
|
1301 |
*/
|
1302 |
public boolean getRuler() { |
1303 |
return m_showRuler;
|
1304 |
} |
1305 |
|
1306 |
/**
|
1307 |
* Devuelve si se esta aplicando en los fframes que se a?den al Layout la
|
1308 |
* cuadr?cula, o no.
|
1309 |
*
|
1310 |
* @return true si se esta aplicando la cuadr?cula.
|
1311 |
*/
|
1312 |
public boolean isCuadricula() { |
1313 |
return isCuadricula;
|
1314 |
} |
1315 |
|
1316 |
/**
|
1317 |
* Se actualiza el estado de la cuadr?cula, si se aplica o no.
|
1318 |
*
|
1319 |
* @param b
|
1320 |
* true si se aplica la cuadr?cula.
|
1321 |
*/
|
1322 |
public void setIsCuadricula(boolean b) { |
1323 |
isCuadricula = b; |
1324 |
} |
1325 |
|
1326 |
/**
|
1327 |
* Realiza una exteni?n completa de las capas que contiene la vista del
|
1328 |
* FFrameView.
|
1329 |
*
|
1330 |
* @throws DriverException
|
1331 |
*/
|
1332 |
public void viewFull() throws DriverException { |
1333 |
IFFrame[] fframes = getFFrameSelected();
|
1334 |
for (int i = 0; i < fframes.length; i++) { |
1335 |
if (fframes[i] instanceof IFFrameUseFMap) { |
1336 |
IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i]; |
1337 |
|
1338 |
if (fframe.getFMap() != null) { |
1339 |
fframe.fullExtent(); |
1340 |
} |
1341 |
fframe.refresh(); |
1342 |
} |
1343 |
} |
1344 |
refresh(); |
1345 |
} |
1346 |
|
1347 |
/**
|
1348 |
* Devuelve un Objeto XMLEntity con la informaci?n los atributos necesarios
|
1349 |
* para poder despu?s volver a crear el objeto original.
|
1350 |
*
|
1351 |
* @return XMLEntity.
|
1352 |
*
|
1353 |
* @throws XMLException
|
1354 |
*/
|
1355 |
public XMLEntity getXMLEntity() {
|
1356 |
XMLEntity xml = new XMLEntity();
|
1357 |
xml.putProperty("className", this.getClass().getName()); |
1358 |
xml.setName("layout");
|
1359 |
xml.putProperty("isCuadricula", isCuadricula());
|
1360 |
xml.putProperty("m_name", this.getName()); |
1361 |
xml.putProperty("isEditable", isEditable);
|
1362 |
xml.putProperty("numBehind", numBehind);
|
1363 |
xml.putProperty("numBefore", numBefore);
|
1364 |
xml.addChild(getAtributes().getXMLEntity()); |
1365 |
|
1366 |
for (int i = 0; i < getFFrames().length; i++) { |
1367 |
try {
|
1368 |
XMLEntity xmlAux = ((IFFrame) getFFrame(i)).getXMLEntity(); |
1369 |
xml.addChild(xmlAux); |
1370 |
} catch (SaveException e) {
|
1371 |
e.showError(); |
1372 |
} |
1373 |
} |
1374 |
return xml;
|
1375 |
} |
1376 |
|
1377 |
/**
|
1378 |
* Crea un Objeto de esta clase a partir de la informaci?n del XMLEntity.
|
1379 |
*
|
1380 |
* @param xml
|
1381 |
* XMLEntity
|
1382 |
* @param p
|
1383 |
* Proyecto.
|
1384 |
*
|
1385 |
* @return Objeto de esta clase.
|
1386 |
* @throws OpenException
|
1387 |
*/
|
1388 |
public static Layout createLayout(XMLEntity xml, Project p) |
1389 |
throws OpenException {
|
1390 |
Layout layout = new Layout();
|
1391 |
try {
|
1392 |
layout.isCuadricula = xml.getBooleanProperty("isCuadricula");
|
1393 |
layout.setName(xml.getStringProperty("m_name"));
|
1394 |
layout.m_attributes = Attributes.createAtributes(xml.getChild(0)); |
1395 |
if (xml.contains("isEditable")) { |
1396 |
layout.setEditable(xml.getBooleanProperty("isEditable"));
|
1397 |
} |
1398 |
if (xml.contains("numBehind")) { |
1399 |
layout.numBehind = xml.getIntProperty("numBehind");
|
1400 |
layout.numBefore = xml.getIntProperty("numBefore");
|
1401 |
} |
1402 |
layout.getEFS().startComplexCommand(); |
1403 |
for (int i = 1; i < xml.getNumChild(); i++) { |
1404 |
try {
|
1405 |
layout.addFFrame(FFrame.createFFrame(xml.getChild(i), p, |
1406 |
layout), true, false); |
1407 |
} catch (OpenException e) {
|
1408 |
e.showError(); |
1409 |
} |
1410 |
} |
1411 |
layout.getEFS().endComplexCommand(); |
1412 |
IFFrame[] fframes = layout.getAllFFrames();
|
1413 |
for (int i = 0; i < fframes.length; i++) { |
1414 |
if (fframes[i] instanceof IFFrameLayoutDependence) { |
1415 |
((IFFrameLayoutDependence) fframes[i]).setLayout(layout); |
1416 |
} |
1417 |
if (fframes[i] instanceof IFFrameViewDependence) { |
1418 |
((IFFrameViewDependence) fframes[i]) |
1419 |
.initDependence(fframes); |
1420 |
} |
1421 |
} |
1422 |
} catch (Exception e) { |
1423 |
throw new OpenException(e, layout.getClass().getName()); |
1424 |
} |
1425 |
return layout;
|
1426 |
} |
1427 |
|
1428 |
/**
|
1429 |
* Crea un Objeto de esta clase a partir de la informaci?n del XMLEntity.
|
1430 |
*
|
1431 |
* @param xml
|
1432 |
* XMLEntity
|
1433 |
* @param p
|
1434 |
* Proyecto.
|
1435 |
*
|
1436 |
* @return Objeto de esta clase.
|
1437 |
*/
|
1438 |
public static Layout createLayout03(XMLEntity xml, Project p) { |
1439 |
Layout layout = new Layout();
|
1440 |
layout.isCuadricula = xml.getBooleanProperty("isCuadricula");
|
1441 |
layout.setName(xml.getStringProperty("m_name"));
|
1442 |
layout.m_attributes = Attributes.createAtributes03(xml.getChild(0)); |
1443 |
|
1444 |
for (int i = 1; i < xml.getNumChild(); i++) { |
1445 |
if (xml.getChild(i).getStringProperty("className").equals( |
1446 |
"com.iver.cit.gvsig.gui.layout.fframe.FFrameView")) {
|
1447 |
layout.addFFrame(FFrame.createFFrame03(xml.getChild(i), layout, |
1448 |
p), true, false); |
1449 |
} |
1450 |
} |
1451 |
|
1452 |
for (int i = 1; i < xml.getNumChild(); i++) { |
1453 |
if (!xml.getChild(i).getStringProperty("className").equals( |
1454 |
"com.iver.cit.gvsig.gui.layout.fframe.FFrameView")) {
|
1455 |
layout.addFFrame(FFrame.createFFrame03(xml.getChild(i), layout, |
1456 |
p), true, false); |
1457 |
} |
1458 |
} |
1459 |
|
1460 |
return layout;
|
1461 |
} |
1462 |
|
1463 |
/**
|
1464 |
* @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
|
1465 |
*/
|
1466 |
public void viewActivated() { |
1467 |
//fullRect();
|
1468 |
repaint(); |
1469 |
PluginServices.getMainFrame().getStatusBar().setMessage("1",
|
1470 |
getAtributes().getNameUnit()); |
1471 |
} |
1472 |
|
1473 |
/**
|
1474 |
* @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
|
1475 |
*/
|
1476 |
public Object getViewModel() { |
1477 |
return map;
|
1478 |
} |
1479 |
|
1480 |
/**
|
1481 |
* Devuelve si se dibuja el Grid en el Layout o no.
|
1482 |
*
|
1483 |
* @return True si se dibuja el Grid en el Layout.
|
1484 |
*/
|
1485 |
public boolean getIsDrawGrid() { |
1486 |
return isDrawCuadricula;
|
1487 |
} |
1488 |
|
1489 |
/**
|
1490 |
* Inserta si se muestra el Grid del Layout.
|
1491 |
*
|
1492 |
* @param b
|
1493 |
* True si se muestra el Grid del Layout.
|
1494 |
*/
|
1495 |
public void setIsDrawGrid(boolean b) { |
1496 |
isDrawCuadricula = b; |
1497 |
} |
1498 |
|
1499 |
/**
|
1500 |
* @see com.iver.cit.gvsig.fmap.ExtentListener#extentChanged(com.iver.cit.gvsig.fmap.ExtentEvent)
|
1501 |
*/
|
1502 |
public void extentChanged(ExtentEvent e) { |
1503 |
} |
1504 |
|
1505 |
/**
|
1506 |
* @see com.iver.andami.ui.mdiManager.ViewListener#viewClosed()
|
1507 |
*/
|
1508 |
public void viewClosed() { |
1509 |
// /PluginServices.getMainFrame().getStatusBar().setMessage("1","");
|
1510 |
} |
1511 |
|
1512 |
/**
|
1513 |
* @see com.iver.cit.gvsig.fmap.ViewPortListener#backColorChanged(com.iver.cit.gvsig.fmap.ColorEvent)
|
1514 |
*/
|
1515 |
public void backColorChanged(ColorEvent e) { |
1516 |
// refresh();
|
1517 |
} |
1518 |
|
1519 |
/**
|
1520 |
* Devuelve un array con los FFrames seleccionados.
|
1521 |
*
|
1522 |
* @return Array con los FFrames seleccionados.
|
1523 |
*/
|
1524 |
public IFFrame[] getFFrameSelected() { |
1525 |
ArrayList selecList = new ArrayList(); |
1526 |
|
1527 |
for (int i = getFFrames().length - 1; i >= 0; i--) { |
1528 |
IFFrame fframe = (IFFrame) getFFrame(i); |
1529 |
|
1530 |
if (fframe.getSelected() != IFFrame.NOSELECT) {
|
1531 |
selecList.add(fframe); |
1532 |
} |
1533 |
} |
1534 |
|
1535 |
return (IFFrame[]) selecList.toArray(new IFFrame[0]); |
1536 |
} |
1537 |
|
1538 |
/**
|
1539 |
* Opens a dialog where to pick a PDF-file to save the current Layout
|
1540 |
* suggesting a name for the file given by the first argument
|
1541 |
*
|
1542 |
* @param suggestedName
|
1543 |
*/
|
1544 |
public void layoutToPDF(String suggestedName) { |
1545 |
FileFilter pdfFilter = new GenericFileFilter("pdf", PluginServices |
1546 |
.getText(this, "pdf")); |
1547 |
|
1548 |
JFileChooser jfc = new JFileChooser(); |
1549 |
if (suggestedName != null) |
1550 |
jfc.setSelectedFile(new File(suggestedName)); |
1551 |
jfc.addChoosableFileFilter(pdfFilter); |
1552 |
jfc.setFileFilter(pdfFilter); |
1553 |
|
1554 |
if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) { |
1555 |
File f = jfc.getSelectedFile();
|
1556 |
File faux = null; |
1557 |
|
1558 |
if (f.getName().endsWith(".pdf") || f.getName().endsWith(".PDF")) { |
1559 |
faux = f; |
1560 |
} else {
|
1561 |
faux = new File(f.getPath() + ".pdf"); |
1562 |
} |
1563 |
|
1564 |
layoutDraw.toPDF(faux); |
1565 |
} |
1566 |
} |
1567 |
|
1568 |
/**
|
1569 |
* Abre un di?logo para seleccionar un fichero pdf donde guardar el Layout
|
1570 |
* en este formato.
|
1571 |
*/
|
1572 |
public void layoutToPDF() { |
1573 |
layoutToPDF(null);
|
1574 |
} |
1575 |
|
1576 |
/**
|
1577 |
* @return Returns the bModeDebug.
|
1578 |
*/
|
1579 |
public boolean isModeDebug() { |
1580 |
return bModeDebug;
|
1581 |
} |
1582 |
|
1583 |
/**
|
1584 |
* @param modeDebug
|
1585 |
* The bModeDebug to set.
|
1586 |
*/
|
1587 |
public void setModeDebug(boolean modeDebug) { |
1588 |
bModeDebug = modeDebug; |
1589 |
} |
1590 |
|
1591 |
private ArrayList allFFrames(IFFrame[] fframes, ArrayList all) { |
1592 |
for (int i = 0; i < fframes.length; i++) { |
1593 |
if (fframes[i] instanceof FFrameGroup) { |
1594 |
return allFFrames(((FFrameGroup) fframes[i]).getFFrames(), all);
|
1595 |
|
1596 |
} else {
|
1597 |
all.add(fframes[i]); |
1598 |
} |
1599 |
} |
1600 |
return all;
|
1601 |
} |
1602 |
|
1603 |
public IFFrame[] getAllFFrames() { |
1604 |
ArrayList all = new ArrayList(); |
1605 |
return (IFFrame[]) allFFrames(getFFrames(), all) |
1606 |
.toArray(new IFFrame[0]); |
1607 |
} |
1608 |
|
1609 |
public GeometryAdapter getGeometryAdapter() {
|
1610 |
return geometryAdapter;
|
1611 |
} |
1612 |
|
1613 |
public boolean isEditable() { |
1614 |
return isEditable;
|
1615 |
} |
1616 |
|
1617 |
public void setEditable(boolean b) { |
1618 |
isEditable = b; |
1619 |
} |
1620 |
|
1621 |
public void initGeometryAdapter() { |
1622 |
if (getTool() == LINE) {
|
1623 |
geometryAdapter = new PolyLineAdapter();
|
1624 |
} else if (getTool() == RECTANGLESIMPLE) { |
1625 |
geometryAdapter = new RectangleAdapter();
|
1626 |
} else if (getTool() == POLYLINE) { |
1627 |
geometryAdapter = new PolyLineAdapter();
|
1628 |
} else if (getTool() == POLYGON) { |
1629 |
geometryAdapter = new PolygonAdapter();
|
1630 |
} else if (getTool() == CIRCLE) { |
1631 |
geometryAdapter = new CircleAdapter();
|
1632 |
} else if (getTool() == POINT) { |
1633 |
geometryAdapter = new PointAdapter();
|
1634 |
} |
1635 |
} |
1636 |
|
1637 |
public void startEdit() { |
1638 |
for (int i = 0; i < getFFrames().length; i++) { |
1639 |
IFFrame frame = (IFFrame) getFFrame(i); |
1640 |
if (frame instanceof IFFrameEditableVertex) { |
1641 |
if (frame.getSelected() != IFFrame.NOSELECT) {
|
1642 |
((IFFrameEditableVertex) frame).startEditing(); |
1643 |
} else {
|
1644 |
((IFFrameEditableVertex) frame).stopEditing(); |
1645 |
} |
1646 |
} |
1647 |
|
1648 |
} |
1649 |
refresh(); |
1650 |
} |
1651 |
|
1652 |
public void stopEdit() { |
1653 |
boolean refresh = false; |
1654 |
for (int i = 0; i < getFFrames().length; i++) { |
1655 |
IFFrame frame = (IFFrame) getFFrame(i); |
1656 |
if (frame instanceof IFFrameEditableVertex) { |
1657 |
if (((IFFrameEditableVertex) frame).isEditing()) {
|
1658 |
((IFFrameEditableVertex) getFFrame(i)).stopEditing(); |
1659 |
refresh = true;
|
1660 |
} |
1661 |
} |
1662 |
} |
1663 |
if (refresh)
|
1664 |
refresh(); |
1665 |
} |
1666 |
|
1667 |
public void delFFrameSelected() { |
1668 |
efs.startComplexCommand(); |
1669 |
for (int i = efs.getAllFFrames().length - 1; i >= 0; i--) { |
1670 |
IFFrame fframe = (IFFrame) efs.getFFrame(i); |
1671 |
|
1672 |
if (fframe.getSelected() != IFFrame.NOSELECT) {
|
1673 |
efs.removeFFrame(i); |
1674 |
} |
1675 |
} |
1676 |
efs.endComplexCommand(); |
1677 |
updateFFrames(); |
1678 |
} |
1679 |
|
1680 |
public void delFFrame(int index) { |
1681 |
for (int i = 0; i < getEFS().getAllFFrames().length; i++) { |
1682 |
if (getEFS().getFFrame(i).equals(getFFrame(index))) {
|
1683 |
getEFS().removeFFrame(i); |
1684 |
} |
1685 |
} |
1686 |
updateFFrames(); |
1687 |
} |
1688 |
|
1689 |
public void delFFrame(IFFrame frame) { |
1690 |
for (int i = 0; i < getEFS().getAllFFrames().length; i++) { |
1691 |
if (getEFS().getFFrame(i).equals(frame)) {
|
1692 |
getEFS().removeFFrame(i); |
1693 |
} |
1694 |
} |
1695 |
updateFFrames(); |
1696 |
} |
1697 |
|
1698 |
public EditableFeatureSource getEFS() {
|
1699 |
return efs;
|
1700 |
} |
1701 |
|
1702 |
public void commandRepaint() { |
1703 |
this.updateFFrames();
|
1704 |
this.refresh();
|
1705 |
} |
1706 |
|
1707 |
public void commandRefresh() { |
1708 |
commandRepaint(); |
1709 |
|
1710 |
} |
1711 |
|
1712 |
/**
|
1713 |
* Introduce la posibilidad de establecer que los cambios que se hacen a
|
1714 |
* partir de ese momento hasta que se vuelva a poner a false, que todas las
|
1715 |
* operaciones que realices son sobre los fframes que implementen
|
1716 |
* IFFrameGroupSelectable.
|
1717 |
*
|
1718 |
* @param b
|
1719 |
*/
|
1720 |
public void setEditGroup(boolean b) { |
1721 |
editGroup = b; |
1722 |
} |
1723 |
|
1724 |
/**
|
1725 |
* Devuelve true si se est? en modo de edici?n de los fframes que
|
1726 |
* implementen IFFrameGroupSelectable.
|
1727 |
*
|
1728 |
* @return
|
1729 |
*/
|
1730 |
public boolean isEditGroup() { |
1731 |
return editGroup;
|
1732 |
} |
1733 |
|
1734 |
public int getNumBehind() { |
1735 |
return --numBehind;
|
1736 |
} |
1737 |
|
1738 |
public int getNumBefore() { |
1739 |
return ++numBefore;
|
1740 |
} |
1741 |
|
1742 |
public void projectionChanged(ProjectionEvent e) { |
1743 |
// TODO Auto-generated method stub
|
1744 |
|
1745 |
} |
1746 |
} |