svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / layout / fframes / FFrameTable.java @ 10661
History | View | Annotate | Download (17.2 KB)
1 | 9392 | caballero | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | /* CVS MESSAGES:
|
||
42 | *
|
||
43 | * $Id$
|
||
44 | * $Log$
|
||
45 | 10661 | caballero | * Revision 1.5 2007-03-08 11:33:01 caballero
|
46 | 10626 | caballero | * Exceptions
|
47 | *
|
||
48 | 10661 | caballero | * Revision 1.4 2007/03/06 16:36:19 caballero
|
49 | * Exceptions
|
||
50 | *
|
||
51 | 10626 | caballero | * Revision 1.3 2007/01/23 13:10:17 caballero
|
52 | 9863 | caballero | * valor no num?rico
|
53 | *
|
||
54 | * Revision 1.2 2007/01/03 12:02:54 caballero
|
||
55 | 9516 | caballero | * Extensibilidad FFrames
|
56 | *
|
||
57 | * Revision 1.1 2006/12/20 14:42:06 caballero
|
||
58 | 9392 | caballero | * Remodelado Layout
|
59 | *
|
||
60 | * Revision 1.6 2006/12/11 17:40:35 caballero
|
||
61 | * ajustar a grid en el Layout
|
||
62 | *
|
||
63 | * Revision 1.5 2006/09/15 10:41:30 caballero
|
||
64 | * extensibilidad de documentos
|
||
65 | *
|
||
66 | * Revision 1.4 2006/08/01 09:16:24 caballero
|
||
67 | * optimizar c?digo
|
||
68 | *
|
||
69 | * Revision 1.3 2006/05/26 06:51:08 caballero
|
||
70 | * Proyectos de la versi?n 0.6
|
||
71 | *
|
||
72 | * Revision 1.2 2006/04/18 06:43:11 caballero
|
||
73 | * Editar v?rtice
|
||
74 | *
|
||
75 | * Revision 1.1 2006/04/10 06:37:07 caballero
|
||
76 | * FFrameTable
|
||
77 | *
|
||
78 | * Revision 1.1 2006/01/12 12:32:04 caballero
|
||
79 | * box
|
||
80 | *
|
||
81 | *
|
||
82 | */
|
||
83 | package com.iver.cit.gvsig.project.documents.layout.fframes; |
||
84 | |||
85 | import java.awt.Color; |
||
86 | import java.awt.Graphics2D; |
||
87 | import java.awt.Image; |
||
88 | import java.awt.event.MouseEvent; |
||
89 | import java.awt.geom.AffineTransform; |
||
90 | import java.awt.geom.Point2D; |
||
91 | import java.awt.geom.Rectangle2D; |
||
92 | import java.awt.image.BufferedImage; |
||
93 | import java.util.ArrayList; |
||
94 | |||
95 | import javax.swing.ImageIcon; |
||
96 | |||
97 | 10626 | caballero | import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
98 | 9392 | caballero | import com.iver.andami.PluginServices; |
99 | import com.iver.cit.gvsig.AddLayer; |
||
100 | 9863 | caballero | import com.iver.cit.gvsig.ProjectExtension; |
101 | import com.iver.cit.gvsig.project.Project; |
||
102 | import com.iver.cit.gvsig.project.documents.exceptions.OpenException; |
||
103 | 9392 | caballero | import com.iver.cit.gvsig.project.documents.exceptions.SaveException; |
104 | import com.iver.cit.gvsig.project.documents.layout.fframes.gui.dialogs.FFrameBoxDialog; |
||
105 | import com.iver.cit.gvsig.project.documents.layout.fframes.gui.dialogs.IFFrameDialog; |
||
106 | import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
||
107 | import com.iver.utiles.XMLEntity; |
||
108 | |||
109 | |||
110 | /**
|
||
111 | * DOCUMENT ME!
|
||
112 | *
|
||
113 | * @author Vicente Caballero Navarro
|
||
114 | */
|
||
115 | public class FFrameTable extends FFrameGroup implements IFFrameGroupSelectable{ |
||
116 | private int numColumns = 2; |
||
117 | private int numRows = 2; |
||
118 | private boolean selectFFrameBasic=false; |
||
119 | private static final Image iMove = new ImageIcon(AddLayer.class |
||
120 | .getClassLoader().getResource("images/Move.png")).getImage();
|
||
121 | |||
122 | |||
123 | /**
|
||
124 | * DOCUMENT ME!
|
||
125 | *
|
||
126 | * @param g DOCUMENT ME!
|
||
127 | * @param at DOCUMENT ME!
|
||
128 | * @param rv DOCUMENT ME!
|
||
129 | * @param imgBase DOCUMENT ME!
|
||
130 | */
|
||
131 | public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv, |
||
132 | 10626 | caballero | BufferedImage imgBase) throws ReadDriverException { |
133 | 9392 | caballero | Rectangle2D.Double r = getBoundingBox(at);
|
134 | g.setColor(Color.black);
|
||
135 | g.rotate(Math.toRadians(getRotation()), r.x + (r.width / 2), |
||
136 | r.y + (r.height / 2));
|
||
137 | drawRectangles(g,at,rv,imgBase); |
||
138 | g.rotate(Math.toRadians(-getRotation()), r.x + (r.width / 2), |
||
139 | r.y + (r.height / 2));
|
||
140 | super.draw(g,at,rv,imgBase);
|
||
141 | } |
||
142 | |||
143 | private void drawRectangles(Graphics2D g, AffineTransform at,Rectangle2D rv,BufferedImage imgBase) { |
||
144 | IFFrame[] fframes=getFFrames();
|
||
145 | for (int i =0;i<fframes.length;i++){ |
||
146 | FFrameBasic basic=(FFrameBasic)fframes[i]; |
||
147 | try {
|
||
148 | basic.draw(g,at,rv,imgBase); |
||
149 | 10626 | caballero | } catch (ReadDriverException e) {
|
150 | 9392 | caballero | e.printStackTrace(); |
151 | } |
||
152 | } |
||
153 | } |
||
154 | |||
155 | /**
|
||
156 | * DOCUMENT ME!
|
||
157 | *
|
||
158 | * @param r DOCUMENT ME!
|
||
159 | * @param g DOCUMENT ME!
|
||
160 | */
|
||
161 | public void drawBox(Rectangle2D r, Graphics2D g) { |
||
162 | calculateTable(r); |
||
163 | IFFrame[] fframes=getFFrames();
|
||
164 | for (int i =0;i<fframes.length;i++){ |
||
165 | FFrameBasic basic=(FFrameBasic)fframes[i]; |
||
166 | try {
|
||
167 | basic.draw(g,new AffineTransform(),null,null); |
||
168 | 10626 | caballero | } catch (ReadDriverException e) {
|
169 | 9392 | caballero | e.printStackTrace(); |
170 | } |
||
171 | } |
||
172 | } |
||
173 | |||
174 | /**
|
||
175 | * DOCUMENT ME!
|
||
176 | *
|
||
177 | * @param g DOCUMENT ME!
|
||
178 | * @param at DOCUMENT ME!
|
||
179 | *
|
||
180 | 10661 | caballero | * @throws ReadDriverException
|
181 | 9392 | caballero | */
|
182 | public void print(Graphics2D g, AffineTransform at) |
||
183 | 10626 | caballero | throws ReadDriverException {
|
184 | 9392 | caballero | draw(g, at, null, null); |
185 | } |
||
186 | |||
187 | /**
|
||
188 | * DOCUMENT ME!
|
||
189 | *
|
||
190 | * @return DOCUMENT ME!
|
||
191 | *
|
||
192 | * @throws SaveException DOCUMENT ME!
|
||
193 | */
|
||
194 | public XMLEntity getXMLEntity() throws SaveException { |
||
195 | XMLEntity xml = super.getXMLEntity();
|
||
196 | xml.putProperty("numColumns",numColumns);
|
||
197 | xml.putProperty("numRows",numRows);
|
||
198 | return xml;
|
||
199 | } |
||
200 | |||
201 | /**
|
||
202 | * DOCUMENT ME!
|
||
203 | *
|
||
204 | * @param xml DOCUMENT ME!
|
||
205 | */
|
||
206 | public void setXMLEntity(XMLEntity xml) { |
||
207 | super.setXMLEntity(xml);
|
||
208 | numColumns=xml.getIntProperty("numColumns");
|
||
209 | numRows=xml.getIntProperty("numRows");
|
||
210 | } |
||
211 | |||
212 | /**
|
||
213 | * DOCUMENT ME!
|
||
214 | *
|
||
215 | * @param xml DOCUMENT ME!
|
||
216 | * @param l DOCUMENT ME!
|
||
217 | */
|
||
218 | public void setXMLEntity03(XMLEntity xml, Layout l) { |
||
219 | // TODO Auto-generated method stub
|
||
220 | } |
||
221 | |||
222 | /**
|
||
223 | * DOCUMENT ME!
|
||
224 | *
|
||
225 | * @return DOCUMENT ME!
|
||
226 | */
|
||
227 | public String getNameFFrame() { |
||
228 | return PluginServices.getText(this, "box") + num; |
||
229 | } |
||
230 | |||
231 | /**
|
||
232 | * DOCUMENT ME!
|
||
233 | *
|
||
234 | * @return DOCUMENT ME!
|
||
235 | */
|
||
236 | public int getNumColumns() { |
||
237 | return numColumns;
|
||
238 | } |
||
239 | |||
240 | /**
|
||
241 | * DOCUMENT ME!
|
||
242 | *
|
||
243 | * @param numColumns DOCUMENT ME!
|
||
244 | */
|
||
245 | public void setNumColumns(int numColumns) { |
||
246 | this.numColumns = numColumns;
|
||
247 | } |
||
248 | |||
249 | /**
|
||
250 | * DOCUMENT ME!
|
||
251 | *
|
||
252 | * @return DOCUMENT ME!
|
||
253 | */
|
||
254 | public int getNumRows() { |
||
255 | return numRows;
|
||
256 | } |
||
257 | |||
258 | /**
|
||
259 | * DOCUMENT ME!
|
||
260 | *
|
||
261 | * @param numRows DOCUMENT ME!
|
||
262 | */
|
||
263 | public void setNumRows(int numRows) { |
||
264 | this.numRows = numRows;
|
||
265 | } |
||
266 | |||
267 | public void calculateTable(Rectangle2D r) { |
||
268 | double wC = r.getWidth() / numColumns;
|
||
269 | double hR = r.getHeight() / numRows;
|
||
270 | int rows = numRows;
|
||
271 | clearFFrames(); |
||
272 | for (int i = 0; i < numColumns; i++) { |
||
273 | for (int j = 0; j < rows; j++) { |
||
274 | double x=r.getX() + (wC * i);
|
||
275 | double y=r.getY() + (hR * j);
|
||
276 | double w=wC;
|
||
277 | double h=hR;
|
||
278 | Rectangle2D rBasic=new Rectangle2D.Double(x,y,w,h); |
||
279 | 9516 | caballero | FFrameBasic basic=(FFrameBasic)FrameFactory.createFrameFromName(FFrameBasicFactory.registerName); |
280 | basic.setRectangle(rBasic); |
||
281 | 9392 | caballero | basic.setLayout(getLayout()); |
282 | addFFrame(basic); |
||
283 | } |
||
284 | } |
||
285 | } |
||
286 | |||
287 | public void selectFFrame(boolean b) { |
||
288 | selectFFrameBasic=b; |
||
289 | } |
||
290 | |||
291 | public IFFrame joinFFrame() {
|
||
292 | IFFrame[] fframes=this.getFFrames(); |
||
293 | Rectangle2D r=null; |
||
294 | |||
295 | for (int i=fframes.length-1;i>=0;i--){ |
||
296 | if (fframes[i].getSelected()!=IFFrame.NOSELECT){
|
||
297 | if (r==null){ |
||
298 | r=(Rectangle2D)fframes[i].getBoundBox().clone();
|
||
299 | }else{
|
||
300 | r.add(fframes[i].getBoundBox()); |
||
301 | } |
||
302 | this.removeFFrame(i);
|
||
303 | } |
||
304 | |||
305 | //removeFFrame(fframes[i]);
|
||
306 | } |
||
307 | if (r!=null){ |
||
308 | //Layout layout=(Layout)PluginServices.getMDIManager().getActiveView();
|
||
309 | 9516 | caballero | FFrameBasic basic=(FFrameBasic)FrameFactory.createFrameFromName(FFrameBasicFactory.registerName); |
310 | basic.setRectangle(r); |
||
311 | basic.setLayout(getLayout()); |
||
312 | this.addFFrame(basic);
|
||
313 | 9392 | caballero | return this; |
314 | } |
||
315 | |||
316 | return null; |
||
317 | } |
||
318 | |||
319 | /*
|
||
320 | public int getSelected() {
|
||
321 | // if (!selectFFrameBasic)
|
||
322 | return super.getSelected();
|
||
323 | // IFFrame[] fframes=getFFrames();
|
||
324 | // for (int i = 0;i<fframes.length;i++){
|
||
325 | // int selection=fframes[i].getSelected();
|
||
326 | // if (selection>0){
|
||
327 | // return selection;
|
||
328 | // }
|
||
329 | // }
|
||
330 | // return 0;
|
||
331 | |||
332 | }
|
||
333 | */
|
||
334 | public void setSelected(Point2D p,MouseEvent e) { |
||
335 | if (!selectFFrameBasic)
|
||
336 | super.setSelected(p,e);
|
||
337 | else{
|
||
338 | setSelectedGroup(p,e); |
||
339 | } |
||
340 | } |
||
341 | |||
342 | public boolean contains(Point2D p) { |
||
343 | if (!selectFFrameBasic)
|
||
344 | return super.contains(p); |
||
345 | return contains(p);
|
||
346 | } |
||
347 | |||
348 | public void drawHandlers(Graphics2D g) { |
||
349 | if (!selectFFrameBasic)
|
||
350 | super.drawHandlers(g);
|
||
351 | else{
|
||
352 | drawHandlersGroup(g); |
||
353 | |||
354 | } |
||
355 | } |
||
356 | |||
357 | public int getContains(Point2D p) { |
||
358 | if (!selectFFrameBasic)
|
||
359 | return super.getContains(p); |
||
360 | return getContainsGroup(p);
|
||
361 | } |
||
362 | |||
363 | public Rectangle2D getMovieRect(int difx, int dify) { |
||
364 | //TODO Esto de momento lo dejo que no se pueda mover
|
||
365 | //cuando se tiene seleccionada la herramienta de selecci?n de un FFrameBasic.
|
||
366 | Rectangle2D r= super.getMovieRect(difx,dify); |
||
367 | if (!selectFFrameBasic)
|
||
368 | return r;
|
||
369 | r= super.getMovieRect(0,0); |
||
370 | return r;
|
||
371 | } |
||
372 | |||
373 | public Rectangle2D getMovieRectGroup(int difX, int difY) { |
||
374 | Rectangle2D r=null; |
||
375 | IFFrame[] fframes = getFFrames();
|
||
376 | ArrayList selected=new ArrayList(); |
||
377 | for (int i = 0; i < fframes.length; i++) { |
||
378 | IFFrame fframe = fframes[i]; |
||
379 | if (fframe.getSelected()!=IFFrame.NOSELECT){
|
||
380 | selected.add(fframe); |
||
381 | } |
||
382 | } |
||
383 | |||
384 | for (int i = 0; i < selected.size(); i++) { |
||
385 | |||
386 | if (i==0){ |
||
387 | r=((IFFrame)selected.get(i)).getMovieRect(difX,difY); |
||
388 | }else
|
||
389 | r.add(((IFFrame)selected.get(i)).getMovieRect(difX,difY)); |
||
390 | } |
||
391 | return r;
|
||
392 | } |
||
393 | |||
394 | public int getContainsGroup(Point2D p) { |
||
395 | ArrayList selected=new ArrayList(); |
||
396 | IFFrame[] fframes = getFFrames();
|
||
397 | for (int i = 0; i < fframes.length; i++) { |
||
398 | IFFrame fframe = fframes[i]; |
||
399 | int contains=fframe.getContains(p);
|
||
400 | if (contains != IFFrame.NOSELECT) {
|
||
401 | if (contains == IFFrame.RECT){
|
||
402 | selected.add(fframe); |
||
403 | }else{
|
||
404 | return contains;
|
||
405 | } |
||
406 | } |
||
407 | } |
||
408 | if (selected.size()>0){ |
||
409 | return ((IFFrame)selected.get(0)).getContains(p); |
||
410 | } |
||
411 | return 0; |
||
412 | } |
||
413 | |||
414 | /**
|
||
415 | * Dibuja los handlers sobre el boundingBox en el graphics que se pasa como
|
||
416 | * par?metro.
|
||
417 | *
|
||
418 | * @param g Graphics sobre el que dibujar.
|
||
419 | */
|
||
420 | public void drawHandlersGroup(Graphics2D g) { |
||
421 | int size = 8; |
||
422 | g.setColor(Color.gray);
|
||
423 | IFFrame[] fframes=getFFrames();
|
||
424 | for (int i = 0; i < fframes.length; i++) { |
||
425 | IFFrame fframe = fframes[i]; |
||
426 | if (fframe.getSelected()!=IFFrame.NOSELECT){
|
||
427 | Rectangle2D r = fframe.getBoundingBox(null); |
||
428 | Point2D p = new Point2D.Double(); |
||
429 | g.rotate(Math.toRadians(getRotation()), r.getX() + (r.getWidth() / 2), |
||
430 | r.getY() + (r.getHeight() / 2));
|
||
431 | |||
432 | AffineTransform atRotate = new AffineTransform(); |
||
433 | atRotate.rotate(Math.toRadians(getRotation()),
|
||
434 | r.getX() + (r.getWidth() / 2), r.getY() + (r.getHeight() / 2)); |
||
435 | |||
436 | g.fillRect((int) r.getX() - size/2, (int) r.getY() - size/2, size, size); |
||
437 | atRotate.transform(new Point2D.Double(r.getX() - size/2, r.getY() - size/2), |
||
438 | p); |
||
439 | no.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
440 | |||
441 | g.fillRect((int) r.getMaxX()- size/2, (int) r.getY() - size/2, size, size); |
||
442 | atRotate.transform(new Point2D.Double(r.getMaxX()-size/2, r.getY() - size/2), p); |
||
443 | ne.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
444 | |||
445 | g.fillRect((int) r.getX() - size/2, (int) r.getMaxY()-size/2, size, size); |
||
446 | atRotate.transform(new Point2D.Double(r.getX() - size/2, r.getMaxY()-size/2), p); |
||
447 | so.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
448 | |||
449 | g.fillRect((int) r.getMaxX()-size/2, (int) r.getMaxY()-size/2, size, size); |
||
450 | atRotate.transform(new Point2D.Double(r.getMaxX()-size/2, r.getMaxY()-size/2), p); |
||
451 | se.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
452 | |||
453 | g.fillRect((int) r.getCenterX() - (size / 2), (int) r.getY() - size/2, |
||
454 | size, size); |
||
455 | atRotate.transform(new Point2D.Double(r.getCenterX() - (size / 2), |
||
456 | r.getY() - size/2), p);
|
||
457 | n.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
458 | |||
459 | g.fillRect((int) r.getCenterX() - (size / 2), (int) r.getMaxY()-size/2, size, |
||
460 | size); |
||
461 | atRotate.transform(new Point2D.Double(r.getCenterX() - (size / 2), |
||
462 | r.getMaxY()-size/2), p);
|
||
463 | s.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
464 | |||
465 | g.fillRect((int) r.getX() - size/2, (int) r.getCenterY() - (size / 2), |
||
466 | size, size); |
||
467 | atRotate.transform(new Point2D.Double(r.getX() - size/2, |
||
468 | r.getCenterY() - (size / 2)), p);
|
||
469 | o.setRect((int) p.getX(), (int) p.getY(), size, size); |
||
470 | |||
471 | g.fillRect((int) r.getMaxX()-size/2, (int) r.getCenterY() - (size / 2), size, |
||
472 | size); |
||
473 | atRotate.transform(new Point2D.Double(r.getMaxX()-size/2, |
||
474 | r.getCenterY() - (size / 2)), p);
|
||
475 | e.setRect((int) p.getX()-size/2, (int) p.getY()-size/2, size, size); |
||
476 | g.rotate(Math.toRadians(-getRotation()), r.getX() + (r.getWidth() / 2), |
||
477 | r.getY() + (r.getHeight() / 2));
|
||
478 | } |
||
479 | } |
||
480 | |||
481 | } |
||
482 | |||
483 | /* public void drawHandlersGroup(Graphics2D g) {
|
||
484 | g.setColor(Color.gray);
|
||
485 | IFFrame[] fframes=getFFrames();
|
||
486 | for (int i = 0; i < fframes.length; i++) {
|
||
487 | IFFrame fframe = fframes[i];
|
||
488 | if (fframe.getSelected()!=IFFrame.NOSELECT){
|
||
489 | fframe.drawHandlers(g);
|
||
490 | }
|
||
491 | }
|
||
492 | }
|
||
493 | */
|
||
494 | public boolean containsGroup(Point2D p) { |
||
495 | IFFrame[] fframes=getFFrames();
|
||
496 | for (int i = 0; i < fframes.length; i++) { |
||
497 | IFFrame fframe = fframes[i]; |
||
498 | if (fframe.contains(p)){
|
||
499 | return true; |
||
500 | } |
||
501 | } |
||
502 | return false; |
||
503 | } |
||
504 | |||
505 | public void setSelectedGroup(Point2D p, MouseEvent e) { |
||
506 | IFFrame[] fframes = getFFrames();
|
||
507 | if (!e.isShiftDown()) {
|
||
508 | for (int j = 0; j < fframes.length; j++) { |
||
509 | fframes[j].setSelected(false);
|
||
510 | } |
||
511 | for (int i = 0; i < fframes.length; i++) { |
||
512 | IFFrame fframe = fframes[i]; |
||
513 | //if ((fframe.getSelected() == IFFrame.NOSELECT)) {
|
||
514 | fframe.setSelected(p, e); |
||
515 | //}
|
||
516 | } |
||
517 | }else{
|
||
518 | for (int i = 0; i < fframes.length; i++) { |
||
519 | IFFrame fframe = fframes[i]; |
||
520 | if (fframe.contains(p)) {
|
||
521 | if ((fframe.getSelected() == IFFrame.NOSELECT)) {
|
||
522 | fframe.setSelected(p, e); |
||
523 | } else {
|
||
524 | fframe.setSelected(false);
|
||
525 | } |
||
526 | } |
||
527 | } |
||
528 | } |
||
529 | } |
||
530 | |||
531 | public int getSelectedGroup() { |
||
532 | return 0; |
||
533 | } |
||
534 | |||
535 | public Image getMapCursor(Point2D p) { |
||
536 | if (!selectFFrameBasic)
|
||
537 | return super.getMapCursor(p); |
||
538 | return getMapCursorGroup(p);
|
||
539 | } |
||
540 | public Image getMapCursorGroup(Point2D p){ |
||
541 | int select = getContains(p);
|
||
542 | switch (select) {
|
||
543 | case (RECT):
|
||
544 | return iMove;
|
||
545 | } |
||
546 | return null; |
||
547 | } |
||
548 | |||
549 | public IFFrameDialog getPropertyDialog() {
|
||
550 | return new FFrameBoxDialog(getLayout(),this); |
||
551 | } |
||
552 | 9863 | caballero | public IFFrame cloneFFrame(Layout layout) {
|
553 | Project p = ((ProjectExtension) PluginServices.getExtension(ProjectExtension.class)).getProject(); |
||
554 | IFFrame frame = null;
|
||
555 | 9392 | caballero | |
556 | 9863 | caballero | try {
|
557 | frame = createFromXML(this.getXMLEntity(), p,layout);
|
||
558 | } catch (OpenException e) {
|
||
559 | e.showError(); |
||
560 | } catch (SaveException e) {
|
||
561 | e.showError(); |
||
562 | } |
||
563 | frame.setLayout(layout); |
||
564 | |||
565 | if (frame instanceof IFFrameViewDependence) { |
||
566 | ((IFFrameViewDependence) frame).initDependence(layout.getLayoutContext().getAllFFrames()); |
||
567 | } |
||
568 | frame.setFrameLayoutFactory(factory); |
||
569 | cloneActions(frame); |
||
570 | return frame;
|
||
571 | } |
||
572 | 9392 | caballero | } |