root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / layout / fframes / gui / dialogs / FFrameViewDialog.java @ 29596
History | View | Annotate | Download (20.5 KB)
1 |
/*
|
---|---|
2 |
* Created on 01-jun-2004
|
3 |
*
|
4 |
*/
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
6 |
*
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
8 |
*
|
9 |
* This program is free software; you can redistribute it and/or
|
10 |
* modify it under the terms of the GNU General Public License
|
11 |
* as published by the Free Software Foundation; either version 2
|
12 |
* of the License, or (at your option) any later version.
|
13 |
*
|
14 |
* This program is distributed in the hope that it will be useful,
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
* GNU General Public License for more details.
|
18 |
*
|
19 |
* You should have received a copy of the GNU General Public License
|
20 |
* along with this program; if not, write to the Free Software
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
22 |
*
|
23 |
* For more information, contact:
|
24 |
*
|
25 |
* Generalitat Valenciana
|
26 |
* Conselleria d'Infraestructures i Transport
|
27 |
* Av. Blasco Ib??ez, 50
|
28 |
* 46010 VALENCIA
|
29 |
* SPAIN
|
30 |
*
|
31 |
* +34 963862235
|
32 |
* gvsig@gva.es
|
33 |
* www.gvsig.gva.es
|
34 |
*
|
35 |
* or
|
36 |
*
|
37 |
* IVER T.I. S.A
|
38 |
* Salamanca 50
|
39 |
* 46005 Valencia
|
40 |
* Spain
|
41 |
*
|
42 |
* +34 963163400
|
43 |
* dac@iver.es
|
44 |
*/
|
45 |
package org.gvsig.app.project.documents.layout.fframes.gui.dialogs; |
46 |
|
47 |
import java.awt.Dimension; |
48 |
import java.awt.geom.Rectangle2D; |
49 |
|
50 |
import javax.swing.JButton; |
51 |
import javax.swing.JCheckBox; |
52 |
import javax.swing.JList; |
53 |
import javax.swing.JPanel; |
54 |
|
55 |
import org.gvsig.andami.PluginServices; |
56 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
57 |
import org.gvsig.app.project.documents.layout.FLayoutUtilities; |
58 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGrid; |
59 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGridFactory; |
60 |
import org.gvsig.app.project.documents.layout.fframes.FFrameView; |
61 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
62 |
import org.gvsig.app.project.documents.layout.fframes.ListViewModel; |
63 |
import org.gvsig.app.project.documents.layout.fframes.gui.JPRotation; |
64 |
import org.gvsig.app.project.documents.layout.gui.Layout; |
65 |
import org.gvsig.app.project.documents.view.ProjectView; |
66 |
import org.gvsig.fmap.mapcontext.ViewPort; |
67 |
|
68 |
|
69 |
|
70 |
/**
|
71 |
* Di?logo para a?adir una vista al Layout.
|
72 |
*
|
73 |
* @author Vicente Caballero Navarro
|
74 |
*/
|
75 |
public class FFrameViewDialog extends JPanel implements IFFrameDialog { |
76 |
private javax.swing.JPanel jContentPane = null; |
77 |
private javax.swing.JLabel lVistas = null; |
78 |
private javax.swing.JScrollPane jScrollPane = null; |
79 |
private javax.swing.JList liVistas = null; // @jve:visual-info decl-index=0 visual-constraint="98,-3" |
80 |
private javax.swing.JCheckBox chbEnlaceVivo = null; |
81 |
private javax.swing.JLabel lEscala = null; |
82 |
private javax.swing.JComboBox cbEscala = null; |
83 |
private javax.swing.JLabel lEscalaNumerica = null; |
84 |
private javax.swing.JTextField tEscalaNumerica = null; |
85 |
private javax.swing.JLabel lExtension = null; |
86 |
private javax.swing.JComboBox cbExtension = null; |
87 |
private javax.swing.JLabel lVisualizacion = null; |
88 |
private javax.swing.JComboBox cbVisualizacion = null; |
89 |
private javax.swing.JButton bAceptar = null; |
90 |
private javax.swing.JButton bCancelar = null; |
91 |
private javax.swing.JLabel lCalidad = null; |
92 |
private javax.swing.JComboBox cbCalidad = null; |
93 |
private ProjectView m_projectView = null; |
94 |
private Rectangle2D rect = new Rectangle2D.Double(); |
95 |
private FFrameView fframeview = null; //new FFrameView(); |
96 |
private Layout m_layout = null; |
97 |
private boolean isAcepted = false; |
98 |
private JPRotation rotation = null; |
99 |
private FFrameView newFFrameView=null; |
100 |
private javax.swing.JButton bGrid = null; |
101 |
private javax.swing.JCheckBox chbShowGrid = null; |
102 |
|
103 |
/**
|
104 |
* This is the default constructor
|
105 |
*
|
106 |
* @param layout Referencia al Layout.
|
107 |
* @param fframe Referencia al fframe vista.
|
108 |
*/
|
109 |
public FFrameViewDialog(Layout layout, FFrameView fframe) {
|
110 |
super();
|
111 |
fframeview = fframe; |
112 |
m_layout = layout; |
113 |
initialize(); |
114 |
} |
115 |
|
116 |
/**
|
117 |
* This method initializes this
|
118 |
*/
|
119 |
private void initialize() { |
120 |
this.setLayout(null); |
121 |
this.add(getJContentPane(), null); |
122 |
this.setSize(478, 269); |
123 |
|
124 |
if (fframeview.getTypeScale() == 0 || fframeview.getTypeScale() == 1) { |
125 |
getTEscalaNumerica().setEnabled(false);
|
126 |
}else{
|
127 |
getTEscalaNumerica().setEnabled(true);
|
128 |
} |
129 |
getPRotation().setRotation(fframeview.getRotation()); |
130 |
} |
131 |
|
132 |
/**
|
133 |
* Inserta el rect?ngulo que ocupar? el fframe vista.
|
134 |
*
|
135 |
* @param r Rect?ngulo.
|
136 |
*/
|
137 |
public void setRectangle(Rectangle2D r) { |
138 |
rect.setRect(r); |
139 |
} |
140 |
|
141 |
/**
|
142 |
* This method initializes jContentPane
|
143 |
*
|
144 |
* @return javax.swing.JPanel
|
145 |
*/
|
146 |
private javax.swing.JPanel getJContentPane() {
|
147 |
if (jContentPane == null) { |
148 |
jContentPane = new javax.swing.JPanel();
|
149 |
jContentPane.setLayout(null);
|
150 |
jContentPane.add(getLVistas(), null);
|
151 |
jContentPane.add(getJScrollPane(), null);
|
152 |
jContentPane.add(getChbEnlaceVivo(), null);
|
153 |
jContentPane.add(getLEscala(), null);
|
154 |
jContentPane.add(getCbEscala(), null);
|
155 |
jContentPane.add(getLEscalaNumerica(), null);
|
156 |
jContentPane.add(getTEscalaNumerica(), null);
|
157 |
jContentPane.add(getLExtension(), null);
|
158 |
jContentPane.add(getCbExtension(), null);
|
159 |
jContentPane.add(getLVisualizacion(), null);
|
160 |
jContentPane.add(getCbVisualizacion(), null);
|
161 |
jContentPane.add(getLCalidad(), null);
|
162 |
jContentPane.add(getCbCalidad(), null);
|
163 |
jContentPane.add(getbAceptar(), null);
|
164 |
jContentPane.add(getBCancelar(), null);
|
165 |
jContentPane.setSize(475, 264); |
166 |
jContentPane.setPreferredSize(new java.awt.Dimension(60, 60)); |
167 |
jContentPane.setLocation(0, 0); |
168 |
jContentPane.add(getPRotation(), null);
|
169 |
jContentPane.add(getBGrid(), null);
|
170 |
jContentPane.add(getChbShowGrid(), null);
|
171 |
} |
172 |
|
173 |
return jContentPane;
|
174 |
} |
175 |
|
176 |
/**
|
177 |
* This method initializes lVistas
|
178 |
*
|
179 |
* @return javax.swing.JLabel
|
180 |
*/
|
181 |
private javax.swing.JLabel getLVistas() {
|
182 |
if (lVistas == null) { |
183 |
lVistas = new javax.swing.JLabel();
|
184 |
lVistas.setSize(85, 19); |
185 |
lVistas.setText(PluginServices.getText(this, "Vista")); |
186 |
lVistas.setLocation(10, 10); |
187 |
} |
188 |
|
189 |
return lVistas;
|
190 |
} |
191 |
|
192 |
/**
|
193 |
* This method initializes jScrollPane
|
194 |
*
|
195 |
* @return javax.swing.JScrollPane
|
196 |
*/
|
197 |
private javax.swing.JScrollPane getJScrollPane() {
|
198 |
if (jScrollPane == null) { |
199 |
jScrollPane = new javax.swing.JScrollPane();
|
200 |
jScrollPane.setViewportView(getLiVistas()); |
201 |
jScrollPane.setBounds(99, 8, 224, 64); |
202 |
jScrollPane.setPreferredSize(new java.awt.Dimension(250, 60)); |
203 |
} |
204 |
|
205 |
return jScrollPane;
|
206 |
} |
207 |
|
208 |
/**
|
209 |
* This method initializes liVistas
|
210 |
*
|
211 |
* @return javax.swing.JList
|
212 |
*/
|
213 |
private javax.swing.JList getLiVistas() {
|
214 |
if (liVistas == null) { |
215 |
ListViewModel listmodel = new ListViewModel();
|
216 |
listmodel.addViews(); |
217 |
liVistas = new javax.swing.JList();
|
218 |
liVistas.setModel(listmodel); |
219 |
for (int i = 0; i < liVistas.getModel().getSize(); i++) { |
220 |
if (fframeview.getMapContext() != null) { |
221 |
|
222 |
ProjectView pvaux= (ProjectView) liVistas.getModel() |
223 |
.getElementAt(i); |
224 |
|
225 |
if (pvaux.getMapContext().equals(fframeview.getMapContext())) {
|
226 |
liVistas.setSelectedIndex(i); |
227 |
m_projectView= (ProjectView) liVistas.getModel() |
228 |
.getElementAt(i); |
229 |
} |
230 |
} |
231 |
} |
232 |
|
233 |
liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
|
234 |
private int selectIndex=-1; |
235 |
private Rectangle2D boundBox; |
236 |
public void valueChanged( |
237 |
javax.swing.event.ListSelectionEvent e) { |
238 |
int selectInt = ((JList)e.getSource()).getSelectedIndex(); |
239 |
if (selectInt!=selectIndex){
|
240 |
selectIndex=selectInt; |
241 |
if (selectIndex==-1) { |
242 |
return;
|
243 |
} |
244 |
m_projectView = (ProjectView) liVistas.getModel() |
245 |
.getElementAt(selectInt); |
246 |
|
247 |
getCbEscala().setSelectedItem(PluginServices.getText(this, "automatico")); |
248 |
boundBox=FLayoutUtilities.toSheetRect(rect, m_layout.getLayoutControl().getAT()); |
249 |
// fframeview.setBoundBox(FLayoutUtilities.toSheetRect(
|
250 |
// rect, m_layout.getAT()));
|
251 |
|
252 |
// fframeview.setView(m_projectView);
|
253 |
//
|
254 |
// fframeview.setMapUnits(m_projectView.getMapContext()
|
255 |
// .getViewPort()
|
256 |
// .getMapUnits());
|
257 |
ViewPort vp=m_projectView.getMapContext().getViewPort().cloneViewPort(); |
258 |
vp.setImageSize(new Dimension((int)rect.getWidth(),(int)rect.getHeight())); |
259 |
getTEscalaNumerica().setText(String.valueOf(FLayoutUtilities.getScaleView(vp,
|
260 |
boundBox.getWidth(), FLayoutUtilities.fromSheetDistance(boundBox.getWidth(),m_layout.getLayoutControl().getAT())))); |
261 |
// getTEscalaNumerica().setText(String.valueOf(
|
262 |
// fframeview.getScale()));
|
263 |
} |
264 |
} |
265 |
}); |
266 |
} |
267 |
|
268 |
return liVistas;
|
269 |
} |
270 |
|
271 |
/**
|
272 |
* This method initializes chbEnlaceVivo
|
273 |
*
|
274 |
* @return javax.swing.JCheckBox
|
275 |
*/
|
276 |
private javax.swing.JCheckBox getChbEnlaceVivo() {
|
277 |
if (chbEnlaceVivo == null) { |
278 |
chbEnlaceVivo = new javax.swing.JCheckBox();
|
279 |
chbEnlaceVivo.setSize(88, 24); |
280 |
chbEnlaceVivo.setText(PluginServices.getText(this, "enlace_vivo")); |
281 |
chbEnlaceVivo.setSelected(fframeview.getLinked()); |
282 |
chbEnlaceVivo.setLocation(10, 75); |
283 |
chbEnlaceVivo.setEnabled(true);
|
284 |
chbEnlaceVivo.addActionListener(new java.awt.event.ActionListener() {
|
285 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
286 |
System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed() |
287 |
} |
288 |
}); |
289 |
} |
290 |
|
291 |
return chbEnlaceVivo;
|
292 |
} |
293 |
|
294 |
/**
|
295 |
* This method initializes lEscala
|
296 |
*
|
297 |
* @return javax.swing.JLabel
|
298 |
*/
|
299 |
private javax.swing.JLabel getLEscala() {
|
300 |
if (lEscala == null) { |
301 |
lEscala = new javax.swing.JLabel();
|
302 |
lEscala.setSize(86, 16); |
303 |
lEscala.setText(PluginServices.getText(this, "escala")); |
304 |
lEscala.setLocation(10, 105); |
305 |
} |
306 |
|
307 |
return lEscala;
|
308 |
} |
309 |
|
310 |
/**
|
311 |
* This method initializes cbEscala
|
312 |
*
|
313 |
* @return javax.swing.JComboBox
|
314 |
*/
|
315 |
private javax.swing.JComboBox getCbEscala() {
|
316 |
if (cbEscala == null) { |
317 |
//String[] s={"Autom?tico","Conservar escala de visualizaci?n","Escala especificada por el usuario"};
|
318 |
cbEscala = new javax.swing.JComboBox();
|
319 |
cbEscala.setSize(220, 20); |
320 |
cbEscala.addItem(PluginServices.getText(this, "automatico")); |
321 |
cbEscala.addItem(PluginServices.getText(this,
|
322 |
"conservar_escala_visualizacion"));
|
323 |
cbEscala.addItem(PluginServices.getText(this, "escala_usuario")); |
324 |
cbEscala.setSelectedIndex(fframeview.getTypeScale()); |
325 |
|
326 |
if (fframeview.getTypeScale() == 0 || fframeview.getTypeScale() == 1) { |
327 |
getTEscalaNumerica().setEnabled(false);
|
328 |
}else{
|
329 |
getTEscalaNumerica().setEnabled(true);
|
330 |
} |
331 |
|
332 |
cbEscala.setPreferredSize(new java.awt.Dimension(200, 20)); |
333 |
cbEscala.setLocation(100, 105); |
334 |
cbEscala.addActionListener(new java.awt.event.ActionListener() {
|
335 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
336 |
if (cbEscala.getSelectedIndex() == 2) { |
337 |
getTEscalaNumerica().setEnabled(true);
|
338 |
} else {
|
339 |
getTEscalaNumerica().setEnabled(false);
|
340 |
} |
341 |
} |
342 |
}); |
343 |
} |
344 |
|
345 |
return cbEscala;
|
346 |
} |
347 |
|
348 |
/**
|
349 |
* This method initializes lEscalaNumerica
|
350 |
*
|
351 |
* @return javax.swing.JLabel
|
352 |
*/
|
353 |
private javax.swing.JLabel getLEscalaNumerica() {
|
354 |
if (lEscalaNumerica == null) { |
355 |
lEscalaNumerica = new javax.swing.JLabel();
|
356 |
lEscalaNumerica.setSize(86, 16); |
357 |
lEscalaNumerica.setText("1:");
|
358 |
lEscalaNumerica.setLocation(10, 130); |
359 |
} |
360 |
|
361 |
return lEscalaNumerica;
|
362 |
} |
363 |
|
364 |
/**
|
365 |
* This method initializes tEscalaNumerica
|
366 |
*
|
367 |
* @return javax.swing.JTextField
|
368 |
*/
|
369 |
private javax.swing.JTextField getTEscalaNumerica() {
|
370 |
if (tEscalaNumerica == null) { |
371 |
tEscalaNumerica = new javax.swing.JTextField();
|
372 |
tEscalaNumerica.setSize(220, 20); |
373 |
tEscalaNumerica.setPreferredSize(new java.awt.Dimension(200, 20)); |
374 |
|
375 |
if (m_projectView != null) { |
376 |
tEscalaNumerica.setText(String.valueOf(fframeview.getScale()));
|
377 |
} |
378 |
tEscalaNumerica.setLocation(100, 130); |
379 |
tEscalaNumerica.setEnabled(false);
|
380 |
} |
381 |
|
382 |
return tEscalaNumerica;
|
383 |
} |
384 |
|
385 |
/**
|
386 |
* This method initializes lExtension
|
387 |
*
|
388 |
* @return javax.swing.JLabel
|
389 |
*/
|
390 |
private javax.swing.JLabel getLExtension() {
|
391 |
if (lExtension == null) { |
392 |
lExtension = new javax.swing.JLabel();
|
393 |
lExtension.setSize(86, 16); |
394 |
lExtension.setText(PluginServices.getText(this, "extension")); |
395 |
lExtension.setLocation(10, 155); |
396 |
lExtension.setVisible(false);
|
397 |
} |
398 |
|
399 |
return lExtension;
|
400 |
} |
401 |
|
402 |
/**
|
403 |
* This method initializes cbExtension
|
404 |
*
|
405 |
* @return javax.swing.JComboBox
|
406 |
*/
|
407 |
private javax.swing.JComboBox getCbExtension() {
|
408 |
if (cbExtension == null) { |
409 |
//String[] s={"Rellenar marco de la vista","Recorte a vista"};
|
410 |
cbExtension = new javax.swing.JComboBox();
|
411 |
cbExtension.setSize(220, 20); |
412 |
cbExtension.addItem(PluginServices.getText(this,
|
413 |
"rellenar_marco_vista"));
|
414 |
cbExtension.addItem(PluginServices.getText(this, "recorte_vista")); |
415 |
|
416 |
cbExtension.setPreferredSize(new java.awt.Dimension(200, 20)); |
417 |
cbExtension.setLocation(100, 155); |
418 |
cbExtension.setEnabled(false);
|
419 |
cbExtension.setVisible(false);
|
420 |
} |
421 |
|
422 |
return cbExtension;
|
423 |
} |
424 |
|
425 |
/**
|
426 |
* This method initializes jLabel4
|
427 |
*
|
428 |
* @return javax.swing.JLabel
|
429 |
*/
|
430 |
private javax.swing.JLabel getLVisualizacion() {
|
431 |
if (lVisualizacion == null) { |
432 |
lVisualizacion = new javax.swing.JLabel();
|
433 |
lVisualizacion.setSize(86, 16); |
434 |
lVisualizacion.setText(PluginServices.getText(this, "visualizacion")); |
435 |
lVisualizacion.setLocation(10, 180); |
436 |
lVisualizacion.setVisible(false);
|
437 |
} |
438 |
|
439 |
return lVisualizacion;
|
440 |
} |
441 |
|
442 |
/**
|
443 |
* This method initializes cbVisualizacion
|
444 |
*
|
445 |
* @return javax.swing.JComboBox
|
446 |
*/
|
447 |
private javax.swing.JComboBox getCbVisualizacion() {
|
448 |
if (cbVisualizacion == null) { |
449 |
//String[] s={"Cuando activo","Siempre"};
|
450 |
cbVisualizacion = new javax.swing.JComboBox();
|
451 |
cbVisualizacion.setSize(220, 20); |
452 |
cbVisualizacion.addItem(PluginServices.getText(this, "cuando_activo")); |
453 |
cbVisualizacion.addItem(PluginServices.getText(this, "siempre")); |
454 |
cbVisualizacion.setSelectedIndex(fframeview.getViewing()); |
455 |
cbVisualizacion.setPreferredSize(new java.awt.Dimension(200, 20)); |
456 |
cbVisualizacion.setLocation(100, 180); |
457 |
cbVisualizacion.setEnabled(false);
|
458 |
cbVisualizacion.setVisible(false);
|
459 |
} |
460 |
|
461 |
return cbVisualizacion;
|
462 |
} |
463 |
|
464 |
/**
|
465 |
* This method initializes jButton
|
466 |
*
|
467 |
* @return javax.swing.JButton
|
468 |
*/
|
469 |
private javax.swing.JButton getbAceptar() {
|
470 |
if (bAceptar == null) { |
471 |
bAceptar = new javax.swing.JButton();
|
472 |
bAceptar.setSize(85, 26); |
473 |
bAceptar.setText(PluginServices.getText(this, "Aceptar")); |
474 |
bAceptar.setBounds(new java.awt.Rectangle(109,223,85,26)); |
475 |
bAceptar.addActionListener(new java.awt.event.ActionListener() {
|
476 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
477 |
newFFrameView=(FFrameView)fframeview.cloneFFrame(m_layout); |
478 |
newFFrameView.setBoundBox(FLayoutUtilities.toSheetRect( |
479 |
rect, m_layout.getLayoutControl().getAT())); |
480 |
newFFrameView.setRotation(getPRotation().getRotation()); |
481 |
if (m_projectView != null) { |
482 |
newFFrameView.setLinked(getChbEnlaceVivo().isSelected()); |
483 |
newFFrameView.setName(m_projectView.getName()); |
484 |
|
485 |
newFFrameView.setTypeScale(getCbEscala() |
486 |
.getSelectedIndex()); |
487 |
newFFrameView.setScale(Double.parseDouble(
|
488 |
getTEscalaNumerica().getText())); |
489 |
newFFrameView.setView(m_projectView); |
490 |
|
491 |
//fframeview.setFMap(m_projectView.getMapContext());
|
492 |
newFFrameView.setExtension(getCbExtension() |
493 |
.getSelectedIndex()); |
494 |
newFFrameView.setViewing(getCbVisualizacion() |
495 |
.getSelectedIndex()); |
496 |
newFFrameView.setQuality(getCbCalidad() |
497 |
.getSelectedIndex()); |
498 |
if (fframeview.getGrid()!=null){ |
499 |
((FFrameGrid)fframeview.getGrid()).setLayout(m_layout); |
500 |
((FFrameGrid)fframeview.getGrid()).setFFrameDependence(newFFrameView); |
501 |
// ((FFrameGrid)grid).setBoundBox();
|
502 |
newFFrameView.setGrid(fframeview.getGrid()); |
503 |
} |
504 |
newFFrameView.showGrid(getChbShowGrid().isSelected()); |
505 |
newFFrameView.setBoundBox(FLayoutUtilities.toSheetRect( |
506 |
rect, m_layout.getLayoutControl().getAT())); |
507 |
|
508 |
/* for (int i=0;i<m_layout.getFFrames().size();i++){
|
509 |
IFFrame fframe=(IFFrame)m_layout.getFFrames().get(i);
|
510 |
if (fframe instanceof FFrameScaleBar){
|
511 |
if (((FFrameScaleBar)fframe).getFFrameView()==fframeview){
|
512 |
if (getJComboBox().getSelectedIndex()!=0){
|
513 |
((FFrameScaleBar)fframe).setIsFixed(true);
|
514 |
((FFrameScaleBar)fframe).setScaleView(Long.parseLong(getJTextField().getText()));
|
515 |
}else{
|
516 |
((FFrameScaleBar)fframe).setIsFixed(false);
|
517 |
}
|
518 |
|
519 |
}
|
520 |
}
|
521 |
|
522 |
|
523 |
}
|
524 |
*/
|
525 |
} |
526 |
|
527 |
isAcepted = true;
|
528 |
|
529 |
//}else{
|
530 |
// isAcepted=false;
|
531 |
//}
|
532 |
PluginServices.getMDIManager().closeWindow(FFrameViewDialog.this); |
533 |
} |
534 |
}); |
535 |
} |
536 |
|
537 |
return bAceptar;
|
538 |
} |
539 |
|
540 |
/**
|
541 |
* This method initializes bCancelar
|
542 |
*
|
543 |
* @return javax.swing.JButton
|
544 |
*/
|
545 |
private javax.swing.JButton getBCancelar() {
|
546 |
if (bCancelar == null) { |
547 |
bCancelar = new javax.swing.JButton();
|
548 |
bCancelar.setSize(85, 26); |
549 |
bCancelar.setText(PluginServices.getText(this, "Cancelar")); |
550 |
bCancelar.setBounds(new java.awt.Rectangle(207,223,85,26)); |
551 |
bCancelar.addActionListener(new java.awt.event.ActionListener() {
|
552 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
553 |
newFFrameView=null;
|
554 |
PluginServices.getMDIManager().closeWindow(FFrameViewDialog.this); |
555 |
} |
556 |
}); |
557 |
} |
558 |
|
559 |
return bCancelar;
|
560 |
} |
561 |
|
562 |
/**
|
563 |
* This method initializes lCalidad
|
564 |
*
|
565 |
* @return javax.swing.JLabel
|
566 |
*/
|
567 |
private javax.swing.JLabel getLCalidad() {
|
568 |
if (lCalidad == null) { |
569 |
lCalidad = new javax.swing.JLabel();
|
570 |
lCalidad.setSize(86, 16); |
571 |
lCalidad.setText(PluginServices.getText(this, "calidad")); |
572 |
lCalidad.setLocation(10, 155); |
573 |
} |
574 |
|
575 |
return lCalidad;
|
576 |
} |
577 |
|
578 |
/**
|
579 |
* This method initializes cbCalidad
|
580 |
*
|
581 |
* @return javax.swing.JComboBox
|
582 |
*/
|
583 |
private javax.swing.JComboBox getCbCalidad() {
|
584 |
if (cbCalidad == null) { |
585 |
//String[] s={"Presentaci?n","Borrador"};
|
586 |
cbCalidad = new javax.swing.JComboBox();
|
587 |
cbCalidad.setSize(220, 20); |
588 |
cbCalidad.addItem(PluginServices.getText(this, "presentacion")); |
589 |
cbCalidad.addItem(PluginServices.getText(this, "borrador")); |
590 |
cbCalidad.setSelectedIndex(fframeview.getQuality()); |
591 |
cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20)); |
592 |
cbCalidad.setLocation(100, 155); |
593 |
} |
594 |
|
595 |
return cbCalidad;
|
596 |
} |
597 |
|
598 |
/* (non-Javadoc)
|
599 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
600 |
*/
|
601 |
public WindowInfo getWindowInfo() {
|
602 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
603 |
|
604 |
//vi.setResizable(false);
|
605 |
m_viewinfo.setTitle(PluginServices.getText(this,
|
606 |
"propiedades_marco_vista"));
|
607 |
|
608 |
return m_viewinfo;
|
609 |
} |
610 |
|
611 |
/**
|
612 |
* @see org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog#getIsAcepted()
|
613 |
*/
|
614 |
public boolean getIsAcepted() { |
615 |
return isAcepted;
|
616 |
} |
617 |
|
618 |
/**
|
619 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
620 |
*/
|
621 |
public void viewActivated() { |
622 |
} |
623 |
|
624 |
/**
|
625 |
* This method initializes rotation
|
626 |
*
|
627 |
* @return javax.swing.JPanel
|
628 |
*/
|
629 |
private JPRotation getPRotation() {
|
630 |
if (rotation == null) { |
631 |
rotation = new JPRotation();
|
632 |
rotation.setBounds(330, 90, 120, 120); |
633 |
} |
634 |
return rotation;
|
635 |
} |
636 |
|
637 |
public IFFrame getFFrame() {
|
638 |
return newFFrameView;
|
639 |
} |
640 |
/**
|
641 |
* This method initializes bGrid
|
642 |
*
|
643 |
* @return javax.swing.JButton
|
644 |
*/
|
645 |
private JButton getBGrid() { |
646 |
if (bGrid == null) { |
647 |
bGrid = new JButton(); |
648 |
bGrid.setBounds(new java.awt.Rectangle(207,186,85,26)); |
649 |
bGrid.setText(PluginServices.getText(this,"configurar")); |
650 |
bGrid.addActionListener(new java.awt.event.ActionListener() {
|
651 |
|
652 |
|
653 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
654 |
FFrameGridFactory gridFactory=new FFrameGridFactory();
|
655 |
FFrameGrid fframe = null;
|
656 |
|
657 |
if (fframeview.getGrid() != null){ |
658 |
fframe = (FFrameGrid)fframeview.getGrid(); |
659 |
}else{
|
660 |
fframe = (FFrameGrid)gridFactory.createFrame(); |
661 |
fframe.setLayout(m_layout); |
662 |
fframe.setFFrameDependence(fframeview); |
663 |
} |
664 |
|
665 |
|
666 |
FFrameGridDialog fframedialog = new FFrameGridDialog(m_layout, fframe,fframeview);
|
667 |
// fframedialog.setFFrameView(fframeview);
|
668 |
if (fframedialog != null) { |
669 |
PluginServices.getMDIManager().addWindow(fframedialog); |
670 |
} |
671 |
IFFrame newFrame= fframedialog.getFFrame(); |
672 |
if (newFrame!=null) { |
673 |
fframeview.setGrid(newFrame); |
674 |
} |
675 |
} |
676 |
}); |
677 |
} |
678 |
return bGrid;
|
679 |
} |
680 |
|
681 |
/**
|
682 |
* This method initializes chbShowGrid
|
683 |
*
|
684 |
* @return javax.swing.JCheckBox
|
685 |
*/
|
686 |
private JCheckBox getChbShowGrid() { |
687 |
if (chbShowGrid == null) { |
688 |
chbShowGrid = new JCheckBox(); |
689 |
chbShowGrid.setBounds(new java.awt.Rectangle(13,191,181,21)); |
690 |
chbShowGrid.setSelected(fframeview.isShowGrid()); |
691 |
chbShowGrid.setText(PluginServices.getText(this,"Show_grid")); |
692 |
} |
693 |
return chbShowGrid;
|
694 |
} |
695 |
|
696 |
public Object getWindowProfile() { |
697 |
return WindowInfo.DIALOG_PROFILE;
|
698 |
} |
699 |
|
700 |
} // @jve:decl-index=0:visual-constraint="10,10"
|