Revision 1757
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
135 | 135 |
_Degrees=Grados |
136 | 136 |
_Edit_mapbox=Editar cajet\u00edn |
137 | 137 |
_Mapbox_properties=Propiedades del cajet\u00edn |
138 |
_Go_to_default_templates_folder=Ir a la carpeta para plantillas por defecto |
|
138 |
_Go_to_default_templates_folder=Ir a la carpeta para plantillas por defecto |
|
139 |
_Edit=Editar |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
136 | 136 |
_Edit_mapbox=Edit mapbox |
137 | 137 |
_Mapbox_properties=Propiedades del cajet\u00edn |
138 | 138 |
_Go_to_default_templates_folder=Go to default templates folder |
139 |
_Edit=Edit |
|
139 | 140 |
|
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
16 | 16 |
<extension class-name="org.gvsig.app.extension.LayoutMainExtension" |
17 | 17 |
description="Extensi?n encargada de gestionar los layouts." |
18 | 18 |
active="true" |
19 |
priority="10"> |
|
19 |
priority="1010">
|
|
20 | 20 |
|
21 | 21 |
<action |
22 | 22 |
name="application-layout-template-open" |
... | ... | |
50 | 50 |
|
51 | 51 |
<extension class-name="org.gvsig.app.extension.ExportLayoutExtension" |
52 | 52 |
description="Extension for exporting the layout to PDF and PostScript." |
53 |
active="true"> |
|
53 |
active="true" |
|
54 |
priority="1000"> |
|
54 | 55 |
|
55 | 56 |
<action |
56 | 57 |
name="application-export-to-pdf" |
... | ... | |
78 | 79 |
|
79 | 80 |
<extension class-name="org.gvsig.app.extension.LayoutExtension" |
80 | 81 |
description="Extensi?n encargada de gestionar los eventos realizados sobre el Layout." |
81 |
active="true"> |
|
82 |
active="true" |
|
83 |
priority="1000"> |
|
82 | 84 |
|
83 | 85 |
<action |
84 | 86 |
name="application-layout-template-save" |
... | ... | |
188 | 190 |
|
189 | 191 |
<extension class-name="org.gvsig.app.extension.LayoutEditableControls" |
190 | 192 |
description="Extensi?n encargada de gestionar los eventos de edici?n realizados sobre el Layout." |
191 |
active="true"> |
|
193 |
active="true" |
|
194 |
priority="1000"> |
|
192 | 195 |
|
193 | 196 |
<action |
194 | 197 |
name="layout-properties" |
... | ... | |
204 | 207 |
|
205 | 208 |
<extension class-name="org.gvsig.app.extension.LayoutEditVertexExtension" |
206 | 209 |
description="Extensi?n encargada de gestionar los eventos de edici?n realizados sobre el Layout." |
207 |
active="true"> |
|
210 |
active="true" |
|
211 |
priority="1000"> |
|
208 | 212 |
|
209 | 213 |
<action |
210 | 214 |
name="layout-graphic-edit-vertex" |
... | ... | |
223 | 227 |
|
224 | 228 |
<extension class-name="org.gvsig.app.extension.LayoutInsertToolsExtension" |
225 | 229 |
description="Extensi?n encargada de gestionar los eventos de edici?n realizados sobre el Layout." |
226 |
active="true"> |
|
230 |
active="true" |
|
231 |
priority="1000"> |
|
227 | 232 |
|
228 | 233 |
<action |
229 | 234 |
name="selection-select-by-rectangle-layout" |
... | ... | |
355 | 360 |
position="700400100" |
356 | 361 |
/> |
357 | 362 |
|
358 |
<action |
|
359 |
name="layout-insert-mapbox" |
|
360 |
label="_Mapbox" |
|
361 |
tooltip="insertar_cajetin" |
|
362 |
action-command="layout-insert-mapbox" |
|
363 |
icon="layout-insert-mapbox" |
|
364 |
position="700400110" |
|
365 |
/> |
|
366 |
|
|
367 |
<action |
|
368 |
name="layout-edit-mapbox" |
|
369 |
label="_Edit_mapbox" |
|
370 |
tooltip="_Edit_mapbox" |
|
371 |
action-command="layout-edit-mapbox" |
|
372 |
icon="layout-edit-mapbox" |
|
373 |
position="700400115" |
|
374 |
/> |
|
375 |
|
|
376 | 363 |
<menu text="Selection/seleccionar_por_rectangulo" |
377 | 364 |
name="selection-select-by-rectangle-layout"/> |
378 | 365 |
|
... | ... | |
396 | 383 |
<!-- |
397 | 384 |
<menu text="Mapa/Insertar/cajetin" name="layout-insert-box" /> |
398 | 385 |
--> |
399 |
<menu text="Mapa/Insertar/cajetin" name="layout-insert-mapbox" /> |
|
400 |
|
|
401 |
<menu text="Mapa/edicion/editar_cajetin2" name="layout-edit-mapbox"/> |
|
402 |
|
|
403 | 386 |
<tool-bar name="selection"> |
404 | 387 |
<selectable-tool name="selection-select-by-rectangle-layout" /> |
405 |
<selectable-tool name="layout-edit-mapbox"/> |
|
406 | 388 |
</tool-bar> |
407 | 389 |
|
408 | 390 |
<tool-bar name="edit"> |
... | ... | |
429 | 411 |
<!-- |
430 | 412 |
<selectable-tool name="layout-insert-box" /> |
431 | 413 |
--> |
414 |
</tool-bar> |
|
415 |
</extension> |
|
416 |
|
|
417 |
<extension class-name="org.gvsig.layout.mapbox.LayoutMapBoxExtension" |
|
418 |
description="Extensi?n encargada de gestionar el cajet?n en el Mapa." |
|
419 |
active="true" |
|
420 |
priority="500"> |
|
421 |
|
|
422 |
|
|
423 |
<action |
|
424 |
name="layout-insert-mapbox" |
|
425 |
label="_Mapbox" |
|
426 |
tooltip="insertar_cajetin" |
|
427 |
action-command="layout-insert-mapbox" |
|
428 |
icon="layout-insert-mapbox" |
|
429 |
position="700400110" |
|
430 |
/> |
|
431 |
|
|
432 |
<action |
|
433 |
name="layout-edit-mapbox" |
|
434 |
label="_Edit_mapbox" |
|
435 |
tooltip="_Edit_mapbox" |
|
436 |
action-command="layout-edit-mapbox" |
|
437 |
icon="layout-edit-mapbox" |
|
438 |
position="700400115" |
|
439 |
/> |
|
440 |
|
|
441 |
<menu text="Mapa/Insertar/cajetin" name="layout-insert-mapbox" /> |
|
442 |
|
|
443 |
<menu text="Mapa/edicion/editar_cajetin2" name="layout-edit-mapbox"/> |
|
444 |
|
|
445 |
<tool-bar name="selection"> |
|
446 |
<selectable-tool name="layout-edit-mapbox"/> |
|
447 |
</tool-bar> |
|
448 |
|
|
449 |
<tool-bar name="layout_tools_insert_cartographics"> |
|
432 | 450 |
<selectable-tool name="layout-insert-mapbox" /> |
433 | 451 |
</tool-bar> |
434 | 452 |
</extension> |
435 | 453 |
|
436 | 454 |
<extension class-name="org.gvsig.app.extension.FFrameViewExtension" |
437 | 455 |
description="Extensi?n encargada de gestionar los eventos realizados sobre las vistas a?adidas al Layout." |
438 |
active="true"> |
|
456 |
active="true" |
|
457 |
priority="1000"> |
|
439 | 458 |
<combo-scale name="layout-view-change-scale" label="1:" |
440 | 459 |
elements="1000;2000;5000;10000;25000;50000;100000;200000;500000;1000000;2000000;5000000" |
441 | 460 |
value="10000" action-command="layout-view-change-scale" /> |
... | ... | |
486 | 505 |
|
487 | 506 |
<extension class-name="org.gvsig.app.extension.TagExtension" |
488 | 507 |
description="Extensi?n para a?adir un tag a los FFrames." |
489 |
active="true"> |
|
508 |
active="true" |
|
509 |
priority="1000"> |
|
490 | 510 |
|
491 | 511 |
<action |
492 | 512 |
name="layout-graphic-show-tags" |
... | ... | |
515 | 535 |
|
516 | 536 |
<extension class-name="org.gvsig.app.extension.LayoutGraphicControls" |
517 | 537 |
description="Extensi?n encargada de gestionar los eventos realizados sobre los gr?ficos que contiene el Layout." |
518 |
active="true"> |
|
538 |
active="true" |
|
539 |
priority="1000"> |
|
519 | 540 |
|
520 | 541 |
<action |
521 | 542 |
name="layout-graphic-add-border" |
... | ... | |
608 | 629 |
|
609 | 630 |
<extension class-name="org.gvsig.app.extension.FFrameLegendExtension" |
610 | 631 |
description="Extensi?n encargada de controlar un FFrameLegend." |
611 |
active="true"> |
|
632 |
active="true" |
|
633 |
priority="1000"> |
|
612 | 634 |
|
613 | 635 |
<action |
614 | 636 |
name="layout-graphic-simplify-legend" |
... | ... | |
624 | 646 |
|
625 | 647 |
<extension class-name="org.gvsig.app.extension.LayoutRedoExtension" |
626 | 648 |
description="Extensi?n para rehacer cambios sobre el Layout." |
627 |
active="true"> |
|
649 |
active="true" |
|
650 |
priority="1000"> |
|
628 | 651 |
|
629 | 652 |
<action |
630 | 653 |
name= "edit-redo-layout" |
... | ... | |
644 | 667 |
|
645 | 668 |
<extension class-name="org.gvsig.app.extension.LayoutUndoExtension" |
646 | 669 |
description="Extensi?n para deshacer cambios sobre el Layout." |
647 |
active="true"> |
|
670 |
active="true" |
|
671 |
priority="1000"> |
|
648 | 672 |
|
649 | 673 |
<action |
650 | 674 |
name= "edit-undo-layout" |
... | ... | |
663 | 687 |
|
664 | 688 |
<extension class-name="org.gvsig.app.extension.LayoutCommandStackExtension" |
665 | 689 |
description="Extensi?n encargada de abrir el di?logo para gestionar los comandos apilados." |
666 |
active="true"> |
|
690 |
active="true" |
|
691 |
priority="1000"> |
|
667 | 692 |
|
668 | 693 |
<action |
669 | 694 |
name="edit-undo-redo-actions-layout" |
... | ... | |
682 | 707 |
|
683 | 708 |
<extension class-name="org.gvsig.app.extension.Print" |
684 | 709 |
description="Extensi?n encargada de la impresi?n." |
685 |
active="true"> |
|
710 |
active="true" |
|
711 |
priority="1000"> |
|
686 | 712 |
|
687 | 713 |
<action |
688 | 714 |
name="application-print-layout" |
... | ... | |
701 | 727 |
|
702 | 728 |
<extension class-name="org.gvsig.app.extension.PrintProperties" |
703 | 729 |
escription="Extensi?n encargada de las propiedades de impresi?n." |
704 |
active="true"> |
|
730 |
active="true" |
|
731 |
priority="1000"> |
|
705 | 732 |
|
706 | 733 |
<action |
707 | 734 |
name="application-page-setup-layout" |
... | ... | |
720 | 747 |
|
721 | 748 |
<extension class-name="org.gvsig.app.extension.FFrameViewPanExtension" |
722 | 749 |
description="Extension encargada de gestionar los desplazamientos en la vista del layout." |
723 |
active="true"> |
|
750 |
active="true" |
|
751 |
priority="1000"> |
|
724 | 752 |
<action |
725 | 753 |
name="layout-view-navigation-pan" |
726 | 754 |
label="Encuadre_Vista" |
... | ... | |
738 | 766 |
|
739 | 767 |
<extension class-name="org.gvsig.app.extension.FFrameViewAddLayerExtension" |
740 | 768 |
description="Extension encargada de gestionar los desplazamientos en la vista del layout." |
741 |
active="true"> |
|
769 |
active="true" |
|
770 |
priority="1000"> |
|
742 | 771 |
<action |
743 | 772 |
name="layout-view-add-layer" |
744 | 773 |
label="Add_layer" |
... | ... | |
755 | 784 |
|
756 | 785 |
<extension class-name="org.gvsig.app.extension.FFrameViewZoomPrev" |
757 | 786 |
description="Extension encargada de gestionar los zooms previos al actual." |
758 |
active="true"> |
|
787 |
active="true" |
|
788 |
priority="1000"> |
|
759 | 789 |
<action name="layout-view-navigation-zoom-back" |
760 | 790 |
label="Zoom_back" |
761 | 791 |
tooltip="Zoom_back" |
... | ... | |
773 | 803 |
<extension class-name="org.gvsig.app.extension.reportfromlayout.ConfigureReportFromLayoutExtension" |
774 | 804 |
description="Extensi?n encargada de configurar informes a partir de layouts" |
775 | 805 |
active="true" |
776 |
priority="10"> |
|
806 |
priority="1010">
|
|
777 | 807 |
|
778 | 808 |
<action |
779 | 809 |
name="application-layout-configurereportfromlayout" |
... | ... | |
791 | 821 |
<extension class-name="org.gvsig.app.extension.reportfromlayout.ExportReportToLayoutExtension" |
792 | 822 |
description="Extensi?n encargada de exportar layouts a informes." |
793 | 823 |
active="true" |
794 |
priority="10"> |
|
824 |
priority="1010">
|
|
795 | 825 |
|
796 | 826 |
<action |
797 | 827 |
name="application-layout-exporttolayout" |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/layout/mapbox/panel/menu/EditMapBoxMenuEntry.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.layout.mapbox.panel.menu; |
|
23 |
|
|
24 |
import org.gvsig.andami.PluginServices; |
|
25 |
import org.gvsig.app.project.documents.layout.LayoutContext; |
|
26 |
import org.gvsig.app.project.documents.layout.LayoutControl; |
|
27 |
import org.gvsig.app.project.documents.layout.contextmenu.gui.*; |
|
28 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
|
29 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutBehavior; |
|
30 |
import org.gvsig.layout.mapbox.MapBoxUtils; |
|
31 |
import org.gvsig.layout.mapbox.fframe.FFrameMapBox; |
|
32 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxBehavior; |
|
33 |
|
|
34 |
/** |
|
35 |
* Copia el FFrame seleccionado. |
|
36 |
* |
|
37 |
* @author gvSIG team |
|
38 |
*/ |
|
39 |
public class EditMapBoxMenuEntry extends AbstractLayoutContextMenuAction { |
|
40 |
|
|
41 |
@Override |
|
42 |
public String getGroup() { |
|
43 |
return "copypaste"; |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public int getGroupOrder() { |
|
48 |
return 4; |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public int getOrder() { |
|
53 |
return 50; |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public String getText() { |
|
58 |
return PluginServices.getText(this, "_Edit"); |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public boolean isEnabled(LayoutContext layoutContext, |
|
63 |
IFFrame[] selectedFrames) { |
|
64 |
for (IFFrame selectedFrame : selectedFrames) { |
|
65 |
if (selectedFrame instanceof FFrameMapBox) { |
|
66 |
LayoutControl layoutControl = this.getLayout().getLayoutControl(); |
|
67 |
LayoutBehavior tool = layoutControl.getCurrentLayoutTool(); |
|
68 |
if(tool.getClass() == LayoutEditMapBoxBehavior.class){ |
|
69 |
return false; |
|
70 |
} |
|
71 |
return true; |
|
72 |
} |
|
73 |
} |
|
74 |
return false; |
|
75 |
} |
|
76 |
|
|
77 |
@Override |
|
78 |
public boolean isVisible(LayoutContext layoutContext, |
|
79 |
IFFrame[] selectedFrames) { |
|
80 |
for (IFFrame selectedFrame : selectedFrames) { |
|
81 |
if (selectedFrame instanceof FFrameMapBox) { |
|
82 |
return true; |
|
83 |
} |
|
84 |
} |
|
85 |
return false; |
|
86 |
} |
|
87 |
|
|
88 |
@Override |
|
89 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
|
90 |
if (selectedFrames.length != 1) { |
|
91 |
return; |
|
92 |
} |
|
93 |
IFFrame selectedFrame = selectedFrames[0]; |
|
94 |
|
|
95 |
if (selectedFrame instanceof FFrameMapBox) { |
|
96 |
LayoutControl layoutControl = this.getLayout().getLayoutControl(); |
|
97 |
MapBoxUtils.addLayoutEditMapBoxTool(this.getLayout(), layoutControl); |
|
98 |
layoutControl.setTool("layouteditmapbox"); |
|
99 |
} |
|
100 |
} |
|
101 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/layout/mapbox/tools/LayoutEditMapBoxBehavior.java | ||
---|---|---|
28 | 28 |
import java.awt.geom.AffineTransform; |
29 | 29 |
import java.awt.geom.Point2D; |
30 | 30 |
import org.apache.commons.lang3.tuple.Pair; |
31 |
import org.gvsig.app.project.documents.layout.DefaultLayoutNotification; |
|
32 | 31 |
import org.gvsig.app.project.documents.layout.FLayoutUtilities; |
33 | 32 |
import org.gvsig.app.project.documents.layout.LayoutContext; |
34 |
import org.gvsig.app.project.documents.layout.LayoutNotification; |
|
35 | 33 |
import org.gvsig.app.project.documents.layout.fframes.FFrame; |
36 | 34 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
37 | 35 |
import org.gvsig.app.project.documents.layout.tools.behavior.*; |
... | ... | |
56 | 54 |
*/ |
57 | 55 |
public class LayoutEditMapBoxBehavior extends LayoutBehavior { |
58 | 56 |
|
59 |
private static Logger LOGGER = LoggerFactory.getLogger(LayoutEditMapBoxBehavior.class); |
|
57 |
private static final Logger LOGGER = LoggerFactory.getLogger(LayoutEditMapBoxBehavior.class);
|
|
60 | 58 |
private final LayoutEditMapBoxListenerImpl listener; |
61 | 59 |
private boolean dragging = false; |
62 | 60 |
|
... | ... | |
160 | 158 |
FFrameMapBox newFrame = (FFrameMapBox) CloneableUtils.cloneQuietly(currFrame); |
161 | 159 |
if (this.dragging) { |
162 | 160 |
this.listener.drag(newFrame, relativePosition.getLeft(), relativePosition.getRight(), point); |
163 |
currFrame.getLayoutContext().getFrameCommandsRecord().update(currFrame, newFrame); |
|
164 |
getLayoutControl().getLayoutContext().updateFFrames(); |
|
165 | 161 |
} else { |
166 | 162 |
Point2D.Double mapPoint = newFrame.fromSheetPointToMapBoxPoint(point); |
167 | 163 |
Cell cell = newFrame.getModel().getCell(mapPoint.getX(), mapPoint.getY()); |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/layout/mapbox/LayoutMapBoxExtension.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.layout.mapbox; |
|
23 |
|
|
24 |
import org.gvsig.andami.IconThemeHelper; |
|
25 |
import org.gvsig.andami.PluginServices; |
|
26 |
import org.gvsig.andami.plugins.Extension; |
|
27 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
28 |
import org.gvsig.app.project.ProjectManager; |
|
29 |
import org.gvsig.app.project.documents.layout.DefaultLayoutManager; |
|
30 |
import org.gvsig.app.project.documents.layout.LayoutControl; |
|
31 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
|
32 |
import org.slf4j.Logger; |
|
33 |
import org.slf4j.LoggerFactory; |
|
34 |
|
|
35 |
/** |
|
36 |
* @author gvSIG-team |
|
37 |
*/ |
|
38 |
public class LayoutMapBoxExtension extends Extension { |
|
39 |
|
|
40 |
private static final Logger logger = LoggerFactory |
|
41 |
.getLogger(LayoutMapBoxExtension.class); |
|
42 |
|
|
43 |
// private LayoutPanel layout = null; |
|
44 |
|
|
45 |
@Override |
|
46 |
public void initialize() { |
|
47 |
registerIcons(); |
|
48 |
|
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public void postInitialize() { |
|
53 |
DefaultLayoutManager layoutManager = (DefaultLayoutManager) ProjectManager |
|
54 |
.getInstance() |
|
55 |
.getDocumentManager(DefaultLayoutManager.TYPENAME); |
|
56 |
MapBoxUtils.registerPersistence(); |
|
57 |
MapBoxUtils.register(layoutManager); |
|
58 |
MapBoxUtils.registerContextMenuOptions(); |
|
59 |
} |
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
private void registerIcons() { |
|
64 |
IconThemeHelper.registerIcon("action", "layout-insert-mapbox", this); |
|
65 |
IconThemeHelper.registerIcon("action", "layout-edit-mapbox", this); |
|
66 |
} |
|
67 |
|
|
68 |
@Override |
|
69 |
public void execute(String s) { |
|
70 |
LayoutPanel layout = (LayoutPanel) PluginServices.getMDIManager().getActiveWindow(); |
|
71 |
LayoutControl control = layout.getLayoutControl(); |
|
72 |
|
|
73 |
logger.debug("Comand : " + s); |
|
74 |
|
|
75 |
switch (s) { |
|
76 |
case "layout-insert-mapbox": |
|
77 |
MapBoxUtils.addLayoutAddMapBoxTool(layout, control); |
|
78 |
control.setTool("layoutaddmapbox"); |
|
79 |
layout.getDocument().setModified(true); |
|
80 |
break; |
|
81 |
case "layout-edit-mapbox": |
|
82 |
MapBoxUtils.addLayoutEditMapBoxTool(layout, control); |
|
83 |
control.setTool("layouteditmapbox"); |
|
84 |
layout.getDocument().setModified(true); |
|
85 |
break; |
|
86 |
default: |
|
87 |
break; |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
91 |
@Override |
|
92 |
public boolean isEnabled() { |
|
93 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
94 |
|
|
95 |
if (f == null) { |
|
96 |
return false; |
|
97 |
} |
|
98 |
|
|
99 |
if (f instanceof LayoutPanel) { |
|
100 |
return ((LayoutPanel) f).getLayoutContext().isEditable(); |
|
101 |
} |
|
102 |
|
|
103 |
return false; |
|
104 |
} |
|
105 |
|
|
106 |
@Override |
|
107 |
public boolean isVisible() { |
|
108 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
109 |
|
|
110 |
if (f == null) { |
|
111 |
return false; |
|
112 |
} |
|
113 |
|
|
114 |
return (f instanceof LayoutPanel); |
|
115 |
} |
|
116 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/layout/mapbox/MapBoxUtils.java | ||
---|---|---|
5 | 5 |
package org.gvsig.layout.mapbox; |
6 | 6 |
|
7 | 7 |
import org.gvsig.andami.IconThemeHelper; |
8 |
import org.gvsig.app.project.ProjectManager; |
|
8 | 9 |
import org.gvsig.app.project.documents.layout.DefaultLayoutManager; |
9 | 10 |
import org.gvsig.app.project.documents.layout.LayoutControl; |
11 |
import org.gvsig.app.project.documents.layout.LayoutManager; |
|
10 | 12 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
11 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutRectangleBehavior; |
|
12 | 13 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutRectangleByTwoPointsBehavior; |
13 | 14 |
import org.gvsig.layout.mapbox.fframe.FFrameMapBox; |
14 | 15 |
import org.gvsig.layout.mapbox.fframe.FFrameMapBoxFactory; |
... | ... | |
16 | 17 |
import org.gvsig.layout.mapbox.model.MapBoxModel; |
17 | 18 |
import org.gvsig.layout.mapbox.model.SelectionCellImpl; |
18 | 19 |
import org.gvsig.layout.mapbox.panel.FFrameMapBoxPanel; |
20 |
import org.gvsig.layout.mapbox.panel.menu.AddColumnMapBoxMenuEntry; |
|
21 |
import org.gvsig.layout.mapbox.panel.menu.AddRowMapBoxMenuEntry; |
|
22 |
import org.gvsig.layout.mapbox.panel.menu.CombineCellsMapBoxMenuEntry; |
|
23 |
import org.gvsig.layout.mapbox.panel.menu.EditMapBoxMenuEntry; |
|
24 |
import org.gvsig.layout.mapbox.panel.menu.InsertColumnMapBoxMenuEntry; |
|
25 |
import org.gvsig.layout.mapbox.panel.menu.InsertRowMapBoxMenuEntry; |
|
26 |
import org.gvsig.layout.mapbox.panel.menu.RemoveCellsMapBoxMenuEntry; |
|
27 |
import org.gvsig.layout.mapbox.panel.menu.RemoveColumnMapBoxMenuEntry; |
|
28 |
import org.gvsig.layout.mapbox.panel.menu.RemoveRowMapBoxMenuEntry; |
|
29 |
import org.gvsig.layout.mapbox.panel.menu.SplitCellsHorizontallyMapBoxMenuEntry; |
|
30 |
import org.gvsig.layout.mapbox.panel.menu.SplitCellsVerticallyMapBoxMenuEntry; |
|
19 | 31 |
import org.gvsig.layout.mapbox.tools.LayoutAddMapBoxListenerImpl; |
20 | 32 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxBehavior; |
21 | 33 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxListenerImpl; |
... | ... | |
26 | 38 |
*/ |
27 | 39 |
public class MapBoxUtils { |
28 | 40 |
|
29 |
public static void register(DefaultLayoutManager layoutManager) {
|
|
41 |
/*friend*/ static void register(DefaultLayoutManager layoutManager) {
|
|
30 | 42 |
layoutManager.registerFrameFactory(new FFrameMapBoxFactory()); |
31 | 43 |
layoutManager.registerFFrameDialog( |
32 | 44 |
FFrameMapBox.PERSISTENCE_DEFINITION_NAME, FFrameMapBoxPanel.class); |
33 | 45 |
IconThemeHelper.registerIcon("action", "layout-insert-mapbox", MapBoxUtils.class); |
34 | 46 |
} |
35 | 47 |
|
36 |
public static void addLayoutTool(LayoutPanel layoutPanel, LayoutControl control) { |
|
48 |
/*friend*/ static void addLayoutAddMapBoxTool(LayoutPanel layoutPanel, LayoutControl control) { |
|
49 |
if(control.getLayoutTool("layoutaddmapbox") != null) { |
|
50 |
return; |
|
51 |
} |
|
37 | 52 |
LayoutAddMapBoxListenerImpl labl = new LayoutAddMapBoxListenerImpl(layoutPanel); |
38 | 53 |
control.addLayoutTool("layoutaddmapbox", new LayoutRectangleByTwoPointsBehavior(labl)); |
54 |
} |
|
55 |
|
|
56 |
public static void addLayoutEditMapBoxTool(LayoutPanel layoutPanel, LayoutControl control) { |
|
57 |
if(control.getLayoutTool("layouteditmapbox") != null) { |
|
58 |
return; |
|
59 |
} |
|
39 | 60 |
LayoutEditMapBoxListenerImpl leditMapBoxListener = new LayoutEditMapBoxListenerImpl(layoutPanel); |
40 | 61 |
control.addLayoutTool("layouteditmapbox", new LayoutEditMapBoxBehavior(leditMapBoxListener)); |
41 | 62 |
} |
42 | 63 |
|
43 |
public static void registerPersistence() {
|
|
64 |
/*friend*/ static void registerPersistence() {
|
|
44 | 65 |
FFrameMapBox.registerPersistent(); |
45 | 66 |
MapBoxModel.registerPersistent(); |
46 | 67 |
SelectionCellImpl.registerPersistent(); |
47 | 68 |
CellImpl.registerPersistent(); |
48 | 69 |
} |
49 | 70 |
|
71 |
/*friend*/ static void registerContextMenuOptions() { |
|
72 |
LayoutManager layoutManager = (LayoutManager) ProjectManager |
|
73 |
.getInstance().getDocumentManager("project.document.layout"); |
|
74 |
|
|
75 |
layoutManager.registerLayoutMenuAction("CombineCells", |
|
76 |
CombineCellsMapBoxMenuEntry.class); |
|
77 |
layoutManager.registerLayoutMenuAction("SplitCellsVertically", |
|
78 |
SplitCellsVerticallyMapBoxMenuEntry.class); |
|
79 |
layoutManager.registerLayoutMenuAction("SplitCellsHorizontally", |
|
80 |
SplitCellsHorizontallyMapBoxMenuEntry.class); |
|
81 |
layoutManager.registerLayoutMenuAction("InsertColumnMapBoxMenuEntry", |
|
82 |
InsertColumnMapBoxMenuEntry.class); |
|
83 |
layoutManager.registerLayoutMenuAction("AddColumnMapBoxMenuEntry", |
|
84 |
AddColumnMapBoxMenuEntry.class); |
|
85 |
layoutManager.registerLayoutMenuAction("InsertRowMapBoxMenuEntry", |
|
86 |
InsertRowMapBoxMenuEntry.class); |
|
87 |
layoutManager.registerLayoutMenuAction("AddRowMapBoxMenuEntry", |
|
88 |
AddRowMapBoxMenuEntry.class); |
|
89 |
layoutManager.registerLayoutMenuAction("RemoveColumnMapBoxMenuEntry", |
|
90 |
RemoveColumnMapBoxMenuEntry.class); |
|
91 |
layoutManager.registerLayoutMenuAction("RemoveRowMapBoxMenuEntry", |
|
92 |
RemoveRowMapBoxMenuEntry.class); |
|
93 |
layoutManager.registerLayoutMenuAction("RemoveCellsMapBoxMenuEntry", |
|
94 |
RemoveCellsMapBoxMenuEntry.class); |
|
95 |
layoutManager.registerLayoutMenuAction("EditMapBoxMenuEntry", |
|
96 |
EditMapBoxMenuEntry.class); |
|
97 |
|
|
98 |
} |
|
99 |
|
|
50 | 100 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/FLayoutDraw.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.app.project.documents.layout; |
23 | 23 |
|
24 |
import com.lowagie.text.Document; |
|
25 |
import com.lowagie.text.DocumentException; |
|
26 |
import com.lowagie.text.Rectangle; |
|
27 |
import com.lowagie.text.pdf.PdfContentByte; |
|
28 |
import com.lowagie.text.pdf.PdfWriter; |
|
24 | 29 |
import java.awt.Color; |
25 | 30 |
import java.awt.Component; |
26 | 31 |
import java.awt.Cursor; |
... | ... | |
38 | 43 |
import java.io.FileOutputStream; |
39 | 44 |
import java.io.IOException; |
40 | 45 |
import java.io.OutputStream; |
41 |
|
|
42 | 46 |
import javax.print.Doc; |
43 | 47 |
import javax.print.DocFlavor; |
44 | 48 |
import javax.print.DocPrintJob; |
... | ... | |
46 | 50 |
import javax.print.SimpleDoc; |
47 | 51 |
import javax.print.StreamPrintService; |
48 | 52 |
import javax.print.StreamPrintServiceFactory; |
49 |
import javax.print.attribute.DocAttributeSet; |
|
50 |
import javax.print.attribute.HashDocAttributeSet; |
|
51 | 53 |
import javax.print.attribute.PrintRequestAttributeSet; |
52 | 54 |
import javax.swing.JOptionPane; |
53 |
|
|
54 |
import com.lowagie.text.Document; |
|
55 |
import com.lowagie.text.DocumentException; |
|
56 |
import com.lowagie.text.PageSize; |
|
57 |
import com.lowagie.text.Rectangle; |
|
58 |
import com.lowagie.text.pdf.PdfContentByte; |
|
59 |
import com.lowagie.text.pdf.PdfWriter; |
|
60 |
|
|
61 |
import org.slf4j.Logger; |
|
62 |
import org.slf4j.LoggerFactory; |
|
63 | 55 |
import org.gvsig.andami.PluginServices; |
64 | 56 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
65 | 57 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
66 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
67 | 58 |
import org.gvsig.tools.observer.Observable; |
68 | 59 |
import org.gvsig.tools.observer.ObservableHelper; |
69 | 60 |
import org.gvsig.tools.observer.Observer; |
61 |
import org.slf4j.Logger; |
|
62 |
import org.slf4j.LoggerFactory; |
|
70 | 63 |
|
71 | 64 |
/** |
72 | 65 |
* Clase que implementa los m?todos del Layout que dibujan sobre el Graphics. |
... | ... | |
111 | 104 |
* Si es null, est?s imprimiendo. Si no, la usas para el |
112 | 105 |
* c?digo de optimizaci?n. |
113 | 106 |
* |
114 |
* @throws ReadDriverException |
|
115 | 107 |
*/ |
116 | 108 |
public void drawLayout(Graphics2D g2, BufferedImage imgBase) |
117 |
throws ReadException {
|
|
109 |
{ |
|
118 | 110 |
if (!initializeAffineTransform()) { |
119 | 111 |
return; |
120 | 112 |
} |
121 | 113 |
|
122 | 114 |
IFFrame[] fframes = layoutContext.getFFrames(); |
123 |
for (int i = 0; i < fframes.length; i++) { |
|
124 |
IFFrame f = fframes[i]; |
|
115 |
for (IFFrame f : fframes) { |
|
125 | 116 |
f.draw(g2, layoutContext.getAT(), layoutControl.getComponent().getVisibleRect(), |
126 |
imgBase);
|
|
127 |
|
|
117 |
imgBase); |
|
118 |
|
|
128 | 119 |
// Dibuja el s?mbolo de que contiene un tag. |
129 | 120 |
if ((f.getTag() != null) && (layoutPanel.isShowIconTag())) { |
130 | 121 |
f.drawSymbolTag(g2); |
... | ... | |
152 | 143 |
|
153 | 144 |
layoutControl.setCancelDrawing(false); |
154 | 145 |
|
155 |
double scale = 0; |
|
156 |
scale = rLayout.getHeight() / attributes.getPaperSize().getHeight() * 1; // paper (paper units) to screen (pixels) scale |
|
146 |
double scale = rLayout.getHeight() / attributes.getPaperSize().getHeight() * 1; // paper (paper units) to screen (pixels) scale |
|
157 | 147 |
AffineTransform escalado = new AffineTransform(); |
158 | 148 |
AffineTransform translacion = new AffineTransform(); |
159 | 149 |
translacion.setToTranslation(rLayout.getMinX(), rLayout.getMinY()); |
... | ... | |
520 | 510 |
|
521 | 511 |
g.setColor(color); |
522 | 512 |
IFFrame[] fframes = layoutContext.getFFrames(); |
523 |
for (int i = 0; i < fframes.length; i++) { |
|
524 |
IFFrame fframe = fframes[i]; |
|
525 |
|
|
513 |
for (IFFrame fframe : fframes) { |
|
526 | 514 |
if (fframe.getSelected() != IFFrame.NOSELECT) { |
527 | 515 |
fframe.drawHandlers(g); |
528 | 516 |
} |
... | ... | |
575 | 563 |
|
576 | 564 |
// is.close(); |
577 | 565 |
fos.close(); |
578 |
} catch (PrintException e) { |
|
566 |
} catch (PrintException | IOException e) {
|
|
579 | 567 |
LOG.error("Error printing the map", e); |
580 |
} catch (IOException e) { |
|
581 |
LOG.error("Error printing the map", e); |
|
582 | 568 |
} |
583 | 569 |
/* |
584 | 570 |
* PrintService defaultPrintService = |
... | ... | |
648 | 634 |
layoutControl.fullRect(); |
649 | 635 |
} |
650 | 636 |
|
637 |
@Override |
|
651 | 638 |
public int print(Graphics g, PageFormat format, int pi) |
652 | 639 |
throws PrinterException { |
653 | 640 |
initialize(); |
... | ... | |
694 | 681 |
} |
695 | 682 |
|
696 | 683 |
IFFrame[] fframes = layoutContext.getFFrames(); |
697 |
for (int i = 0; i < fframes.length; i++) {
|
|
698 |
fframes[i].print(g2, layoutControl.getAT(), null, layoutContext
|
|
684 |
for (IFFrame fframe : fframes) {
|
|
685 |
fframe.print(g2, layoutControl.getAT(), null, layoutContext |
|
699 | 686 |
.getAttributes().toPrintAttributes()); |
700 | 687 |
} |
701 | 688 |
} |
702 | 689 |
|
690 |
@Override |
|
703 | 691 |
public void addObserver(Observer o) { |
704 | 692 |
observers.addObserver(o); |
705 | 693 |
} |
706 | 694 |
|
695 |
@Override |
|
707 | 696 |
public void deleteObserver(Observer o) { |
708 | 697 |
observers.deleteObserver(o); |
709 | 698 |
} |
710 | 699 |
|
700 |
@Override |
|
711 | 701 |
public void deleteObservers() { |
712 | 702 |
observers.deleteObservers(); |
713 | 703 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/DefaultLayoutManager.java | ||
---|---|---|
52 | 52 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanelImpl; |
53 | 53 |
import org.gvsig.app.project.documents.layout.gui.MapProperties; |
54 | 54 |
import org.gvsig.app.project.documents.view.IContextMenuAction; |
55 |
import org.gvsig.layout.mapbox.MapBoxUtils; |
|
56 | 55 |
import org.gvsig.tools.ToolsLocator; |
57 | 56 |
import org.gvsig.tools.dynobject.DynStruct; |
58 | 57 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
... | ... | |
282 | 281 |
|
283 | 282 |
DefaultLayoutPanel.registerPersistent(); |
284 | 283 |
DefaultLayoutContext.registerPersistent(); |
285 |
MapBoxUtils.registerPersistence(); |
|
286 | 284 |
} |
287 | 285 |
} |
288 | 286 |
|
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/LayoutControl.java | ||
---|---|---|
27 | 27 |
import java.awt.geom.AffineTransform; |
28 | 28 |
import java.awt.geom.Rectangle2D; |
29 | 29 |
import java.awt.image.BufferedImage; |
30 |
|
|
31 | 30 |
import javax.swing.JComponent; |
32 |
|
|
33 | 31 |
import org.gvsig.app.project.documents.layout.geometryadapters.GeometryAdapter; |
34 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
|
35 | 32 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutBehavior; |
36 | 33 |
import org.gvsig.fmap.dal.exception.ReadException; |
37 | 34 |
import org.gvsig.tools.observer.Observer; |
... | ... | |
81 | 78 |
* LayoutBehavior |
82 | 79 |
*/ |
83 | 80 |
public void addLayoutTool(String name, LayoutBehavior tool); |
81 |
|
|
82 |
public LayoutBehavior getLayoutTool(String name); |
|
84 | 83 |
|
85 | 84 |
/** |
86 | 85 |
* Inserts the LayoutContext. |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/DefaultLayoutControl.java | ||
---|---|---|
75 | 75 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutZoomBehavior; |
76 | 76 |
import org.gvsig.app.project.documents.layout.tools.listener.ILayoutGraphicListener; |
77 | 77 |
import org.gvsig.fmap.dal.exception.ReadException; |
78 |
import org.gvsig.layout.mapbox.MapBoxUtils; |
|
79 | 78 |
import org.gvsig.tools.observer.Observable; |
79 |
import org.slf4j.Logger; |
|
80 |
import org.slf4j.LoggerFactory; |
|
80 | 81 |
|
81 | 82 |
/** |
82 | 83 |
* Control of Layout. |
... | ... | |
84 | 85 |
* @author Vicente Caballero Navarro |
85 | 86 |
*/ |
86 | 87 |
public class DefaultLayoutControl extends JComponent implements LayoutControl { |
88 |
|
|
89 |
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultLayoutControl.class); |
|
90 |
|
|
87 | 91 |
private static final int DESACTUALIZADO = 4; |
88 | 92 |
private static final int ACTUALIZADO = 5; |
89 | 93 |
|
... | ... | |
235 | 239 |
new LayoutEditGraphicsListenerImpl(layoutPanel); |
236 | 240 |
addLayoutTool("layoutedit", new LayoutEditBehavior(leditl)); |
237 | 241 |
|
238 |
MapBoxUtils.addLayoutTool(layoutPanel, this); |
|
239 | 242 |
} |
240 | 243 |
|
241 | 244 |
@Override |
... | ... | |
250 | 253 |
} |
251 | 254 |
|
252 | 255 |
@Override |
256 |
public LayoutBehavior getLayoutTool(String name) { |
|
257 |
return (LayoutBehavior) namesLayoutTools.get(name); |
|
258 |
} |
|
259 |
|
|
260 |
@Override |
|
253 | 261 |
public void setLayoutContext(LayoutContext lc) { |
254 | 262 |
layoutContext = lc; |
255 | 263 |
layoutContext.addObserver(this); |
... | ... | |
269 | 277 |
Rectangle rClip = g.getClipBounds(); |
270 | 278 |
|
271 | 279 |
if (rClip == null) { |
272 |
System.err.println("clip = null");
|
|
280 |
LOGGER.debug("clip = null");
|
|
273 | 281 |
} |
274 | 282 |
|
275 | 283 |
switch (status) { |
... | ... | |
289 | 297 |
Graphics gimgRuler = imgRuler.getGraphics(); |
290 | 298 |
clipVisibleRect((Graphics2D) gimag); |
291 | 299 |
|
292 |
try { |
|
293 |
layoutDraw.drawLayout((Graphics2D) gimag, img); |
|
294 |
} catch (ReadException e) { |
|
295 |
e.printStackTrace(); |
|
296 |
} |
|
300 |
layoutDraw.drawLayout((Graphics2D) gimag, img); |
|
297 | 301 |
|
298 | 302 |
g.setClip(rClip); |
299 | 303 |
layoutDraw.drawRectangle((Graphics2D) g); |
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/CutLayoutMenuEntry.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
public class CutLayoutMenuEntry extends AbstractLayoutContextMenuAction { |
36 | 36 |
|
37 |
@Override |
|
37 | 38 |
public String getGroup() { |
38 | 39 |
return "copypaste"; |
39 | 40 |
} |
40 | 41 |
|
42 |
@Override |
|
41 | 43 |
public int getGroupOrder() { |
42 | 44 |
return 4; |
43 | 45 |
} |
44 | 46 |
|
47 |
@Override |
|
45 | 48 |
public int getOrder() { |
46 |
return 3;
|
|
49 |
return 200;
|
|
47 | 50 |
} |
48 | 51 |
|
52 |
@Override |
|
49 | 53 |
public String getText() { |
50 | 54 |
return PluginServices.getText(this, "cut"); |
51 | 55 |
} |
52 | 56 |
|
57 |
@Override |
|
53 | 58 |
public boolean isEnabled(LayoutContext layoutContext, |
54 | 59 |
IFFrame[] selectedFrames) { |
55 | 60 |
return true; |
56 | 61 |
} |
57 | 62 |
|
63 |
@Override |
|
58 | 64 |
public boolean isVisible(LayoutContext layoutContext, |
59 | 65 |
IFFrame[] selectedFrames) { |
60 | 66 |
if (selectedFrames.length == 1 |
... | ... | |
64 | 70 |
return false; |
65 | 71 |
} |
66 | 72 |
|
73 |
@Override |
|
67 | 74 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
68 | 75 |
try { |
69 | 76 |
LayoutKeyEvent.cut(getLayout()); |
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/PasteLayoutMenuEntry.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
public class PasteLayoutMenuEntry extends AbstractLayoutContextMenuAction { |
36 | 36 |
|
37 |
@Override |
|
37 | 38 |
public String getGroup() { |
38 | 39 |
return "copypaste"; |
39 | 40 |
} |
40 | 41 |
|
42 |
@Override |
|
41 | 43 |
public int getGroupOrder() { |
42 | 44 |
return 4; |
43 | 45 |
} |
44 | 46 |
|
47 |
@Override |
|
45 | 48 |
public int getOrder() { |
46 |
return 2;
|
|
49 |
return 300;
|
|
47 | 50 |
} |
48 | 51 |
|
52 |
@Override |
|
49 | 53 |
public String getText() { |
50 | 54 |
return PluginServices.getText(this, "paste"); |
51 | 55 |
} |
52 | 56 |
|
57 |
@Override |
|
53 | 58 |
public boolean isEnabled(LayoutContext layoutContext, |
54 | 59 |
IFFrame[] selectedFrames) { |
55 | 60 |
return true; |
56 | 61 |
} |
57 | 62 |
|
63 |
@Override |
|
58 | 64 |
public boolean isVisible(LayoutContext layoutContext, |
59 | 65 |
IFFrame[] selectedFrames) { |
60 | 66 |
if (LayoutKeyEvent.hasSelection() |
... | ... | |
64 | 70 |
return false; |
65 | 71 |
} |
66 | 72 |
|
73 |
@Override |
|
67 | 74 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
68 | 75 |
try { |
69 | 76 |
LayoutKeyEvent.paste(getLayout()); |
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/CopyLayoutMenuEntry.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
public class CopyLayoutMenuEntry extends AbstractLayoutContextMenuAction { |
36 | 36 |
|
37 |
@Override |
|
37 | 38 |
public String getGroup() { |
38 | 39 |
return "copypaste"; |
39 | 40 |
} |
40 | 41 |
|
42 |
@Override |
|
41 | 43 |
public int getGroupOrder() { |
42 | 44 |
return 4; |
43 | 45 |
} |
44 | 46 |
|
47 |
@Override |
|
45 | 48 |
public int getOrder() { |
46 |
return 1; |
|
49 |
return 100;
|
|
47 | 50 |
} |
48 | 51 |
|
52 |
@Override |
|
49 | 53 |
public String getText() { |
50 | 54 |
return PluginServices.getText(this, "copy"); |
51 | 55 |
} |
52 | 56 |
|
57 |
@Override |
|
53 | 58 |
public boolean isEnabled(LayoutContext layoutContext, |
54 | 59 |
IFFrame[] selectedFrames) { |
55 | 60 |
return true; |
56 | 61 |
} |
57 | 62 |
|
63 |
@Override |
|
58 | 64 |
public boolean isVisible(LayoutContext layoutContext, |
59 | 65 |
IFFrame[] selectedFrames) { |
60 | 66 |
if (selectedFrames.length == 1 |
... | ... | |
64 | 70 |
return false; |
65 | 71 |
} |
66 | 72 |
|
73 |
@Override |
|
67 | 74 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
68 | 75 |
try { |
69 | 76 |
LayoutKeyEvent.copy(getLayout()); |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/extension/LayoutMainExtension.java | ||
---|---|---|
96 | 96 |
import org.gvsig.filedialogchooser.FileDialogChooserManager; |
97 | 97 |
import org.gvsig.gui.beans.swing.JFileChooser; |
98 | 98 |
import org.gvsig.i18n.Messages; |
99 |
import org.gvsig.layout.mapbox.MapBoxUtils; |
|
100 |
import org.gvsig.layout.mapbox.panel.menu.AddColumnMapBoxMenuEntry; |
|
101 |
import org.gvsig.layout.mapbox.panel.menu.AddRowMapBoxMenuEntry; |
|
102 |
import org.gvsig.layout.mapbox.panel.menu.CombineCellsMapBoxMenuEntry; |
|
103 |
import org.gvsig.layout.mapbox.panel.menu.InsertColumnMapBoxMenuEntry; |
|
104 |
import org.gvsig.layout.mapbox.panel.menu.InsertRowMapBoxMenuEntry; |
|
105 |
import org.gvsig.layout.mapbox.panel.menu.RemoveCellsMapBoxMenuEntry; |
|
106 |
import org.gvsig.layout.mapbox.panel.menu.RemoveColumnMapBoxMenuEntry; |
|
107 |
import org.gvsig.layout.mapbox.panel.menu.RemoveRowMapBoxMenuEntry; |
|
108 |
import org.gvsig.layout.mapbox.panel.menu.SplitCellsHorizontallyMapBoxMenuEntry; |
|
109 |
import org.gvsig.layout.mapbox.panel.menu.SplitCellsVerticallyMapBoxMenuEntry; |
|
110 | 99 |
import org.gvsig.tools.ToolsLocator; |
111 | 100 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
112 | 101 |
import org.gvsig.tools.i18n.I18nManager; |
... | ... | |
130 | 119 |
private static final Logger logger = LoggerFactory |
131 | 120 |
.getLogger(FFrameView.class); |
132 | 121 |
|
133 |
private String templatesPath; |
|
134 |
|
|
135 | 122 |
public static final String LAYOUT_TEMPLATE_FILECHOOSER_ID = "LAYOUT_TEMPLATE_FILECHOOSER_ID"; |
136 | 123 |
|
137 | 124 |
private void registerIcons() { |
... | ... | |
360 | 347 |
layoutManager.registerFFrameDialog( |
361 | 348 |
FFrameGrid.PERSISTENCE_DEFINITION_NAME, FFrameGridDialog.class); |
362 | 349 |
|
363 |
MapBoxUtils.register(layoutManager); |
|
364 |
|
|
365 | 350 |
FFrame.initializeIcons(); |
366 | 351 |
FFrameTable.initializeIcons(); |
367 | 352 |
} |
... | ... | |
393 | 378 |
PositionLayoutMenuEntry.class); |
394 | 379 |
layoutManager.registerLayoutMenuAction("Refresh", |
395 | 380 |
RefreshLayoutMenuEntry.class); |
396 |
layoutManager.registerLayoutMenuAction("CombineCells", |
|
397 |
CombineCellsMapBoxMenuEntry.class); |
|
398 |
layoutManager.registerLayoutMenuAction("SplitCellsVertically", |
|
399 |
SplitCellsVerticallyMapBoxMenuEntry.class); |
|
400 |
layoutManager.registerLayoutMenuAction("SplitCellsHorizontally", |
|
401 |
SplitCellsHorizontallyMapBoxMenuEntry.class); |
|
402 |
layoutManager.registerLayoutMenuAction("InsertColumnMapBoxMenuEntry", |
|
403 |
InsertColumnMapBoxMenuEntry.class); |
|
404 |
layoutManager.registerLayoutMenuAction("AddColumnMapBoxMenuEntry", |
|
405 |
AddColumnMapBoxMenuEntry.class); |
|
406 |
layoutManager.registerLayoutMenuAction("InsertRowMapBoxMenuEntry", |
|
407 |
InsertRowMapBoxMenuEntry.class); |
|
408 |
layoutManager.registerLayoutMenuAction("AddRowMapBoxMenuEntry", |
|
409 |
AddRowMapBoxMenuEntry.class); |
|
410 |
layoutManager.registerLayoutMenuAction("RemoveColumnMapBoxMenuEntry", |
|
411 |
RemoveColumnMapBoxMenuEntry.class); |
|
412 |
layoutManager.registerLayoutMenuAction("RemoveRowMapBoxMenuEntry", |
|
413 |
RemoveRowMapBoxMenuEntry.class); |
|
414 |
layoutManager.registerLayoutMenuAction("RemoveCellsMapBoxMenuEntry", |
|
415 |
RemoveCellsMapBoxMenuEntry.class); |
|
416 | 381 |
|
417 | 382 |
} |
418 | 383 |
|
Also available in: Unified diff