svn-gvsig-desktop / branches / gvSIG_CAD_Layout_version / applications / appgvSIG / src / com / iver / cit / gvsig / gui / layout / dialogs / FBorderDialog.java @ 1763
History | View | Annotate | Download (18.3 KB)
1 |
/*
|
---|---|
2 |
* Created on 28-jul-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.dialogs; |
46 |
|
47 |
import com.iver.andami.PluginServices; |
48 |
import com.iver.andami.ui.mdiManager.View; |
49 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
50 |
|
51 |
import com.iver.cit.gvsig.gui.layout.FLayoutGraphics; |
52 |
import com.iver.cit.gvsig.gui.layout.FLayoutUtilities; |
53 |
import com.iver.cit.gvsig.gui.layout.Layout; |
54 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrame; |
55 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics; |
56 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup; |
57 |
import com.iver.cit.gvsig.gui.layout.fframes.IFFrame; |
58 |
import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameGraphicsDialog; |
59 |
|
60 |
import java.awt.Color; |
61 |
import java.awt.geom.Rectangle2D; |
62 |
|
63 |
import java.util.ArrayList; |
64 |
|
65 |
import javax.swing.ButtonGroup; |
66 |
import javax.swing.JPanel; |
67 |
|
68 |
|
69 |
/**
|
70 |
* Di?logo con todas las opciones para crear un borde a los fframes.
|
71 |
*
|
72 |
* @author Vicente Caballero Navarro
|
73 |
*/
|
74 |
public class FBorderDialog extends JPanel implements View { |
75 |
private javax.swing.JRadioButton rbSeleccionados = null; |
76 |
private javax.swing.JRadioButton rbTodos = null; |
77 |
private javax.swing.JRadioButton rbMargen = null; |
78 |
private javax.swing.JCheckBox chbAgrupar = null; |
79 |
private javax.swing.JPanel pPosicion = null; |
80 |
private javax.swing.JCheckBox chbIgualLados = null; |
81 |
private javax.swing.JLabel lunidades = null; |
82 |
private javax.swing.JTextField tTodosLados = null; |
83 |
private javax.swing.JLabel lSuperior = null; |
84 |
private javax.swing.JLabel lInferior = null; |
85 |
private javax.swing.JTextField tSuperior = null; |
86 |
private javax.swing.JTextField tInferior = null; |
87 |
private javax.swing.JLabel lIzquierda = null; |
88 |
private javax.swing.JLabel lDerecha = null; |
89 |
private javax.swing.JTextField tIzquierda = null; |
90 |
private javax.swing.JTextField tDerecha = null; |
91 |
private javax.swing.JLabel lUnidades = null; |
92 |
private javax.swing.JButton bAceptar = null; |
93 |
private javax.swing.JButton bCancelar = null; |
94 |
private Layout layout = null; |
95 |
private ArrayList selecList = new ArrayList(); |
96 |
private FFrameGraphics fframegraphics = null; |
97 |
private FLayoutGraphics flg = null; |
98 |
private String m_NameUnit = null; |
99 |
private javax.swing.JButton bConfigurar = null; |
100 |
|
101 |
/**
|
102 |
* This is the default constructor
|
103 |
*
|
104 |
* @param l Referencia al Layout.
|
105 |
*/
|
106 |
public FBorderDialog(Layout l) {
|
107 |
super();
|
108 |
layout = l; |
109 |
flg = new FLayoutGraphics(layout);
|
110 |
fframegraphics = new FFrameGraphics(layout.getCadToolAdapter());
|
111 |
//fframegraphics.setColor(Color.red);
|
112 |
//fframegraphics.update(Layout.RECTANGLESIMPLE, layout.getAT());
|
113 |
|
114 |
initialize(); |
115 |
} |
116 |
|
117 |
/**
|
118 |
* This method initializes this
|
119 |
*/
|
120 |
private void initialize() { |
121 |
for (int i = 0; i < layout.getFFrames().size(); i++) { |
122 |
if (((IFFrame) layout.getFFrames().get(i)).getSelected() != FFrame.NOSELECT) {
|
123 |
selecList.add(layout.getFFrames().get(i)); |
124 |
} |
125 |
} |
126 |
|
127 |
this.setLayout(null); |
128 |
m_NameUnit = layout.getAtributes().getNameUnit(); |
129 |
this.add(getRbSeleccionados(), null); |
130 |
this.add(getRbTodos(), null); |
131 |
this.add(getRbMargen(), null); |
132 |
this.add(getChbAgrupar(), null); |
133 |
this.add(getPPosicion(), null); |
134 |
this.add(getBAceptar(), null); |
135 |
this.add(getBCancelar(), null); |
136 |
this.add(getBConfigurar(), null); |
137 |
this.setSize(371, 223); |
138 |
|
139 |
ButtonGroup group = new ButtonGroup(); |
140 |
group.add(getRbSeleccionados()); |
141 |
group.add(getRbTodos()); |
142 |
group.add(getRbMargen()); |
143 |
} |
144 |
|
145 |
/**
|
146 |
* This method initializes rbSeleccionados
|
147 |
*
|
148 |
* @return javax.swing.JRadioButton
|
149 |
*/
|
150 |
private javax.swing.JRadioButton getRbSeleccionados() {
|
151 |
if (rbSeleccionados == null) { |
152 |
rbSeleccionados = new javax.swing.JRadioButton();
|
153 |
rbSeleccionados.setBounds(10, 8, 416, 20); |
154 |
rbSeleccionados.setText(PluginServices.getText(this,
|
155 |
"colocar_alrededor_seleccionados"));
|
156 |
|
157 |
if (selecList.size() == 0) { |
158 |
rbSeleccionados.setEnabled(false);
|
159 |
getRbTodos().setSelected(true);
|
160 |
} else {
|
161 |
rbSeleccionados.setSelected(true);
|
162 |
} |
163 |
} |
164 |
|
165 |
return rbSeleccionados;
|
166 |
} |
167 |
|
168 |
/**
|
169 |
* This method initializes rbTodos
|
170 |
*
|
171 |
* @return javax.swing.JRadioButton
|
172 |
*/
|
173 |
private javax.swing.JRadioButton getRbTodos() {
|
174 |
if (rbTodos == null) { |
175 |
rbTodos = new javax.swing.JRadioButton();
|
176 |
rbTodos.setBounds(10, 29, 332, 20); |
177 |
rbTodos.setText(PluginServices.getText(this,
|
178 |
"colocar_alrededor_todos"));
|
179 |
} |
180 |
|
181 |
return rbTodos;
|
182 |
} |
183 |
|
184 |
/**
|
185 |
* This method initializes rbMargen
|
186 |
*
|
187 |
* @return javax.swing.JRadioButton
|
188 |
*/
|
189 |
private javax.swing.JRadioButton getRbMargen() {
|
190 |
if (rbMargen == null) { |
191 |
rbMargen = new javax.swing.JRadioButton();
|
192 |
rbMargen.setBounds(10, 51, 286, 20); |
193 |
rbMargen.setText(PluginServices.getText(this, "colocar_a_margenes")); |
194 |
} |
195 |
|
196 |
return rbMargen;
|
197 |
} |
198 |
|
199 |
/**
|
200 |
* This method initializes chbAgrupar
|
201 |
*
|
202 |
* @return javax.swing.JCheckBox
|
203 |
*/
|
204 |
private javax.swing.JCheckBox getChbAgrupar() {
|
205 |
if (chbAgrupar == null) { |
206 |
chbAgrupar = new javax.swing.JCheckBox();
|
207 |
chbAgrupar.setBounds(10, 70, 280, 20); |
208 |
chbAgrupar.setText(PluginServices.getText(this, "agrupar_linea")); |
209 |
} |
210 |
|
211 |
return chbAgrupar;
|
212 |
} |
213 |
|
214 |
/**
|
215 |
* This method initializes pPosicion
|
216 |
*
|
217 |
* @return javax.swing.JPanel
|
218 |
*/
|
219 |
private javax.swing.JPanel getPPosicion() {
|
220 |
if (pPosicion == null) { |
221 |
pPosicion = new javax.swing.JPanel();
|
222 |
pPosicion.setLayout(null);
|
223 |
pPosicion.add(getChbIgualLados(), null);
|
224 |
pPosicion.add(getLunidades(), null);
|
225 |
pPosicion.add(getTTodosLados(), null);
|
226 |
pPosicion.add(getLSuperior(), null);
|
227 |
pPosicion.add(getLInferior(), null);
|
228 |
pPosicion.add(getTSuperior(), null);
|
229 |
pPosicion.add(getTInferior(), null);
|
230 |
pPosicion.add(getLIzquierda(), null);
|
231 |
pPosicion.add(getLDerecha(), null);
|
232 |
pPosicion.add(getTIzquierda(), null);
|
233 |
pPosicion.add(getTDerecha(), null);
|
234 |
pPosicion.add(getLUnidades(), null);
|
235 |
pPosicion.setBounds(12, 92, 350, 97); |
236 |
pPosicion.setBorder(javax.swing.BorderFactory.createTitledBorder( |
237 |
null, PluginServices.getText(this, "posicion_linea"), |
238 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
239 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
240 |
} |
241 |
|
242 |
return pPosicion;
|
243 |
} |
244 |
|
245 |
/**
|
246 |
* This method initializes chbIgualLados
|
247 |
*
|
248 |
* @return javax.swing.JCheckBox
|
249 |
*/
|
250 |
private javax.swing.JCheckBox getChbIgualLados() {
|
251 |
if (chbIgualLados == null) { |
252 |
chbIgualLados = new javax.swing.JCheckBox();
|
253 |
chbIgualLados.setBounds(10, 16, 243, 21); |
254 |
chbIgualLados.setText(PluginServices.getText(this,
|
255 |
"igual_todos_lados"));
|
256 |
chbIgualLados.setSelected(true);
|
257 |
chbIgualLados.addActionListener(new java.awt.event.ActionListener() {
|
258 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
259 |
if (!chbIgualLados.isSelected()) {
|
260 |
getTTodosLados().setEnabled(false);
|
261 |
getTSuperior().setEnabled(true);
|
262 |
getTInferior().setEnabled(true);
|
263 |
getTIzquierda().setEnabled(true);
|
264 |
getTDerecha().setEnabled(true);
|
265 |
} else {
|
266 |
getTTodosLados().setEnabled(true);
|
267 |
getTSuperior().setEnabled(false);
|
268 |
getTInferior().setEnabled(false);
|
269 |
getTIzquierda().setEnabled(false);
|
270 |
getTDerecha().setEnabled(false);
|
271 |
getTSuperior().setText(tTodosLados.getText()); |
272 |
getTInferior().setText(tTodosLados.getText()); |
273 |
getTIzquierda().setText(tTodosLados.getText()); |
274 |
getTDerecha().setText(tTodosLados.getText()); |
275 |
} |
276 |
} |
277 |
}); |
278 |
} |
279 |
|
280 |
return chbIgualLados;
|
281 |
} |
282 |
|
283 |
/**
|
284 |
* This method initializes lunidades
|
285 |
*
|
286 |
* @return javax.swing.JLabel
|
287 |
*/
|
288 |
private javax.swing.JLabel getLunidades() {
|
289 |
if (lunidades == null) { |
290 |
lunidades = new javax.swing.JLabel();
|
291 |
lunidades.setBounds(264, 64, 78, 18); |
292 |
lunidades.setText(m_NameUnit); |
293 |
} |
294 |
|
295 |
return lunidades;
|
296 |
} |
297 |
|
298 |
/**
|
299 |
* This method initializes tTodosLados
|
300 |
*
|
301 |
* @return javax.swing.JTextField
|
302 |
*/
|
303 |
private javax.swing.JTextField getTTodosLados() {
|
304 |
if (tTodosLados == null) { |
305 |
tTodosLados = new javax.swing.JTextField();
|
306 |
tTodosLados.setBounds(267, 19, 48, 16); |
307 |
tTodosLados.setText("0.5");
|
308 |
tTodosLados.addCaretListener(new javax.swing.event.CaretListener() {
|
309 |
public void caretUpdate(javax.swing.event.CaretEvent e) { |
310 |
if (getChbIgualLados().isSelected()) {
|
311 |
getTSuperior().setText(tTodosLados.getText()); |
312 |
getTInferior().setText(tTodosLados.getText()); |
313 |
getTIzquierda().setText(tTodosLados.getText()); |
314 |
getTDerecha().setText(tTodosLados.getText()); |
315 |
} |
316 |
} |
317 |
}); |
318 |
} |
319 |
|
320 |
return tTodosLados;
|
321 |
} |
322 |
|
323 |
/**
|
324 |
* This method initializes lSuperior
|
325 |
*
|
326 |
* @return javax.swing.JLabel
|
327 |
*/
|
328 |
private javax.swing.JLabel getLSuperior() {
|
329 |
if (lSuperior == null) { |
330 |
lSuperior = new javax.swing.JLabel();
|
331 |
lSuperior.setBounds(10, 55, 62, 16); |
332 |
lSuperior.setText(PluginServices.getText(this, "Superior")); |
333 |
} |
334 |
|
335 |
return lSuperior;
|
336 |
} |
337 |
|
338 |
/**
|
339 |
* This method initializes lInferior
|
340 |
*
|
341 |
* @return javax.swing.JLabel
|
342 |
*/
|
343 |
private javax.swing.JLabel getLInferior() {
|
344 |
if (lInferior == null) { |
345 |
lInferior = new javax.swing.JLabel();
|
346 |
lInferior.setBounds(10, 72, 62, 16); |
347 |
lInferior.setText(PluginServices.getText(this, "Inferior")); |
348 |
} |
349 |
|
350 |
return lInferior;
|
351 |
} |
352 |
|
353 |
/**
|
354 |
* This method initializes tSuperior
|
355 |
*
|
356 |
* @return javax.swing.JTextField
|
357 |
*/
|
358 |
private javax.swing.JTextField getTSuperior() {
|
359 |
if (tSuperior == null) { |
360 |
tSuperior = new javax.swing.JTextField();
|
361 |
tSuperior.setBounds(78, 55, 48, 16); |
362 |
tSuperior.setText("0.5");
|
363 |
tSuperior.setEnabled(false);
|
364 |
} |
365 |
|
366 |
return tSuperior;
|
367 |
} |
368 |
|
369 |
/**
|
370 |
* This method initializes tInferior
|
371 |
*
|
372 |
* @return javax.swing.JTextField
|
373 |
*/
|
374 |
private javax.swing.JTextField getTInferior() {
|
375 |
if (tInferior == null) { |
376 |
tInferior = new javax.swing.JTextField();
|
377 |
tInferior.setBounds(78, 72, 48, 16); |
378 |
tInferior.setText("0.5");
|
379 |
tInferior.setEnabled(false);
|
380 |
} |
381 |
|
382 |
return tInferior;
|
383 |
} |
384 |
|
385 |
/**
|
386 |
* This method initializes lIzquierda
|
387 |
*
|
388 |
* @return javax.swing.JLabel
|
389 |
*/
|
390 |
private javax.swing.JLabel getLIzquierda() {
|
391 |
if (lIzquierda == null) { |
392 |
lIzquierda = new javax.swing.JLabel();
|
393 |
lIzquierda.setBounds(140, 55, 62, 16); |
394 |
lIzquierda.setText(PluginServices.getText(this, "Izquierda")); |
395 |
} |
396 |
|
397 |
return lIzquierda;
|
398 |
} |
399 |
|
400 |
/**
|
401 |
* This method initializes lDerecha
|
402 |
*
|
403 |
* @return javax.swing.JLabel
|
404 |
*/
|
405 |
private javax.swing.JLabel getLDerecha() {
|
406 |
if (lDerecha == null) { |
407 |
lDerecha = new javax.swing.JLabel();
|
408 |
lDerecha.setBounds(140, 72, 62, 16); |
409 |
lDerecha.setText(PluginServices.getText(this, "Derecha")); |
410 |
} |
411 |
|
412 |
return lDerecha;
|
413 |
} |
414 |
|
415 |
/**
|
416 |
* This method initializes tIzquierda
|
417 |
*
|
418 |
* @return javax.swing.JTextField
|
419 |
*/
|
420 |
private javax.swing.JTextField getTIzquierda() {
|
421 |
if (tIzquierda == null) { |
422 |
tIzquierda = new javax.swing.JTextField();
|
423 |
tIzquierda.setBounds(207, 55, 48, 16); |
424 |
tIzquierda.setText("0.5");
|
425 |
tIzquierda.setEnabled(false);
|
426 |
} |
427 |
|
428 |
return tIzquierda;
|
429 |
} |
430 |
|
431 |
/**
|
432 |
* This method initializes tDerecha
|
433 |
*
|
434 |
* @return javax.swing.JTextField
|
435 |
*/
|
436 |
private javax.swing.JTextField getTDerecha() {
|
437 |
if (tDerecha == null) { |
438 |
tDerecha = new javax.swing.JTextField();
|
439 |
tDerecha.setBounds(207, 72, 48, 16); |
440 |
tDerecha.setText("0.5");
|
441 |
tDerecha.setEnabled(false);
|
442 |
} |
443 |
|
444 |
return tDerecha;
|
445 |
} |
446 |
|
447 |
/**
|
448 |
* This method initializes lUnidades
|
449 |
*
|
450 |
* @return javax.swing.JLabel
|
451 |
*/
|
452 |
private javax.swing.JLabel getLUnidades() {
|
453 |
if (lUnidades == null) { |
454 |
lUnidades = new javax.swing.JLabel();
|
455 |
lUnidades.setBounds(207, 36, 134, 18); |
456 |
lUnidades.setText(PluginServices.getText(this, "map_units")); |
457 |
} |
458 |
|
459 |
return lUnidades;
|
460 |
} |
461 |
|
462 |
/**
|
463 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
464 |
*/
|
465 |
public ViewInfo getViewInfo() {
|
466 |
ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
|
467 |
m_viewinfo.setTitle(PluginServices.getText(this, "ajustes_linea_grafica")); |
468 |
|
469 |
return m_viewinfo;
|
470 |
} |
471 |
|
472 |
/**
|
473 |
* This method initializes bAceptar
|
474 |
*
|
475 |
* @return javax.swing.JButton
|
476 |
*/
|
477 |
private javax.swing.JButton getBAceptar() {
|
478 |
if (bAceptar == null) { |
479 |
bAceptar = new javax.swing.JButton();
|
480 |
bAceptar.setBounds(134, 193, 100, 20); |
481 |
bAceptar.setText(PluginServices.getText(this, "Aceptar")); |
482 |
bAceptar.addActionListener(new java.awt.event.ActionListener() {
|
483 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
484 |
double x = Double.parseDouble(getTIzquierda().getText() |
485 |
.toString()); |
486 |
double y = Double.parseDouble(getTSuperior().getText() |
487 |
.toString()); |
488 |
double w = Double.parseDouble(getTDerecha().getText() |
489 |
.toString()); |
490 |
double h = Double.parseDouble(getTInferior().getText() |
491 |
.toString()); |
492 |
|
493 |
if (!getChbAgrupar().isSelected()) {
|
494 |
Rectangle2D.Double re = new Rectangle2D.Double(); |
495 |
|
496 |
if (getRbSeleccionados().isSelected()) {
|
497 |
if (selecList.size() > 0) { |
498 |
re.setRect(((IFFrame) selecList.get(0)).getBoundBox());
|
499 |
} |
500 |
|
501 |
for (int i = 1; i < selecList.size(); i++) { |
502 |
Rectangle2D.Double rectaux = ((IFFrame) selecList.get(i)).getBoundBox();
|
503 |
re.add(rectaux); |
504 |
} |
505 |
|
506 |
// crear un Rect?ngulo alrededor de los fframes seleccionados.
|
507 |
} else if (getRbTodos().isSelected()) { |
508 |
if (layout.getFFrames().size() > 0) { |
509 |
re.setRect(((IFFrame) layout.getFFrames() |
510 |
.get(0)).getBoundBox());
|
511 |
} |
512 |
|
513 |
for (int i = 1; i < layout.getFFrames().size(); |
514 |
i++) { |
515 |
Rectangle2D.Double rectaux = ((IFFrame) layout.getFFrames()
|
516 |
.get(i)).getBoundBox(); |
517 |
re.add(rectaux); |
518 |
} |
519 |
|
520 |
// creaer un Rect?ngulo que incluya a todos los fframes.
|
521 |
} else if (getRbMargen().isSelected()) { |
522 |
// creaer un Rect?ngulo en los m?rgenes del Layout.
|
523 |
re.setRect(layout.getAtributes().getArea()); |
524 |
} |
525 |
|
526 |
re.setRect(re.x - x, re.y - y, re.width + x + w, |
527 |
re.height + y + h); |
528 |
|
529 |
Rectangle2D.Double rectangle = FLayoutUtilities.fromSheetRect(re,
|
530 |
layout.getAT()); |
531 |
|
532 |
/*if (layout.isCuadricula()){
|
533 |
FLayoutUtilities.setRectGrid(rectangle,
|
534 |
layout.getAtributes().getUnitInPixelsX(),layout.getAtributes().getUnitInPixelsY(), layout.getAT());
|
535 |
}
|
536 |
*/
|
537 |
re = FLayoutUtilities.toSheetRect(rectangle, |
538 |
layout.getAT()); |
539 |
fframegraphics.setBoundBox(re); |
540 |
layout.addFFrame(fframegraphics, true);
|
541 |
} else { //Agrupar |
542 |
|
543 |
Rectangle2D.Double re = new Rectangle2D.Double(); |
544 |
FFrameGroup fframegroup = new FFrameGroup();
|
545 |
|
546 |
if (getRbSeleccionados().isSelected()) {
|
547 |
if (selecList.size() > 0) { |
548 |
re.setRect(((IFFrame) selecList.get(0)).getBoundBox());
|
549 |
} |
550 |
|
551 |
for (int i = 1; i < selecList.size(); i++) { |
552 |
Rectangle2D.Double rectaux = ((IFFrame) selecList.get(i)).getBoundBox();
|
553 |
re.add(rectaux); |
554 |
} |
555 |
|
556 |
// crear un Rect?ngulo alrededor de los fframes seleccionados.
|
557 |
} else if (getRbTodos().isSelected()) { |
558 |
if (layout.getFFrames().size() > 0) { |
559 |
re.setRect(((IFFrame) layout.getFFrames() |
560 |
.get(0)).getBoundBox());
|
561 |
} |
562 |
|
563 |
for (int i = 1; i < layout.getFFrames().size(); |
564 |
i++) { |
565 |
Rectangle2D.Double rectaux = ((IFFrame) layout.getFFrames()
|
566 |
.get(i)).getBoundBox(); |
567 |
((IFFrame) layout.getFFrames().get(i)).setSelected(true);
|
568 |
re.add(rectaux); |
569 |
} |
570 |
|
571 |
// creaer un Rect?ngulo que incluya a todos los fframes.
|
572 |
} else if (getRbMargen().isSelected()) { |
573 |
// creaer un Rect?ngulo en los m?rgenes del Layout.
|
574 |
re.setRect(layout.getAtributes().getArea()); |
575 |
} |
576 |
|
577 |
re.setRect(re.x - x, re.y - y, re.width + x + w, |
578 |
re.height + y + h); |
579 |
|
580 |
Rectangle2D.Double rectangle = FLayoutUtilities.fromSheetRect(re,
|
581 |
layout.getAT()); |
582 |
|
583 |
/*if (layout.isCuadricula()){
|
584 |
FLayoutUtilities.setRectGrid(rectangle,
|
585 |
layout.getAtributes().getUnitInPixelsX(),layout.getAtributes().getUnitInPixelsY(), layout.getAT());
|
586 |
}*/
|
587 |
re.setRect(FLayoutUtilities.toSheetRect(rectangle, |
588 |
layout.getAT())); |
589 |
fframegraphics.setBoundBox(re); |
590 |
layout.addFFrame(fframegraphics, false);
|
591 |
flg.grouping(); |
592 |
} |
593 |
|
594 |
PluginServices.getMDIManager().closeView(FBorderDialog.this); |
595 |
layout.setStatus(Layout.DESACTUALIZADO); |
596 |
layout.repaint(); |
597 |
} |
598 |
}); |
599 |
} |
600 |
|
601 |
return bAceptar;
|
602 |
} |
603 |
|
604 |
/**
|
605 |
* This method initializes bCancelar
|
606 |
*
|
607 |
* @return javax.swing.JButton
|
608 |
*/
|
609 |
private javax.swing.JButton getBCancelar() {
|
610 |
if (bCancelar == null) { |
611 |
bCancelar = new javax.swing.JButton();
|
612 |
bCancelar.setBounds(251, 193, 100, 20); |
613 |
bCancelar.setText(PluginServices.getText(this, "Cancelar")); |
614 |
bCancelar.addActionListener(new java.awt.event.ActionListener() {
|
615 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
616 |
PluginServices.getMDIManager().closeView(FBorderDialog.this); |
617 |
} |
618 |
}); |
619 |
} |
620 |
|
621 |
return bCancelar;
|
622 |
} |
623 |
|
624 |
/**
|
625 |
* @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
|
626 |
*/
|
627 |
public void viewActivated() { |
628 |
} |
629 |
|
630 |
/**
|
631 |
* This method initializes bConfigurar
|
632 |
*
|
633 |
* @return javax.swing.JButton
|
634 |
*/
|
635 |
private javax.swing.JButton getBConfigurar() {
|
636 |
if (bConfigurar == null) { |
637 |
bConfigurar = new javax.swing.JButton();
|
638 |
bConfigurar.setBounds(17, 193, 100, 20); |
639 |
bConfigurar.setText(PluginServices.getText(this, "configurar")); |
640 |
bConfigurar.addActionListener(new java.awt.event.ActionListener() {
|
641 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
642 |
FFrameGraphicsDialog graphicsdialog = new FFrameGraphicsDialog(layout,
|
643 |
fframegraphics.getGeometries()); |
644 |
|
645 |
PluginServices.getMDIManager().addView(graphicsdialog); |
646 |
} |
647 |
}); |
648 |
} |
649 |
|
650 |
return bConfigurar;
|
651 |
} |
652 |
} |