Revision 670
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/contextmenu/gui/PropertyLayoutMenuEntry.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.app.project.documents.layout.contextmenu.gui; |
23 | 23 |
|
24 |
import java.awt.event.ActionEvent; |
|
25 |
import java.awt.event.ActionListener; |
|
26 |
|
|
24 | 27 |
import org.gvsig.andami.PluginServices; |
25 | 28 |
import org.gvsig.app.project.ProjectManager; |
26 | 29 |
import org.gvsig.app.project.documents.layout.DefaultLayoutManager; |
... | ... | |
29 | 32 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
30 | 33 |
import org.gvsig.app.project.documents.layout.fframes.IFFrameUseFMap; |
31 | 34 |
import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog; |
35 |
import org.gvsig.tools.ToolsLocator; |
|
36 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
37 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
32 | 38 |
|
33 | 39 |
/** |
34 | 40 |
* Abre el di?logo de propiedades del FFrame seleccionado. |
35 |
*
|
|
41 |
* |
|
36 | 42 |
* @author Vicente Caballero Navarro |
37 | 43 |
*/ |
38 | 44 |
public class PropertyLayoutMenuEntry extends AbstractLayoutContextMenuAction { |
... | ... | |
75 | 81 |
return false; |
76 | 82 |
} |
77 | 83 |
|
78 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
|
84 |
public void execute(final LayoutContext layoutContext, IFFrame[] selectedFrames) {
|
|
79 | 85 |
IFFrame[] selecList = layoutContext.getSelectedFFrames(); |
80 | 86 |
if (selecList.length == 1) { |
81 |
IFFrame frame = selecList[0]; |
|
82 |
IFFrameDialog fframeDialog = |
|
87 |
final IFFrame frame = selecList[0];
|
|
88 |
final IFFrameDialog fframeDialog =
|
|
83 | 89 |
layoutManager.createFFrameDialog(frame, layoutPanel, layoutContext.getAT()); |
84 | 90 |
if (fframeDialog != null) { |
91 |
fframeDialog.addActionListener(new ActionListener() { |
|
92 |
|
|
93 |
@Override |
|
94 |
public void actionPerformed(ActionEvent e) { |
|
95 |
IFFrame fframeAux = fframeDialog.getFFrame(); |
|
96 |
|
|
97 |
if (fframeAux != null) { |
|
98 |
if (fframeAux instanceof IFFrameUseFMap) |
|
99 |
((IFFrameUseFMap) fframeAux).refresh(); |
|
100 |
fframeAux.setLevel(frame.getLevel()); |
|
101 |
fframeAux.setSelected(frame.getSelected()!=IFFrame.NOSELECT); |
|
102 |
layoutContext.getFrameCommandsRecord().update(frame, fframeAux); |
|
103 |
fframeAux.getBoundingBox(layoutContext.getAT()); |
|
104 |
layoutContext.updateFFrames(); |
|
105 |
layoutContext.notifAllObservers(); |
|
106 |
} |
|
107 |
|
|
108 |
} |
|
109 |
}); |
|
85 | 110 |
PluginServices.getMDIManager().addWindow(fframeDialog); |
86 |
IFFrame fframeAux = fframeDialog.getFFrame(); |
|
87 |
//fframeAux is null when the cancel button has been clicked |
|
88 |
if (fframeAux != null){ |
|
89 |
if (fframeAux instanceof IFFrameUseFMap) |
|
90 |
((IFFrameUseFMap) fframeAux).refresh(); |
|
91 |
layoutContext.getFrameCommandsRecord().update(frame, fframeAux); |
|
92 |
fframeAux.getBoundingBox(layoutContext.getAT()); |
|
93 |
layoutContext.updateFFrames(); |
|
94 |
layoutContext.notifAllObservers(); |
|
95 |
} |
|
96 | 111 |
} |
97 | 112 |
} |
98 | 113 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/gui/dialogs/FFrameViewDialog.java | ||
---|---|---|
46 | 46 |
import org.gvsig.app.ApplicationLocator; |
47 | 47 |
import org.gvsig.app.ApplicationManager; |
48 | 48 |
import org.gvsig.app.project.ProjectManager; |
49 |
import org.gvsig.app.project.documents.layout.DefaultLayoutManager; |
|
49 | 50 |
import org.gvsig.app.project.documents.layout.FLayoutUtilities; |
51 |
import org.gvsig.app.project.documents.layout.LayoutContext; |
|
50 | 52 |
import org.gvsig.app.project.documents.layout.LayoutManager; |
51 | 53 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGrid; |
52 | 54 |
import org.gvsig.app.project.documents.layout.fframes.FFrameView; |
... | ... | |
67 | 69 |
|
68 | 70 |
/** |
69 | 71 |
* Dialog to add a view to the Layout document, by means of a FFrameView |
70 |
*
|
|
72 |
* |
|
71 | 73 |
* @author Vicente Caballero Navarro |
72 | 74 |
* @author Cesar Martinez Izquierdo |
73 | 75 |
*/ |
... | ... | |
75 | 77 |
IFFrameDialog, SingletonWindow { |
76 | 78 |
|
77 | 79 |
private static final long serialVersionUID = -7223804566537544559L; |
78 |
|
|
80 |
|
|
79 | 81 |
private final LayoutManager layoutManager; |
80 | 82 |
private javax.swing.JLabel lViews = null; |
81 | 83 |
private javax.swing.JScrollPane jScrollPane = null; |
... | ... | |
91 | 93 |
private FFrameView fframeview = null; |
92 | 94 |
private boolean isAcepted = false; |
93 | 95 |
private JPRotation rotation = null; |
94 |
private FFrameView newFFrameView = null; |
|
95 | 96 |
private javax.swing.JButton bGrid = null; |
96 | 97 |
private javax.swing.JCheckBox chbShowGrid = null; |
97 | 98 |
private JPanel pnlFirstRow = null; |
98 | 99 |
private JCheckBox chbSyncExtent = null; |
99 |
|
|
100 |
|
|
100 | 101 |
private WindowInfo windowInfo = null; |
101 | 102 |
|
102 | 103 |
private GridBagLayoutPanel pnlSyncGroup = null; |
... | ... | |
111 | 112 |
private JPanel pnlScale = null; |
112 | 113 |
private ViewDocument createdView = null; |
113 | 114 |
|
115 |
private FFrameView newFFrameView = null; |
|
116 |
private FFrameGrid fframeGrid = null; |
|
114 | 117 |
|
115 | 118 |
/** |
116 | 119 |
* This is the default constructor |
117 |
*
|
|
120 |
* |
|
118 | 121 |
* @param layoutPanel |
119 | 122 |
* Referencia al Layout. |
120 | 123 |
* @param fframe |
... | ... | |
123 | 126 |
public FFrameViewDialog(LayoutPanel layoutPanel, IFFrame frame) { |
124 | 127 |
super(layoutPanel, frame); |
125 | 128 |
fframeview = (FFrameView) frame; |
126 |
try { |
|
127 |
newFFrameView = (FFrameView) fframeview.clone(); |
|
128 |
} catch (CloneNotSupportedException e) { |
|
129 |
LOG.error("It is not possible to clone the object", e); |
|
130 |
} |
|
129 |
fframeGrid = (FFrameGrid) fframeview.getGrid(); |
|
131 | 130 |
initComponents(); |
132 | 131 |
layoutManager = (LayoutManager) ProjectManager.getInstance() |
133 | 132 |
.getDocumentManager("project.document.layout"); |
... | ... | |
152 | 151 |
c.gridy = row++; |
153 | 152 |
c.gridwidth = GridBagConstraints.REMAINDER; |
154 | 153 |
c.fill = GridBagConstraints.HORIZONTAL; |
155 |
|
|
154 |
|
|
156 | 155 |
GridBagLayoutPanel pnl = getPnlSyncGroup(); |
157 | 156 |
pnl.addComponent(getChbSyncLayers(), insets); |
158 | 157 |
pnl.addComponent(getChbSyncExtent(), insets); |
159 | 158 |
add(pnl, c); |
160 |
|
|
159 |
|
|
161 | 160 |
getGrpScaleType().add(getBtnNormalScale()); |
162 | 161 |
getGrpScaleType().add(getBtnFixedScale()); |
163 | 162 |
getGrpScaleType().add(getBtnFixedExtent()); |
164 |
|
|
163 |
|
|
165 | 164 |
pnl = getPnlScaleTypeGroup(); |
166 | 165 |
pnl.addComponent(getBtnNormalScale(), insets); |
167 | 166 |
pnl.addComponent(getPnlScale(), insets); // pnlScale() contains btnFixedScale |
... | ... | |
181 | 180 |
getBtnNormalScale().setSelected(true); |
182 | 181 |
setScaleType(SCALE_TYPE.NORMAL); |
183 | 182 |
} |
184 |
|
|
183 |
|
|
185 | 184 |
c.gridy = row++; |
186 | 185 |
add(pnl, c); |
187 |
|
|
186 |
|
|
188 | 187 |
c.fill = GridBagConstraints.NONE; |
189 | 188 |
c.gridx = 0; |
190 | 189 |
c.gridy = row++; |
... | ... | |
218 | 217 |
public void setRectangle(Rectangle2D r) { |
219 | 218 |
rect.setRect(r); |
220 | 219 |
} |
221 |
|
|
220 |
|
|
222 | 221 |
private JPanel getFirstRowPnl() { |
223 | 222 |
if (pnlFirstRow==null) { |
224 | 223 |
pnlFirstRow = new JPanel(new GridBagLayout()); |
... | ... | |
242 | 241 |
c.gridheight = 1; |
243 | 242 |
pnlFirstRow.add(getBtnConfigView(), c); |
244 | 243 |
} |
245 |
return pnlFirstRow;
|
|
244 |
return pnlFirstRow; |
|
246 | 245 |
} |
247 | 246 |
|
248 |
|
|
247 |
|
|
249 | 248 |
private JButton getBtnConfigView() { |
250 | 249 |
UsabilitySwingManager manager = org.gvsig.tools.swing.api.ToolsSwingLocator.getUsabilitySwingManager(); |
251 | 250 |
btConfigView = manager.createJButton(Messages.getText("Configure_view")); |
... | ... | |
264 | 263 |
|
265 | 264 |
/** |
266 | 265 |
* This method initializes lVistas |
267 |
*
|
|
266 |
* |
|
268 | 267 |
* @return javax.swing.JLabel |
269 | 268 |
*/ |
270 | 269 |
private javax.swing.JLabel getLViews() { |
... | ... | |
278 | 277 |
|
279 | 278 |
/** |
280 | 279 |
* This method initializes jScrollPane |
281 |
*
|
|
280 |
* |
|
282 | 281 |
* @return javax.swing.JScrollPane |
283 | 282 |
*/ |
284 | 283 |
private javax.swing.JScrollPane getScrolledViewList() { |
... | ... | |
292 | 291 |
|
293 | 292 |
/** |
294 | 293 |
* This method initializes liVistas |
295 |
*
|
|
294 |
* |
|
296 | 295 |
* @return javax.swing.JList |
297 | 296 |
*/ |
298 | 297 |
private javax.swing.JList getViewList() { |
299 | 298 |
if (liViews == null) { |
300 | 299 |
ListViewModel listmodel = new ListViewModel(); |
301 | 300 |
listmodel.addCreateNewViewObj(); |
302 |
|
|
301 |
|
|
303 | 302 |
if (listmodel.addViews()) { |
304 | 303 |
JOptionPane.showMessageDialog( |
305 | 304 |
ApplicationLocator.getManager().getRootComponent(), |
306 | 305 |
Messages.getText("_Some_views_excluded_from_list_because_have_editing_layers"), |
307 | 306 |
Messages.getText("propiedades_marco_vista"), |
308 |
JOptionPane.WARNING_MESSAGE);
|
|
307 |
JOptionPane.WARNING_MESSAGE); |
|
309 | 308 |
} |
310 |
|
|
309 |
|
|
311 | 310 |
liViews = new javax.swing.JList(); |
312 | 311 |
liViews.setModel(listmodel); |
313 | 312 |
// default value: create new view |
314 | 313 |
liViews.setSelectedIndex(0); |
315 |
viewSelected(); |
|
316 | 314 |
|
317 | 315 |
for (int i = 1; i < liViews.getModel().getSize(); i++) { |
318 | 316 |
if (fframeview.getMapContext() != null) { |
... | ... | |
331 | 329 |
} |
332 | 330 |
} |
333 | 331 |
|
334 |
liViews |
|
335 |
.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
336 |
public void valueChanged( |
|
337 |
javax.swing.event.ListSelectionEvent e) { |
|
338 |
FFrameViewDialog.this.viewSelected(); |
|
339 |
} |
|
340 |
}); |
|
341 | 332 |
} |
342 | 333 |
|
343 | 334 |
return liViews; |
344 | 335 |
} |
345 |
|
|
346 |
protected void viewSelected() { |
|
347 |
ViewDocument v = getSelectedView(); |
|
348 |
if (v!=m_projectView) { |
|
349 |
m_projectView = v; |
|
350 |
if (m_projectView!=null && m_projectView.getMapContext()!=null) { |
|
351 |
newFFrameView.setViewMapContext(m_projectView.getMapContext()); |
|
352 |
} |
|
353 |
else { |
|
354 |
newFFrameView.setViewMapContext(null); |
|
355 |
} |
|
356 |
} |
|
357 |
} |
|
358 | 336 |
|
359 | 337 |
protected ViewDocument getSelectedView() { |
360 | 338 |
Object selected = this.getViewList().getSelectedValue(); |
... | ... | |
372 | 350 |
} |
373 | 351 |
return view; |
374 | 352 |
} |
375 |
|
|
353 |
|
|
376 | 354 |
private ViewDocument createView() { |
377 | 355 |
ProjectManager projectManager = ApplicationLocator.getProjectManager(); |
378 | 356 |
ViewManager viewManager = (ViewManager) projectManager.getDocumentManager(ViewManager.TYPENAME); |
... | ... | |
380 | 358 |
ProjectManager.getInstance().getCurrentProject().addDocument(createdView); |
381 | 359 |
return createdView; |
382 | 360 |
} |
383 |
|
|
361 |
|
|
384 | 362 |
private void deleteView() { |
385 | 363 |
ProjectManager projectManager = ApplicationLocator.getProjectManager(); |
386 | 364 |
ProjectManager.getInstance().getCurrentProject().removeDocument(createdView); |
387 | 365 |
createdView = null; |
388 | 366 |
} |
389 |
|
|
390 | 367 |
|
368 |
|
|
391 | 369 |
/** |
392 | 370 |
* This method initializes chbEnlaceVivo |
393 |
*
|
|
371 |
* |
|
394 | 372 |
* @return javax.swing.JCheckBox |
395 | 373 |
*/ |
396 | 374 |
private javax.swing.JCheckBox getChbSyncLayers() { |
... | ... | |
408 | 386 |
JOptionPane.WARNING_MESSAGE); |
409 | 387 |
} |
410 | 388 |
} |
411 |
|
|
389 |
|
|
412 | 390 |
}); |
413 | 391 |
} |
414 | 392 |
|
415 | 393 |
return chbSyncLayers; |
416 | 394 |
} |
417 |
|
|
395 |
|
|
418 | 396 |
private javax.swing.JCheckBox getChbSyncExtent() { |
419 | 397 |
if (chbSyncExtent==null) { |
420 | 398 |
chbSyncExtent = new javax.swing.JCheckBox(); |
... | ... | |
423 | 401 |
} |
424 | 402 |
return chbSyncExtent; |
425 | 403 |
} |
426 |
|
|
404 |
|
|
427 | 405 |
protected void disableChbSyncExtent() { |
428 | 406 |
getChbSyncExtent().setEnabled(false); |
429 | 407 |
getChbSyncExtent().setToolTipText(Messages.getText("Extent_cant_be_synchronized_when_using_fixed_scale_or_fixed_extent")); |
430 | 408 |
} |
431 |
|
|
409 |
|
|
432 | 410 |
protected void enableChbSyncExtent() { |
433 | 411 |
getChbSyncExtent().setEnabled(true); |
434 | 412 |
getChbSyncExtent().setToolTipText(null); |
... | ... | |
436 | 414 |
|
437 | 415 |
/** |
438 | 416 |
* This method initializes jButton |
439 |
*
|
|
417 |
* |
|
440 | 418 |
* @return javax.swing.JButton |
441 | 419 |
*/ |
442 | 420 |
private javax.swing.JButton getbAceptar() { |
... | ... | |
446 | 424 |
bAceptar.addActionListener(new java.awt.event.ActionListener() { |
447 | 425 |
|
448 | 426 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
449 |
newFFrameView.setBoundBox(FLayoutUtilities.toSheetRect( |
|
427 |
newFFrameView = |
|
428 |
(FFrameView) layoutManager.createFrame(FFrameView.PERSISTENCE_DEFINITION_NAME); |
|
429 |
newFFrameView.setLayoutContext(fframeview.getLayoutContext()); |
|
430 |
|
|
431 |
ViewDocument v = getSelectedView(); |
|
432 |
newFFrameView.setView(v); |
|
433 |
|
|
434 |
newFFrameView.setBoundBox(FLayoutUtilities.toSheetRect( |
|
450 | 435 |
rect, layoutPanel.getLayoutControl().getAT())); |
451 | 436 |
newFFrameView.setRotation(getPRotation().getRotation()); |
452 | 437 |
newFFrameView.setHasToc(true); |
... | ... | |
490 | 475 |
.toSheetRect(rect, layoutPanel |
491 | 476 |
.getLayoutControl().getAT())); |
492 | 477 |
} |
478 |
if (fframeGrid!=null){ |
|
479 |
fframeGrid.setFFrameDependence(newFFrameView); |
|
480 |
} |
|
493 | 481 |
isAcepted = true; |
494 | 482 |
ApplicationLocator.getManager().getUIManager().closeWindow( |
495 | 483 |
FFrameViewDialog.this); |
496 | 484 |
notifyDialogClosed(); |
497 | 485 |
PluginsLocator.getMainFrame().refreshControls(); |
498 | 486 |
layoutPanel.getLayoutControl().setDefaultTool(); |
487 |
|
|
488 |
fireActionEvent(new ActionEvent(FFrameViewDialog.this, 1, "accept")); |
|
499 | 489 |
} |
500 | 490 |
}); |
501 | 491 |
} |
... | ... | |
505 | 495 |
|
506 | 496 |
/** |
507 | 497 |
* This method initializes bCancelar |
508 |
*
|
|
498 |
* |
|
509 | 499 |
* @return javax.swing.JButton |
510 | 500 |
*/ |
511 | 501 |
private javax.swing.JButton getBCancelar() { |
... | ... | |
517 | 507 |
if (createdView!=null) { |
518 | 508 |
deleteView(); |
519 | 509 |
} |
520 |
newFFrameView = null; |
|
521 | 510 |
ApplicationLocator.getManager().getUIManager().closeWindow( |
522 | 511 |
FFrameViewDialog.this); |
523 | 512 |
notifyDialogClosed(); |
... | ... | |
530 | 519 |
|
531 | 520 |
/** |
532 | 521 |
* This method initializes lCalidad |
533 |
*
|
|
522 |
* |
|
534 | 523 |
* @return javax.swing.JLabel |
535 | 524 |
*/ |
536 | 525 |
private javax.swing.JLabel getLCalidad() { |
... | ... | |
544 | 533 |
|
545 | 534 |
/** |
546 | 535 |
* This method initializes cbCalidad |
547 |
*
|
|
536 |
* |
|
548 | 537 |
* @return javax.swing.JComboBox |
549 | 538 |
*/ |
550 | 539 |
private javax.swing.JComboBox getCbCalidad() { |
... | ... | |
561 | 550 |
|
562 | 551 |
/* |
563 | 552 |
* (non-Javadoc) |
564 |
*
|
|
553 |
* |
|
565 | 554 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
566 | 555 |
*/ |
567 | 556 |
public WindowInfo getWindowInfo() { |
... | ... | |
584 | 573 |
|
585 | 574 |
/** |
586 | 575 |
* This method initializes rotation |
587 |
*
|
|
576 |
* |
|
588 | 577 |
* @return javax.swing.JPanel |
589 | 578 |
*/ |
590 | 579 |
private JPRotation getPRotation() { |
... | ... | |
601 | 590 |
|
602 | 591 |
/** |
603 | 592 |
* This method initializes bGrid |
604 |
*
|
|
593 |
* |
|
605 | 594 |
* @return javax.swing.JButton |
606 | 595 |
*/ |
607 | 596 |
private JButton getBGrid() { |
... | ... | |
610 | 599 |
bGrid.setText(Messages.getText("configurar")); |
611 | 600 |
bGrid.addActionListener(new java.awt.event.ActionListener() { |
612 | 601 |
|
613 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
614 |
FFrameGrid fframeGrid = null; |
|
602 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
615 | 603 |
|
616 |
if (newFFrameView.getGrid() != null) { |
|
617 |
fframeGrid = (FFrameGrid) newFFrameView.getGrid(); |
|
618 |
} else { |
|
619 |
fframeGrid = (FFrameGrid) layoutManager.createFrame(FFrameGrid.PERSISTENCE_DEFINITION_NAME); |
|
620 |
fframeGrid.setFFrameDependence(fframeview); |
|
604 |
if(fframeGrid == null) { |
|
605 |
fframeGrid = (FFrameGrid) layoutManager.createFrame(FFrameGrid.PERSISTENCE_DEFINITION_NAME); |
|
621 | 606 |
} |
622 | 607 |
|
623 |
FFrameGridDialog fframeGridDialog =
|
|
608 |
FFrameGridDialog fframeGridDialog = |
|
624 | 609 |
(FFrameGridDialog)layoutManager.createFFrameDialog(fframeGrid, layoutPanel); |
625 |
fframeGridDialog.setFFrameView(newFFrameView); |
|
626 |
|
|
610 |
|
|
627 | 611 |
if (fframeGridDialog != null) { |
612 |
fframeGridDialog.setMapContext(getSelectedView().getMapContext()); |
|
613 |
fframeGridDialog.setFrameRotation(getPRotation().getRotation()); |
|
628 | 614 |
ApplicationLocator.getManager().getUIManager().addWindow(fframeGridDialog); |
629 | 615 |
} |
630 |
IFFrame newFrame = fframeGridDialog.getFFrame(); |
|
631 |
if (newFrame != null) { |
|
632 |
newFFrameView.setGrid(newFrame); |
|
633 |
} |
|
616 |
fframeGrid = (FFrameGrid) fframeGridDialog.getFFrame(); |
|
634 | 617 |
} |
635 | 618 |
}); |
636 | 619 |
} |
637 | 620 |
return bGrid; |
638 | 621 |
} |
639 |
|
|
622 |
|
|
640 | 623 |
/** |
641 | 624 |
* This method initializes chbShowGrid |
642 |
*
|
|
625 |
* |
|
643 | 626 |
* @return javax.swing.JCheckBox |
644 | 627 |
*/ |
645 | 628 |
private JCheckBox getChbShowGrid() { |
... | ... | |
653 | 636 |
if (e.getSource() instanceof JCheckBox) { |
654 | 637 |
JCheckBox cb = (JCheckBox) e.getSource(); |
655 | 638 |
if (cb.isSelected()) { |
656 |
if (newFFrameView.getGrid()==null) {
|
|
639 |
if (fframeGrid==null) {
|
|
657 | 640 |
// ensure we have a non-null grid if the checkbox is selected |
658 |
FFrameGrid fframeGrid = (FFrameGrid) layoutManager.createFrame(FFrameGrid.PERSISTENCE_DEFINITION_NAME); |
|
659 |
fframeGrid.setFFrameDependence(newFFrameView); |
|
660 |
newFFrameView.setGrid(fframeGrid); |
|
641 |
FFrameGrid fframeGrid = (FFrameGrid) layoutManager.createFrame(FFrameGrid.PERSISTENCE_DEFINITION_NAME); |
|
661 | 642 |
} |
662 | 643 |
} |
663 | 644 |
} |
... | ... | |
666 | 647 |
} |
667 | 648 |
return chbShowGrid; |
668 | 649 |
} |
669 |
|
|
650 |
|
|
670 | 651 |
private GridBagLayoutPanel getPnlSyncGroup() { |
671 | 652 |
if (pnlSyncGroup ==null) { |
672 | 653 |
pnlSyncGroup = new GridBagLayoutPanel(); |
... | ... | |
674 | 655 |
} |
675 | 656 |
return pnlSyncGroup; |
676 | 657 |
} |
677 |
|
|
658 |
|
|
678 | 659 |
private GridBagLayoutPanel getPnlScaleTypeGroup() { |
679 | 660 |
if (pnlScaleTypeGroup ==null) { |
680 | 661 |
pnlScaleTypeGroup = new GridBagLayoutPanel(); |
... | ... | |
682 | 663 |
} |
683 | 664 |
return pnlScaleTypeGroup; |
684 | 665 |
} |
685 |
|
|
666 |
|
|
686 | 667 |
private ButtonGroup getGrpScaleType() { |
687 | 668 |
if (grpScaleType==null) { |
688 | 669 |
grpScaleType = new ButtonGroup(); |
689 | 670 |
} |
690 | 671 |
return grpScaleType; |
691 | 672 |
} |
692 |
|
|
673 |
|
|
693 | 674 |
private JRadioButton getBtnNormalScale() { |
694 | 675 |
if (btnNormalScale==null) { |
695 | 676 |
btnNormalScale = new JRadioButton(Messages.getText("Non_fixed")); |
... | ... | |
702 | 683 |
} |
703 | 684 |
return btnNormalScale; |
704 | 685 |
} |
705 |
|
|
686 |
|
|
706 | 687 |
private JRadioButton getBtnFixedScale() { |
707 | 688 |
if (btnFixedScale==null) { |
708 | 689 |
btnFixedScale = new JRadioButton(Messages.getText("Fixed_scale")); |
... | ... | |
715 | 696 |
} |
716 | 697 |
return btnFixedScale; |
717 | 698 |
} |
718 |
|
|
699 |
|
|
719 | 700 |
private JPanel getPnlScale() { |
720 | 701 |
if (pnlScale==null) { |
721 | 702 |
pnlScale = new JPanel(new GridBagLayout()); |
... | ... | |
735 | 716 |
} |
736 | 717 |
return pnlScale; |
737 | 718 |
} |
738 |
|
|
719 |
|
|
739 | 720 |
private JTextField getFldScale() { |
740 | 721 |
if (fldScale==null) { |
741 | 722 |
fldScale = new JTextField(8); |
... | ... | |
747 | 728 |
} |
748 | 729 |
return fldScale; |
749 | 730 |
} |
750 |
|
|
731 |
|
|
751 | 732 |
private JLabel getLblScale() { |
752 | 733 |
return new JLabel(Messages.getText("1__")); |
753 | 734 |
} |
754 |
|
|
735 |
|
|
755 | 736 |
private JRadioButton getBtnFixedExtent() { |
756 | 737 |
if (btnFixedExtent==null) { |
757 | 738 |
btnFixedExtent = new JRadioButton(Messages.getText("Fixed_extent")); |
... | ... | |
764 | 745 |
} |
765 | 746 |
return btnFixedExtent; |
766 | 747 |
} |
767 |
|
|
748 |
|
|
768 | 749 |
private EnvelopePanel getPnlExtent() { |
769 | 750 |
if (pnlExtent==null) { |
770 | 751 |
pnlExtent = new EnvelopePanel(); |
... | ... | |
784 | 765 |
public Object getWindowModel() { |
785 | 766 |
return fframeview; |
786 | 767 |
} |
787 |
|
|
768 |
|
|
788 | 769 |
protected void setScaleType(SCALE_TYPE type) { |
789 | 770 |
if (type==SCALE_TYPE.NORMAL) { |
790 | 771 |
getFldScale().setEditable(false); |
... | ... | |
804 | 785 |
getPnlExtent().setEditable(true); |
805 | 786 |
getPnlExtent().setEnabled(true); |
806 | 787 |
} |
807 |
|
|
788 |
|
|
808 | 789 |
} |
809 |
|
|
790 |
|
|
810 | 791 |
protected SCALE_TYPE getSelectedScaleType() { |
811 | 792 |
if (getBtnFixedScale().isSelected()) { |
812 | 793 |
return SCALE_TYPE.FIXED_SCALE; |
... | ... | |
814 | 795 |
else if (getBtnFixedExtent().isSelected()) { |
815 | 796 |
return SCALE_TYPE.FIXED_EXTENT; |
816 | 797 |
} |
817 |
return SCALE_TYPE.NORMAL;
|
|
798 |
return SCALE_TYPE.NORMAL; |
|
818 | 799 |
} |
819 | 800 |
|
801 |
|
|
820 | 802 |
} // @jve:decl-index=0:visual-constraint="10,10" |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/gui/dialogs/FFrameGraphicsDialog.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import org.slf4j.Logger; |
30 | 30 |
import org.slf4j.LoggerFactory; |
31 |
|
|
31 | 32 |
import org.gvsig.andami.PluginServices; |
32 | 33 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
33 | 34 |
import org.gvsig.app.gui.styling.SymbolSelector; |
35 |
import org.gvsig.app.project.documents.layout.LayoutContext; |
|
34 | 36 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGraphics; |
35 | 37 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
36 | 38 |
import org.gvsig.app.project.documents.layout.fframes.gui.JPRotation; |
... | ... | |
39 | 41 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
40 | 42 |
import org.gvsig.tools.observer.ObservableHelper; |
41 | 43 |
import org.gvsig.tools.observer.Observer; |
44 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
42 | 45 |
|
43 | 46 |
/** |
44 | 47 |
* Di?logo de las propiedades de los gr?ficos. |
45 |
*
|
|
48 |
* |
|
46 | 49 |
* @author Vicente Caballero Navarro |
47 | 50 |
*/ |
48 | 51 |
public class FFrameGraphicsDialog extends SymbolSelector implements |
... | ... | |
54 | 57 |
.getLogger(FFrameGraphicsDialog.class); |
55 | 58 |
|
56 | 59 |
private Rectangle2D rect = new Rectangle2D.Double(); |
57 |
private LayoutPanel m_layout = null;
|
|
60 |
private LayoutPanel m_layout = null; |
|
58 | 61 |
|
59 | 62 |
private boolean isAcepted = false; |
60 | 63 |
private FFrameGraphics fframegraphics = null; |
... | ... | |
62 | 65 |
private FFrameGraphics newFFrameGraphics; |
63 | 66 |
private ObservableHelper observableHelper = new ObservableHelper(); |
64 | 67 |
|
68 |
private ActionListenerSupport actionListenerSupportHelper; |
|
65 | 69 |
|
66 | 70 |
public FFrameGraphicsDialog(LayoutPanel layout, FFrameGraphics fframe) { |
67 | 71 |
super(fframe.getFSymbol(), fframe.getType(), null, true); |
... | ... | |
95 | 99 |
} |
96 | 100 |
} |
97 | 101 |
}; |
98 |
|
|
102 |
|
|
99 | 103 |
ActionListener cancelAction = new ActionListener() { |
100 | 104 |
public void actionPerformed(ActionEvent e) { |
101 | 105 |
isAcepted = false; |
102 | 106 |
FFrameGraphicsDialog.this.notifyDialogClosed(); |
103 | 107 |
} |
104 | 108 |
}; |
105 |
|
|
109 |
|
|
106 | 110 |
okCancelPanel.addOkButtonActionListener(okAction); |
107 | 111 |
okCancelPanel.addCancelButtonActionListener(cancelAction); |
108 | 112 |
} |
... | ... | |
121 | 125 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG); |
122 | 126 |
m_viewinfo |
123 | 127 |
.setTitle(PluginServices.getText(this, "propiedades_grafico")); |
124 |
|
|
128 |
|
|
125 | 129 |
m_viewinfo.setWidth(650); |
126 | 130 |
m_viewinfo.setHeight(625); |
127 |
|
|
128 | 131 |
|
132 |
|
|
129 | 133 |
return m_viewinfo; |
130 | 134 |
} |
131 | 135 |
|
... | ... | |
147 | 151 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated() |
148 | 152 |
*/ |
149 | 153 |
public void viewActivated() { |
150 |
|
|
154 |
|
|
151 | 155 |
} |
152 | 156 |
|
153 | 157 |
/** |
154 | 158 |
* This method initializes pRotation |
155 |
*
|
|
159 |
* |
|
156 | 160 |
* @return javax.swing.JPanel |
157 | 161 |
*/ |
158 | 162 |
private JPRotation getPRotation() { |
... | ... | |
166 | 170 |
public IFFrame getFFrame() { |
167 | 171 |
return newFFrameGraphics; |
168 | 172 |
} |
169 |
|
|
170 | 173 |
|
174 |
|
|
171 | 175 |
public void addObserver(Observer observer) { |
172 | 176 |
observableHelper.addObserver(observer); |
173 | 177 |
} |
... | ... | |
179 | 183 |
public void deleteObservers() { |
180 | 184 |
observableHelper.deleteObservers(); |
181 | 185 |
} |
182 |
|
|
186 |
|
|
183 | 187 |
protected void notifyDialogClosed() { |
184 | 188 |
observableHelper.notifyObservers(this, new FFrameDialogNotification(FFrameDialogNotification.DIALOG_CLOSED)); |
185 | 189 |
} |
186 |
} |
|
190 |
|
|
191 |
@Override |
|
192 |
public void addActionListener(ActionListener listener) { |
|
193 |
actionListenerSupportHelper.addActionListener(listener); |
|
194 |
|
|
195 |
} |
|
196 |
|
|
197 |
@Override |
|
198 |
public ActionListener[] getActionListeners() { |
|
199 |
return actionListenerSupportHelper.getActionListeners(); |
|
200 |
} |
|
201 |
|
|
202 |
@Override |
|
203 |
public void removeActionListener(ActionListener listener) { |
|
204 |
actionListenerSupportHelper.removeActionListener(listener); |
|
205 |
|
|
206 |
} |
|
207 |
|
|
208 |
@Override |
|
209 |
public void removeAllActionListener() { |
|
210 |
actionListenerSupportHelper.removeAllActionListener(); |
|
211 |
|
|
212 |
} |
|
213 |
|
|
214 |
@Override |
|
215 |
public void fireActionEvent(ActionEvent event) { |
|
216 |
actionListenerSupportHelper.fireActionEvent(event); |
|
217 |
} |
|
218 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/gui/dialogs/AbstractFFrameDialog.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.app.project.documents.layout.fframes.gui.dialogs; |
23 | 23 |
|
24 |
import java.awt.event.ActionEvent; |
|
25 |
import java.awt.event.ActionListener; |
|
26 |
|
|
24 | 27 |
import javax.swing.JPanel; |
25 | 28 |
|
26 | 29 |
import org.slf4j.Logger; |
27 | 30 |
import org.slf4j.LoggerFactory; |
31 |
|
|
28 | 32 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
29 | 33 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
30 | 34 |
import org.gvsig.tools.observer.ObservableHelper; |
31 | 35 |
import org.gvsig.tools.observer.Observer; |
36 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
37 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
32 | 38 |
|
33 | 39 |
/** |
34 | 40 |
* @author gvSIG Team |
35 | 41 |
* @version $Id$ |
36 |
*
|
|
42 |
* |
|
37 | 43 |
*/ |
38 | 44 |
public abstract class AbstractFFrameDialog extends JPanel implements |
39 | 45 |
IFFrameDialog { |
... | ... | |
47 | 53 |
protected IFFrame frame = null; |
48 | 54 |
private ObservableHelper observableHelper = new ObservableHelper(); |
49 | 55 |
|
56 |
private ActionListenerSupport actionListenerSupportHelper; |
|
57 |
|
|
50 | 58 |
public AbstractFFrameDialog(LayoutPanel layoutPanel, IFFrame frame) { |
51 | 59 |
super(); |
52 | 60 |
this.layoutPanel = layoutPanel; |
53 | 61 |
this.frame = frame; |
62 |
this.actionListenerSupportHelper = ToolsSwingLocator.getToolsSwingManager().createActionListenerSupport(); |
|
54 | 63 |
} |
55 | 64 |
|
56 | 65 |
public void addObserver(Observer observer) { |
... | ... | |
68 | 77 |
protected void notifyDialogClosed() { |
69 | 78 |
observableHelper.notifyObservers(this, new FFrameDialogNotification(FFrameDialogNotification.DIALOG_CLOSED)); |
70 | 79 |
} |
80 |
|
|
81 |
@Override |
|
82 |
public void addActionListener(ActionListener listener) { |
|
83 |
actionListenerSupportHelper.addActionListener(listener); |
|
84 |
|
|
85 |
} |
|
86 |
|
|
87 |
@Override |
|
88 |
public ActionListener[] getActionListeners() { |
|
89 |
return actionListenerSupportHelper.getActionListeners(); |
|
90 |
} |
|
91 |
|
|
92 |
@Override |
|
93 |
public void removeActionListener(ActionListener listener) { |
|
94 |
actionListenerSupportHelper.removeActionListener(listener); |
|
95 |
|
|
96 |
} |
|
97 |
|
|
98 |
@Override |
|
99 |
public void removeAllActionListener() { |
|
100 |
actionListenerSupportHelper.removeAllActionListener(); |
|
101 |
|
|
102 |
} |
|
103 |
|
|
104 |
@Override |
|
105 |
public void fireActionEvent(ActionEvent event) { |
|
106 |
actionListenerSupportHelper.fireActionEvent(event); |
|
107 |
} |
|
71 | 108 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/gui/dialogs/FFrameGridDialog.java | ||
---|---|---|
46 | 46 |
import org.gvsig.app.gui.panels.ColorChooserPanel; |
47 | 47 |
import org.gvsig.app.gui.utils.FontChooser; |
48 | 48 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGrid; |
49 |
import org.gvsig.app.project.documents.layout.fframes.FFrameView; |
|
50 | 49 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
51 | 50 |
import org.gvsig.app.project.documents.layout.fframes.gui.numberFormat.DecimalFormatDialog; |
52 | 51 |
import org.gvsig.app.project.documents.layout.fframes.gui.numberFormat.DecimalFormatPanel; |
... | ... | |
85 | 84 |
private ColorChooserPanel colorChooserPanel = null; |
86 | 85 |
|
87 | 86 |
private FFrameGrid fframegrid; |
88 |
private FFrameView fframeview; |
|
87 |
// private FFrameView fframeview;
|
|
89 | 88 |
private AcceptCancelPanel accept; |
90 | 89 |
private FFrameGrid newFFrameGrid; |
91 | 90 |
// private Color textcolor; |
... | ... | |
99 | 98 |
private JPanel pnlDistance = null; |
100 | 99 |
private JRadioButton rbDistance = null; |
101 | 100 |
private JButton btnNumberFormat = null; |
102 |
private JNumberSpinner nfRotationHoriz = null;
|
|
101 |
private JNumberSpinner nfRotationHoriz = null; |
|
103 | 102 |
private JNumberSpinner nfRotationVert = null; |
104 | 103 |
private ButtonGroup btGrpInterval = null; |
105 | 104 |
private static final Insets defaultInsets = new Insets(4, 4, 4, 4); |
106 | 105 |
private DecimalFormat format = new DecimalFormat(); |
107 | 106 |
private SimpleComboBox cbLblAnchor=null; |
107 |
private MapContext mapContext; |
|
108 |
private double frameRotation; |
|
108 | 109 |
|
109 | 110 |
public FFrameGridDialog(LayoutPanel layout, FFrameGrid fframe) { |
110 | 111 |
super(layout, fframe); |
... | ... | |
114 | 115 |
|
115 | 116 |
/** |
116 | 117 |
* This method initializes this |
117 |
*
|
|
118 |
* |
|
118 | 119 |
* @return void |
119 | 120 |
*/ |
120 | 121 |
private void initialize() { |
... | ... | |
125 | 126 |
|
126 | 127 |
/** |
127 | 128 |
* This method initializes jPanel1 |
128 |
*
|
|
129 |
* |
|
129 | 130 |
* @return javax.swing.JPanel |
130 | 131 |
*/ |
131 | 132 |
private JPanel getPnlMain() { |
... | ... | |
143 | 144 |
c.gridx = 1; |
144 | 145 |
c.fill = GridBagConstraints.NONE; |
145 | 146 |
pnlMain.add(getPnlSymbologyGroup(), c); |
146 |
|
|
147 |
|
|
147 | 148 |
c.gridy = row++; |
148 | 149 |
c.gridx = 0; |
149 | 150 |
c.gridwidth = 2; |
... | ... | |
156 | 157 |
|
157 | 158 |
/** |
158 | 159 |
* This method initializes txtIntervalX |
159 |
*
|
|
160 |
* |
|
160 | 161 |
* @return javax.swing.JTextField |
161 | 162 |
*/ |
162 | 163 |
private JTextField getTxtIntervalX() { |
... | ... | |
170 | 171 |
|
171 | 172 |
/** |
172 | 173 |
* This method initializes jPanel6 |
173 |
*
|
|
174 |
* |
|
174 | 175 |
* @return javax.swing.JPanel |
175 | 176 |
*/ |
176 | 177 |
private JPanel getPnlIntervalGroup() { |
... | ... | |
178 | 179 |
pnlIntervalGroup = new JPanel(new GridBagLayout()); |
179 | 180 |
pnlIntervalGroup.setBorder(BorderFactory.createTitledBorder(Messages.getText( "Interval"))); |
180 | 181 |
GridBagConstraints c = new GridBagConstraints(); |
181 |
|
|
182 |
|
|
182 | 183 |
c.anchor = GridBagConstraints.FIRST_LINE_START; |
183 | 184 |
c.gridx = 0; |
184 | 185 |
c.insets = defaultInsets; |
185 | 186 |
int row = 0; |
186 | 187 |
c.gridy = row++; |
187 | 188 |
c.gridwidth = 2; |
188 |
pnlIntervalGroup.add(getRbDistance(), c);
|
|
189 |
pnlIntervalGroup.add(getRbDistance(), c); |
|
189 | 190 |
c.gridx = 0; |
190 | 191 |
c.gridwidth = 2; |
191 | 192 |
c.gridy = row++; |
192 | 193 |
c.insets = new Insets(defaultInsets.top, 25, defaultInsets.bottom, defaultInsets.right); |
193 | 194 |
pnlIntervalGroup.add(getPnlDistance(), c); |
194 |
|
|
195 |
|
|
195 | 196 |
c.gridx = 0; |
196 | 197 |
c.gridy = row++; |
197 | 198 |
c.insets = defaultInsets; |
... | ... | |
199 | 200 |
pnlIntervalGroup.add(getRbHorizDiv(), c); |
200 | 201 |
c.gridx = 1; |
201 | 202 |
pnlIntervalGroup.add(getTfNumDivHoriz(), c); |
202 |
|
|
203 |
|
|
203 | 204 |
c.gridy = row++; |
204 | 205 |
c.gridx = 0; |
205 | 206 |
pnlIntervalGroup.add(getRbVertDiv(), c); |
... | ... | |
211 | 212 |
} |
212 | 213 |
return pnlIntervalGroup; |
213 | 214 |
} |
214 |
|
|
215 |
|
|
215 | 216 |
private JRadioButton getRbHorizDiv() { |
216 | 217 |
if (rbHorizDiv==null) { |
217 | 218 |
rbHorizDiv = new JRadioButton(Messages.getText("Number_of_horizontal_divisions")); |
... | ... | |
219 | 220 |
} |
220 | 221 |
return rbHorizDiv; |
221 | 222 |
} |
222 |
|
|
223 |
|
|
223 | 224 |
private JRadioButton getRbVertDiv() { |
224 | 225 |
if (rbVertDiv==null) { |
225 | 226 |
rbVertDiv = new JRadioButton(Messages.getText("Number_of_vertical_divisions")); |
... | ... | |
227 | 228 |
} |
228 | 229 |
return rbVertDiv; |
229 | 230 |
} |
230 |
|
|
231 |
|
|
231 | 232 |
private JRadioButton getRbDistance() { |
232 | 233 |
if (rbDistance==null) { |
233 | 234 |
rbDistance = new JRadioButton(Messages.getText("Distance")); |
... | ... | |
235 | 236 |
} |
236 | 237 |
return rbDistance; |
237 | 238 |
} |
238 |
|
|
239 |
|
|
239 | 240 |
private JPanel getPnlDistance() { |
240 | 241 |
if (pnlDistance==null) { |
241 | 242 |
pnlDistance = new JPanel(new GridBagLayout()); |
242 | 243 |
GridBagConstraints c = new GridBagConstraints(); |
243 |
|
|
244 |
|
|
244 | 245 |
int row = 0; |
245 | 246 |
c.insets = new Insets(0, 0, 4, 4); |
246 | 247 |
c.gridy = row++; |
... | ... | |
255 | 256 |
c.insets = new Insets(0, 4, 4, 0); |
256 | 257 |
c.gridx = 2; |
257 | 258 |
pnlDistance.add(lblUnitsX, c); |
258 |
|
|
259 |
|
|
259 | 260 |
c.insets = new Insets(4, 0, 0, 4); |
260 | 261 |
c.gridy = row++; |
261 | 262 |
c.gridx = 0; |
... | ... | |
268 | 269 |
c.gridx = 2; |
269 | 270 |
c.insets = new Insets(4, 4, 0, 0); |
270 | 271 |
pnlDistance.add(lblUnitsY, c); |
271 |
|
|
272 |
|
|
272 | 273 |
} |
273 | 274 |
return pnlDistance; |
274 | 275 |
} |
275 |
|
|
276 |
|
|
276 | 277 |
private ButtonGroup getBtnGrpInterval() { |
277 | 278 |
if (btGrpInterval==null) { |
278 | 279 |
btGrpInterval = new ButtonGroup(); |
279 | 280 |
} |
280 | 281 |
return btGrpInterval; |
281 | 282 |
} |
282 |
|
|
283 |
|
|
283 | 284 |
private NumberTextField getTfNumDivHoriz() { |
284 | 285 |
if (tfNumDivHoriz==null) { |
285 | 286 |
tfNumDivHoriz = new NumberTextField(3); |
... | ... | |
296 | 297 |
return tfNumDivHoriz; |
297 | 298 |
} |
298 | 299 |
protected void calculateDistance(int axis, int numDivisions) { |
299 |
if (fframeview!=null && |
|
300 |
fframeview.getMapContext().getViewPort().getAdjustedEnvelope()!=null) { |
|
301 |
Envelope env = fframeview.getMapContext().getViewPort().getAdjustedEnvelope(); |
|
300 |
if (mapContext.getViewPort().getAdjustedEnvelope()!=null) { |
|
301 |
Envelope env = mapContext.getViewPort().getAdjustedEnvelope(); |
|
302 | 302 |
double interval = IntervalUtils.roundIntervalDivision(env.getLength(axis), numDivisions); |
303 | 303 |
getTxtIntervalX().setText(String.valueOf(interval)); |
304 | 304 |
getTxtIntervalY().setText(String.valueOf(interval)); |
305 | 305 |
} |
306 | 306 |
} |
307 |
|
|
307 |
|
|
308 | 308 |
private NumberTextField getTfNumDivVert() { |
309 | 309 |
if (tfNumDivVert==null) { |
310 | 310 |
tfNumDivVert = new NumberTextField(3); |
... | ... | |
323 | 323 |
|
324 | 324 |
/** |
325 | 325 |
* This method initializes txtIntervalY |
326 |
*
|
|
326 |
* |
|
327 | 327 |
* @return javax.swing.JTextField |
328 | 328 |
*/ |
329 | 329 |
private JTextField getTxtIntervalY() { |
... | ... | |
336 | 336 |
|
337 | 337 |
/** |
338 | 338 |
* This method initializes jPanel8 |
339 |
*
|
|
339 |
* |
|
340 | 340 |
* @return javax.swing.JPanel |
341 | 341 |
*/ |
342 | 342 |
private JPanel getPnlSymbologyGroup() { |
343 | 343 |
if (jPanel8 == null) { |
344 | 344 |
jPanel8 = new JPanel(new GridBagLayout()); |
345 |
GridBagConstraints c = new GridBagConstraints();
|
|
345 |
GridBagConstraints c = new GridBagConstraints(); |
|
346 | 346 |
|
347 | 347 |
jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder( |
348 | 348 |
Messages.getText("Simbologia"))); |
... | ... | |
359 | 359 |
|
360 | 360 |
/** |
361 | 361 |
* This method initializes jPanel9 |
362 |
*
|
|
362 |
* |
|
363 | 363 |
* @return javax.swing.JPanel |
364 | 364 |
*/ |
365 | 365 |
private JPanel getJPanel9() { |
366 | 366 |
if (jPanel9 == null) { |
367 | 367 |
jPanel9 = new JPanel(new GridBagLayout()); |
368 |
GridBagConstraints c = new GridBagConstraints();
|
|
368 |
GridBagConstraints c = new GridBagConstraints(); |
|
369 | 369 |
c.gridx = 0; |
370 | 370 |
c.gridy = 0; |
371 | 371 |
c.anchor = GridBagConstraints.FIRST_LINE_START; |
... | ... | |
381 | 381 |
|
382 | 382 |
/** |
383 | 383 |
* This method initializes rbPoints |
384 |
*
|
|
384 |
* |
|
385 | 385 |
* @return javax.swing.JRadioButton |
386 | 386 |
*/ |
387 | 387 |
private JRadioButton getRbPoints() { |
... | ... | |
396 | 396 |
|
397 | 397 |
/** |
398 | 398 |
* This method initializes rbLines |
399 |
*
|
|
399 |
* |
|
400 | 400 |
* @return javax.swing.JRadioButton |
401 | 401 |
*/ |
402 | 402 |
private JRadioButton getRbLines() { |
... | ... | |
411 | 411 |
|
412 | 412 |
/** |
413 | 413 |
* This method initializes bSymbol |
414 |
*
|
|
414 |
* |
|
415 | 415 |
* @return javax.swing.JButton |
416 | 416 |
*/ |
417 | 417 |
private JButton getBSymbol() { |
... | ... | |
439 | 439 |
|
440 | 440 |
/** |
441 | 441 |
* This method initializes jPanel10 |
442 |
*
|
|
442 |
* |
|
443 | 443 |
* @return javax.swing.JPanel |
444 | 444 |
*/ |
445 | 445 |
private JPanel getPnlLabelGroup() { |
... | ... | |
447 | 447 |
pnlLabelGroup = new JPanel(new GridBagLayout()); |
448 | 448 |
pnlLabelGroup.setBorder(BorderFactory.createTitledBorder( |
449 | 449 |
Messages.getText("Label"))); |
450 |
|
|
450 |
|
|
451 | 451 |
GridBagConstraints c = new GridBagConstraints(); |
452 | 452 |
int row = 0; |
453 |
|
|
453 |
|
|
454 | 454 |
c.insets = defaultInsets; |
455 | 455 |
c.gridx = 0; |
456 | 456 |
c.gridy = row++; |
... | ... | |
459 | 459 |
pnlLabelGroup.add(new JLabel(Messages.getText("Number_format")), c); |
460 | 460 |
c.gridx = 1; |
461 | 461 |
pnlLabelGroup.add(getBtnNumberFormat(), c); |
462 |
|
|
462 |
|
|
463 | 463 |
c.gridx = 0; |
464 | 464 |
c.gridy = row++; |
465 | 465 |
c.gridwidth = 1; |
466 | 466 |
pnlLabelGroup.add(new JLabel(Messages.getText("Horizontal_label_rotation")), c); |
467 | 467 |
c.gridx = 1; |
468 | 468 |
pnlLabelGroup.add(getNfRotationHoriz(), c); |
469 |
|
|
469 |
|
|
470 | 470 |
c.gridy = row++; |
471 | 471 |
c.gridx = 0; |
472 | 472 |
pnlLabelGroup.add(new JLabel(Messages.getText("Vertical_label_rotation")), c); |
473 | 473 |
c.gridx = 1; |
474 | 474 |
pnlLabelGroup.add(getNfRotationVert(), c); |
475 |
|
|
475 |
|
|
476 | 476 |
c.gridy = row++; |
477 | 477 |
c.gridx = 0; |
478 | 478 |
c.fill = GridBagConstraints.NONE; |
... | ... | |
480 | 480 |
c.gridx = 1; |
481 | 481 |
c.fill = GridBagConstraints.HORIZONTAL; |
482 | 482 |
pnlLabelGroup.add(getCbLblAnchor(), c); |
483 |
|
|
483 |
|
|
484 | 484 |
c.gridx = 0; |
485 | 485 |
c.gridy = row++; |
486 | 486 |
c.gridwidth = 2; |
... | ... | |
488 | 488 |
} |
489 | 489 |
return pnlLabelGroup; |
490 | 490 |
} |
491 |
|
|
491 |
|
|
492 | 492 |
private SimpleComboBox getCbLblAnchor() { |
493 | 493 |
if (cbLblAnchor==null) { |
494 | 494 |
cbLblAnchor = new SimpleComboBox(); |
... | ... | |
498 | 498 |
} |
499 | 499 |
return cbLblAnchor; |
500 | 500 |
} |
501 |
|
|
501 |
|
|
502 | 502 |
private JButton getBtnNumberFormat() { |
503 | 503 |
if (btnNumberFormat==null) { |
504 | 504 |
btnNumberFormat = new JButton(Messages.getText("Format")); |
... | ... | |
511 | 511 |
} |
512 | 512 |
return btnNumberFormat; |
513 | 513 |
} |
514 |
|
|
514 |
|
|
515 | 515 |
protected void openDecimalFormatDialog() { |
516 | 516 |
final DecimalFormatDialog dialog = new DecimalFormatDialog(null, null); |
517 | 517 |
dialog.addOkButtonActionListener(new ActionListener() { |
518 | 518 |
public void actionPerformed(ActionEvent e) { |
519 | 519 |
applyDecimalFormatSettings(dialog.getPanel()); |
520 | 520 |
} |
521 |
|
|
521 |
|
|
522 | 522 |
}); |
523 | 523 |
dialog.getPanel().setFormat(fframegrid.getLabelFormat()); |
524 | 524 |
PluginServices.getMDIManager().addWindow(dialog); |
525 | 525 |
} |
526 |
|
|
526 |
|
|
527 | 527 |
protected void applyDecimalFormatSettings(DecimalFormatPanel p) { |
528 | 528 |
format = p.getFormat(); |
529 | 529 |
} |
530 |
|
|
530 |
|
|
531 | 531 |
private JNumberSpinner getNfRotationHoriz() { |
532 | 532 |
if (nfRotationHoriz==null) { |
533 | 533 |
nfRotationHoriz = new JNumberSpinner(0, 3, 0, 360, 1); |
... | ... | |
535 | 535 |
} |
536 | 536 |
return nfRotationHoriz; |
537 | 537 |
} |
538 |
|
|
538 |
|
|
539 | 539 |
private JNumberSpinner getNfRotationVert() { |
540 | 540 |
if (nfRotationVert==null) { |
541 | 541 |
nfRotationVert = new JNumberSpinner(0, 3, 0, 360, 1); |
... | ... | |
546 | 546 |
|
547 | 547 |
/** |
548 | 548 |
* This method initializes jPanel11 |
549 |
*
|
|
549 |
* |
|
550 | 550 |
* @return javax.swing.JPanel |
551 | 551 |
*/ |
552 | 552 |
private JPanel getPnlFont() { |
... | ... | |
570 | 570 |
|
571 | 571 |
/** |
572 | 572 |
* This method initializes jButton |
573 |
*
|
|
573 |
* |
|
574 | 574 |
* @return javax.swing.JButton |
575 | 575 |
*/ |
576 | 576 |
private JButton getJButton() { |
... | ... | |
596 | 596 |
|
597 | 597 |
/** |
598 | 598 |
* This method initializes colorChooserPanel |
599 |
*
|
|
599 |
* |
|
600 | 600 |
* @return com.iver.cit.gvsig.gui.panels.ColorChooserPanel |
601 | 601 |
*/ |
602 | 602 |
private ColorChooserPanel getColorChooserPanel() { |
... | ... | |
620 | 620 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
621 | 621 |
try { |
622 | 622 |
newFFrameGrid = (FFrameGrid) fframegrid.clone(); |
623 |
newFFrameGrid.setFFrameDependence(fframeview); |
|
624 |
|
|
623 |
|
|
625 | 624 |
newFFrameGrid |
626 | 625 |
.setIntervalX(Double.parseDouble(getTxtIntervalX() |
627 | 626 |
.getText().toString())); |
... | ... | |
642 | 641 |
newFFrameGrid.setSizeFont(m_font.getSize()); |
643 | 642 |
newFFrameGrid.setIsLine(getRbLines().isSelected()); |
644 | 643 |
newFFrameGrid.setFont(m_font); |
645 |
newFFrameGrid.setRotation(fframeview.getRotation()); |
|
646 | 644 |
newFFrameGrid.setHorizLabelRotation(getNfRotationHoriz().getInteger()); |
647 | 645 |
newFFrameGrid.setVertLabelRotation(getNfRotationVert().getInteger()); |
648 | 646 |
newFFrameGrid.setLabelAnchor(getCbLblAnchor().getSelectedCode()); |
649 | 647 |
newFFrameGrid.setLabelFormat(format); |
650 | 648 |
if (getRbDistance().isSelected()) { |
651 |
newFFrameGrid.setUseNumDivisions(FFrameGrid.FIXED_DISTANCE_MODE);
|
|
649 |
newFFrameGrid.setUseNumDivisions(FFrameGrid.FIXED_DISTANCE_MODE); |
|
652 | 650 |
} |
653 | 651 |
else if (getRbHorizDiv().isSelected()) { |
654 | 652 |
newFFrameGrid.setUseNumDivisions(FFrameGrid.NUM_DIVISIONS_HORIZ_MODE); |
... | ... | |
697 | 695 |
return false; |
698 | 696 |
} |
699 | 697 |
|
700 |
public void setFFrameView(FFrameView fview) { |
|
701 |
fframeview = fview; |
|
702 |
//Set the label |
|
703 |
if (fframeview.getMapContext() != null){ |
|
704 |
lblUnitsX.setText(Messages.getText(MapContext.getDistanceNames()[ |
|
705 |
fframeview.getMapContext().getViewPort().getMapUnits()])); |
|
706 |
lblUnitsY.setText(Messages.getText(MapContext.getDistanceNames()[ |
|
707 |
fframeview.getMapContext().getViewPort().getMapUnits()])); |
|
698 |
public void setMapContext(MapContext mapContext) { |
|
699 |
this.mapContext = mapContext; |
|
700 |
if (mapContext != null){ |
|
701 |
String mapUnitsText = Messages.getText(MapContext.getDistanceNames()[mapContext.getViewPort().getMapUnits()]); |
|
702 |
lblUnitsX.setText(mapUnitsText); |
|
703 |
lblUnitsY.setText(mapUnitsText); |
|
708 | 704 |
} |
709 | 705 |
} |
710 | 706 |
|
707 |
public void setFrameRotation(double frameRotation) { |
|
708 |
this.frameRotation = frameRotation; |
|
709 |
} |
|
710 |
|
|
711 | 711 |
public Object getWindowProfile() { |
712 | 712 |
return WindowInfo.DIALOG_PROFILE; |
713 | 713 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/gui/dialogs/IFFrameDialog.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
27 | 27 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
28 |
import org.gvsig.app.project.documents.layout.LayoutContext; |
|
28 | 29 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
29 | 30 |
import org.gvsig.tools.observer.Observable; |
31 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
30 | 32 |
|
31 | 33 |
/** |
32 | 34 |
* Interface para la creaci?n de los di?logos que a?aden elementos al Layout. |
33 |
*
|
|
35 |
* |
|
34 | 36 |
* @author Vicente Caballero Navarro |
35 | 37 |
*/ |
36 |
public interface IFFrameDialog extends IWindow, Observable { |
|
38 |
public interface IFFrameDialog extends IWindow, Observable, ActionListenerSupport {
|
|
37 | 39 |
|
38 | 40 |
/** |
39 | 41 |
* Sets the bounding box of the fframe being created, in screen |
40 | 42 |
* coordinates (pixels), defining the position and size of the frame |
41 | 43 |
* within the Layout control. |
42 |
*
|
|
44 |
* |
|
43 | 45 |
* @param r |
44 | 46 |
* BoundingBox of the fframe. |
45 | 47 |
*/ |
... | ... | |
47 | 49 |
|
48 | 50 |
/** |
49 | 51 |
* Devuelve la informaci?n de la ventana. |
50 |
*
|
|
52 |
* |
|
51 | 53 |
* @return Informaci?n referente a la ventana. |
52 | 54 |
*/ |
53 | 55 |
public WindowInfo getWindowInfo(); |
54 | 56 |
|
55 | 57 |
/** |
56 | 58 |
* Devuelve true si ha sido aceptado el di?logo. |
57 |
*
|
|
59 |
* |
|
58 | 60 |
* @return True si se ha aceptado. |
59 | 61 |
*/ |
60 | 62 |
public boolean getIsAcepted(); |
61 | 63 |
|
62 | 64 |
public IFFrame getFFrame(); |
65 |
|
|
63 | 66 |
} |
Also available in: Unified diff