Revision 9392
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/FFrameGroupExtension.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig; |
|
42 |
|
|
43 |
import com.iver.andami.PluginServices; |
|
44 |
import com.iver.andami.plugins.Extension; |
|
45 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
46 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
47 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameTable; |
|
48 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
|
49 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameGroupSelectable; |
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
/** |
|
54 |
* Extensi?n preparada para controlar las opciones que se pueden realizar sobre |
|
55 |
* una tabla a?adida en el Layout. |
|
56 |
* |
|
57 |
* @author Vicente Caballero Navarro |
|
58 |
*/ |
|
59 |
public class FFrameGroupExtension extends Extension { |
|
60 |
private Layout layout = null; |
|
61 |
|
|
62 |
/** |
|
63 |
* @see com.iver.andami.plugins.IExtension#initialize() |
|
64 |
*/ |
|
65 |
public void initialize() { |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
|
70 |
*/ |
|
71 |
public void execute(String s) { |
|
72 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
73 |
IFFrame[] fframes = layout.getFFrameSelected(); |
|
74 |
|
|
75 |
if (s.equals("NOEDITGROUP")) { |
|
76 |
for (int i = 0; i < fframes.length; i++) { |
|
77 |
if (fframes[i] instanceof IFFrameGroupSelectable) { |
|
78 |
IFFrameGroupSelectable fframeTable=(IFFrameGroupSelectable)fframes[i]; |
|
79 |
fframeTable.selectFFrame(false); |
|
80 |
} |
|
81 |
} |
|
82 |
layout.setEditGroup(false); |
|
83 |
} else if (s.equals("JOIN")) { |
|
84 |
for (int i = 0; i < fframes.length; i++) { |
|
85 |
if (fframes[i] instanceof IFFrameGroupSelectable) { |
|
86 |
IFFrameGroupSelectable fframeTable=(IFFrameGroupSelectable)fframes[i].cloneFFrame(layout); |
|
87 |
IFFrame newFFrame=fframeTable.joinFFrame(); |
|
88 |
if (newFFrame !=null){ |
|
89 |
layout.getEFS().modifyFFrame((IFFrame)fframes[i],(IFFrame)fframeTable); |
|
90 |
layout.updateFFrames(); |
|
91 |
layout.refresh(); |
|
92 |
} |
|
93 |
|
|
94 |
} |
|
95 |
} |
|
96 |
} else if (s.equals("EDITGROUP")) { |
|
97 |
for (int i = 0; i < fframes.length; i++) { |
|
98 |
if (fframes[i] instanceof IFFrameGroupSelectable) { |
|
99 |
IFFrameGroupSelectable fframeTable=(IFFrameGroupSelectable)fframes[i]; |
|
100 |
fframeTable.selectFFrame(true); |
|
101 |
} |
|
102 |
} |
|
103 |
layout.setEditGroup(true); |
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
/** |
|
108 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
|
109 |
*/ |
|
110 |
public boolean isEnabled() { |
|
111 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
112 |
if (!layout.isEditable()) |
|
113 |
return false; |
|
114 |
return true; |
|
115 |
} |
|
116 |
|
|
117 |
/** |
|
118 |
* @see com.iver.andami.plugins.IExtension#isVisible() |
|
119 |
*/ |
|
120 |
public boolean isVisible() { |
|
121 |
IWindow view = PluginServices.getMDIManager().getActiveWindow(); |
|
122 |
if (view instanceof Layout) { |
|
123 |
Layout l = (Layout) view; |
|
124 |
IFFrame[] fframes = l.getFFrameSelected(); |
|
125 |
|
|
126 |
for (int i = 0; i < fframes.length; i++) { |
|
127 |
if (fframes[i] instanceof FFrameTable) { |
|
128 |
return true; |
|
129 |
} |
|
130 |
} |
|
131 |
} |
|
132 |
return false; |
|
133 |
} |
|
134 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ExportLayoutExtension.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.1 2006-11-06 15:14:52 jaume |
|
46 |
* Revision 1.2 2006-12-20 14:40:37 caballero |
|
47 |
* Remodelado Layout |
|
48 |
* |
|
49 |
* Revision 1.1 2006/11/06 15:14:52 jaume |
|
47 | 50 |
* new extension for pdf and ps |
48 | 51 |
* |
49 | 52 |
* |
... | ... | |
53 | 56 |
import com.iver.andami.PluginServices; |
54 | 57 |
import com.iver.andami.plugins.Extension; |
55 | 58 |
import com.iver.andami.ui.mdiManager.IWindow; |
56 |
import com.iver.cit.gvsig.gui.layout.Layout;
|
|
59 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout;
|
|
57 | 60 |
/** |
58 | 61 |
* Extension for exporting the layout to PDF or PostScript. |
59 | 62 |
* |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutEditVertexExtension.java | ||
---|---|---|
45 | 45 |
import com.iver.andami.PluginServices; |
46 | 46 |
import com.iver.andami.plugins.Extension; |
47 | 47 |
import com.iver.andami.ui.mdiManager.IWindow; |
48 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
49 | 48 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutFunctions; |
49 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
50 | 50 |
|
51 | 51 |
|
52 | 52 |
/** |
... | ... | |
74 | 74 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
75 | 75 |
|
76 | 76 |
logger.debug("Comand : " + s); |
77 |
boolean insertGroupPosibility = false; |
|
78 | 77 |
if (s.compareTo("VERTEX") == 0) { |
79 |
layout.setTool(Layout.EDIT);
|
|
78 |
layout.getLayoutControl().setTool("layoutedit");
|
|
80 | 79 |
} |
81 |
if (layout.isEditGroup() && insertGroupPosibility) { |
|
82 |
FLayoutFunctions funtions = new FLayoutFunctions(layout); |
|
83 |
funtions.addFFrame(); |
|
84 |
} |
|
85 |
} |
|
80 |
} |
|
86 | 81 |
|
87 | 82 |
/** |
88 | 83 |
* DOCUMENT ME! |
... | ... | |
98 | 93 |
|
99 | 94 |
if (f instanceof Layout) { |
100 | 95 |
Layout layout=(Layout)f; |
101 |
if (layout.isEditable()){ |
|
96 |
if (layout.getLayoutContext().isEditable()){
|
|
102 | 97 |
return true; |
103 | 98 |
// IFFrame[] fframes = layout.getFFrames(); |
104 | 99 |
// for (int i = 0; i < fframes.length; i++) { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutEditableControls.java | ||
---|---|---|
53 | 53 |
import com.iver.andami.PluginServices; |
54 | 54 |
import com.iver.andami.plugins.Extension; |
55 | 55 |
import com.iver.andami.ui.mdiManager.IWindow; |
56 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
57 | 56 |
import com.iver.cit.gvsig.project.documents.layout.LayoutKeyEvent; |
57 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
58 | 58 |
|
59 | 59 |
|
60 | 60 |
/** |
... | ... | |
140 | 140 |
*/ |
141 | 141 |
public boolean isEnabled() { |
142 | 142 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
143 |
if (layout.isEditable()) |
|
143 |
if (layout.getLayoutContext().isEditable())
|
|
144 | 144 |
return true; |
145 | 145 |
return false; |
146 | 146 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/Print.java | ||
---|---|---|
71 | 71 |
import com.iver.andami.PluginServices; |
72 | 72 |
import com.iver.andami.plugins.Extension; |
73 | 73 |
import com.iver.andami.ui.mdiManager.IWindow; |
74 |
import com.iver.cit.gvsig.gui.layout.Attributes; |
|
75 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
74 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
|
76 | 75 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutUtilities; |
76 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
77 | 77 |
|
78 | 78 |
|
79 | 79 |
/** |
... | ... | |
126 | 126 |
try { |
127 | 127 |
PluginServices.backgroundExecution(new Runnable() { |
128 | 128 |
public void run() { |
129 |
if (l.getAtributes().getType() == Attributes.CUSTOM) { |
|
129 |
if (l.getLayoutContext().getAtributes().getType() == Attributes.CUSTOM) {
|
|
130 | 130 |
l.showPrintDialog(printerJob); |
131 | 131 |
} else { |
132 | 132 |
l.showPrintDialog(null); |
... | ... | |
140 | 140 |
e); |
141 | 141 |
} |
142 | 142 |
} |
143 |
|
|
143 |
|
|
144 | 144 |
public void setLayout(Layout l){ |
145 | 145 |
this.l=l; |
146 | 146 |
} |
... | ... | |
218 | 218 |
(double) 72 / (double) (Attributes.DPI)); |
219 | 219 |
System.err.println("Clip 2 =" + g2d.getClip()); |
220 | 220 |
|
221 |
if (l.getAtributes().isMargin()) { |
|
222 |
g2d.setClip((int) (l.getRect().getMinX() + |
|
223 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[2], |
|
224 |
l.getAT())), |
|
225 |
(int) (l.getRect().getMinY() + |
|
226 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[0], |
|
227 |
l.getAT())), |
|
228 |
(int) (l.getRect().getWidth() - |
|
229 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[2] + |
|
230 |
l.getAtributes().m_area[3], l.getAT())),
|
|
231 |
(int) (l.getRect().getHeight() - |
|
232 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[0] + |
|
233 |
l.getAtributes().m_area[1], l.getAT())));
|
|
221 |
if (l.getLayoutContext().getAtributes().isMargin()) {
|
|
222 |
g2d.setClip((int) (l.getLayoutControl().getRect().getMinX() +
|
|
223 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[2],
|
|
224 |
l.getLayoutControl().getAT())),
|
|
225 |
(int) (l.getLayoutControl().getRect().getMinY() +
|
|
226 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[0],
|
|
227 |
l.getLayoutControl().getAT())),
|
|
228 |
(int) (l.getLayoutControl().getRect().getWidth() -
|
|
229 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[2] +
|
|
230 |
l.getLayoutContext().getAtributes().m_area[3], l.getLayoutControl().getAT())),
|
|
231 |
(int) (l.getLayoutControl().getRect().getHeight() -
|
|
232 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[0] +
|
|
233 |
l.getLayoutContext().getAtributes().m_area[1], l.getLayoutControl().getAT())));
|
|
234 | 234 |
} else { |
235 | 235 |
/* |
236 | 236 |
Rectangle rec=(Rectangle)g2d.getClipBounds(); |
... | ... | |
270 | 270 |
//paper = format.getPaper(); |
271 | 271 |
|
272 | 272 |
try { |
273 |
if (layout.getAtributes().getType() == Attributes.CUSTOM) { |
|
273 |
if (layout.getLayoutContext().getAtributes().getType() == Attributes.CUSTOM) {
|
|
274 | 274 |
layout.showPrintDialog(printerJob); |
275 | 275 |
} else { |
276 | 276 |
layout.showPrintDialog(null); |
... | ... | |
295 | 295 |
com.iver.cit.gvsig.Print.class)); |
296 | 296 |
|
297 | 297 |
//Actualizar attributes |
298 |
PrintRequestAttributeSet att = layout.getAtributes() |
|
298 |
PrintRequestAttributeSet att = layout.getLayoutContext().getAtributes()
|
|
299 | 299 |
.toPrintAttributes(); |
300 | 300 |
DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; |
301 | 301 |
|
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutCommandStackExtension.java | ||
---|---|---|
43 | 43 |
import com.iver.andami.PluginServices; |
44 | 44 |
import com.iver.andami.plugins.Extension; |
45 | 45 |
import com.iver.cit.gvsig.gui.command.CommandStackDialog; |
46 |
import com.iver.cit.gvsig.gui.layout.Layout;
|
|
46 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout;
|
|
47 | 47 |
|
48 | 48 |
public class LayoutCommandStackExtension extends Extension{ |
49 | 49 |
private Layout layout=null; |
... | ... | |
55 | 55 |
layout=(Layout)PluginServices.getMDIManager().getActiveWindow(); |
56 | 56 |
if (s.equals("COMMANDSTACK")) { |
57 | 57 |
CommandStackDialog csd=new CommandStackDialog(); |
58 |
csd.setModel(layout.getEFS().getCommandRecord()); |
|
59 |
layout.getEFS().getCommandRecord().addCommandListener(layout); |
|
58 |
csd.setModel(layout.getLayoutContext().getEFS().getCommandRecord());
|
|
59 |
layout.getLayoutContext().getEFS().getCommandRecord().addCommandListener(layout);
|
|
60 | 60 |
PluginServices.getMDIManager().addWindow(csd); |
61 | 61 |
} |
62 | 62 |
} |
63 | 63 |
|
64 | 64 |
public boolean isEnabled() { |
65 | 65 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
66 |
if (layout.isEditable()) |
|
66 |
if (layout.getLayoutContext().isEditable())
|
|
67 | 67 |
return true; |
68 | 68 |
return false; |
69 | 69 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutUndoExtension.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import com.iver.andami.PluginServices; |
44 | 44 |
import com.iver.andami.plugins.Extension; |
45 |
import com.iver.cit.gvsig.gui.layout.Layout;
|
|
45 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout;
|
|
46 | 46 |
|
47 | 47 |
public class LayoutUndoExtension extends Extension{ |
48 | 48 |
|
... | ... | |
53 | 53 |
public void execute(String actionCommand) { |
54 | 54 |
Layout layout=(Layout)PluginServices.getMDIManager().getActiveWindow(); |
55 | 55 |
if (actionCommand.equals("UNDO")){ |
56 |
layout.getEFS().undo(); |
|
57 |
layout.updateFFrames(); |
|
58 |
layout.refresh(); |
|
56 |
layout.getLayoutContext().getEFS().undo();
|
|
57 |
layout.getLayoutContext().updateFFrames();
|
|
58 |
layout.getLayoutControl().refresh();
|
|
59 | 59 |
} |
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
public boolean isEnabled() { |
63 | 63 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof Layout){ |
64 | 64 |
Layout layout=(Layout)PluginServices.getMDIManager().getActiveWindow(); |
65 |
if (layout.getEFS().moreUndoCommands() && layout.isEditable())
|
|
65 |
if (layout.getLayoutContext().getEFS().moreUndoCommands() && layout.getLayoutContext().isEditable())
|
|
66 | 66 |
return true; |
67 | 67 |
} |
68 | 68 |
return false; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutControls.java | ||
---|---|---|
61 | 61 |
import com.iver.andami.preferences.IPreference; |
62 | 62 |
import com.iver.andami.preferences.IPreferenceExtension; |
63 | 63 |
import com.iver.andami.ui.mdiManager.IWindow; |
64 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
65 | 64 |
import com.iver.cit.gvsig.gui.preferencespage.LayoutPage; |
66 | 65 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutZooms; |
66 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
67 | 67 |
import com.iver.utiles.GenericFileFilter; |
68 | 68 |
|
69 | 69 |
|
... | ... | |
87 | 87 |
logger.debug("Comand : " + s); |
88 | 88 |
|
89 | 89 |
if (s.equals("PAN")) { |
90 |
layout.setTool(Layout.PAN);
|
|
90 |
layout.getLayoutControl().setTool("layoutpan");
|
|
91 | 91 |
} else if (s.equals("ZOOM_IN")) { |
92 |
layout.setTool(Layout.ZOOM_MAS);
|
|
92 |
layout.getLayoutControl().setTool("layoutzoomin");
|
|
93 | 93 |
} else if (s.equals("ZOOM_OUT")) { |
94 |
layout.setTool(Layout.ZOOM_MENOS);
|
|
94 |
layout.getLayoutControl().setTool("layoutzoomout");
|
|
95 | 95 |
} else if (s.equals("FULL")) { |
96 |
layout.fullRect(); |
|
96 |
layout.getLayoutControl().fullRect();
|
|
97 | 97 |
} else if (s.equals("REALZOOM")) { |
98 | 98 |
zooms.realZoom(); |
99 | 99 |
} else if (s.equals("ZOOMOUT")) { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java | ||
---|---|---|
74 | 74 |
import com.iver.andami.ui.mdiManager.IWindow; |
75 | 75 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
76 | 76 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
77 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
78 | 77 |
import com.iver.cit.gvsig.project.Project; |
79 | 78 |
import com.iver.cit.gvsig.project.ProjectFactory; |
80 | 79 |
import com.iver.cit.gvsig.project.documents.exceptions.OpenException; |
81 | 80 |
import com.iver.cit.gvsig.project.documents.gui.ProjectWindow; |
82 | 81 |
import com.iver.cit.gvsig.project.documents.layout.ProjectMap; |
83 | 82 |
import com.iver.cit.gvsig.project.documents.layout.ProjectMapFactory; |
83 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
84 | 84 |
import com.iver.cit.gvsig.project.documents.table.ProjectTableFactory; |
85 | 85 |
import com.iver.cit.gvsig.project.documents.view.ProjectView; |
86 | 86 |
import com.iver.cit.gvsig.project.documents.view.ProjectViewFactory; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/CopyPasteExtension.java | ||
---|---|---|
33 | 33 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
34 | 34 |
import com.iver.cit.gvsig.fmap.layers.XMLException; |
35 | 35 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData; |
36 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameView; |
|
37 | 36 |
import com.iver.cit.gvsig.project.Project; |
38 | 37 |
import com.iver.cit.gvsig.project.documents.ProjectDocument; |
39 | 38 |
import com.iver.cit.gvsig.project.documents.contextMenu.AbstractDocumentContextMenuAction; |
... | ... | |
41 | 40 |
import com.iver.cit.gvsig.project.documents.exceptions.SaveException; |
42 | 41 |
import com.iver.cit.gvsig.project.documents.layout.ProjectMap; |
43 | 42 |
import com.iver.cit.gvsig.project.documents.layout.ProjectMapFactory; |
43 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameView; |
|
44 | 44 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
45 | 45 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
46 | 46 |
import com.iver.cit.gvsig.project.documents.table.ProjectTableFactory; |
... | ... | |
73 | 73 |
extensionPoints.add("View_TocActions","Cut","Cut selectes layers to system clipboard", cut); |
74 | 74 |
extensionPoints.add("View_TocActions","Paste","Paste layers from system clipboard",paste); |
75 | 75 |
|
76 |
|
|
76 |
|
|
77 | 77 |
//FPopupMenu.addEntry(copy); |
78 | 78 |
//FPopupMenu.addEntry(cut); |
79 | 79 |
//FPopupMenu.addEntry(paste); |
80 |
|
|
81 | 80 |
|
81 |
|
|
82 | 82 |
// ProjectWindow |
83 | 83 |
CopyProjectElement copyProjectElement = new CopyProjectElement(); |
84 | 84 |
CutProjectElement cutProjectElement = new CutProjectElement(); |
... | ... | |
1026 | 1026 |
|
1027 | 1027 |
|
1028 | 1028 |
private boolean addToXMLMapDependencies(ProjectMap map, XMLEntity xmlViews,XMLEntity xmlTables, XMLEntity xmlDataSources) { |
1029 |
IFFrame[] components = map.getModel().getFFrames(); |
|
1029 |
IFFrame[] components = map.getModel().getLayoutContext().getFFrames();
|
|
1030 | 1030 |
for (int i=0; i < components.length; i++) { |
1031 | 1031 |
if (components[i] instanceof FFrameView) { |
1032 | 1032 |
ProjectView view = ((FFrameView)components[i]).getView(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TagExtension.java | ||
---|---|---|
49 | 49 |
import com.iver.andami.PluginServices; |
50 | 50 |
import com.iver.andami.plugins.Extension; |
51 | 51 |
import com.iver.andami.ui.mdiManager.IWindow; |
52 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
53 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameText; |
|
52 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameText; |
|
54 | 53 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
54 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
55 | 55 |
|
56 | 56 |
|
57 | 57 |
public class TagExtension extends Extension{ |
... | ... | |
79 | 79 |
// asignar el tag a los elementos seleccionados |
80 | 80 |
if (s.equals("SET_TAG")) |
81 | 81 |
{ |
82 |
IFFrame[] selectedFrames = layout.getFFrameSelected(); |
|
82 |
IFFrame[] selectedFrames = layout.getLayoutContext().getFFrameSelected();
|
|
83 | 83 |
if (selectedFrames.length > 0) |
84 | 84 |
{ |
85 | 85 |
String defaultStr = ""; |
... | ... | |
108 | 108 |
// } |
109 | 109 |
// } |
110 | 110 |
layout.setShowIconTag(true); |
111 |
layout.refresh(); |
|
111 |
layout.getLayoutControl().refresh();
|
|
112 | 112 |
} |
113 | 113 |
} |
114 | 114 |
|
... | ... | |
125 | 125 |
if (f.getClass() == Layout.class) |
126 | 126 |
{ |
127 | 127 |
layout = (Layout) f; |
128 |
IFFrame[] selectedFrames = layout.getFFrameSelected(); |
|
128 |
IFFrame[] selectedFrames = layout.getLayoutContext().getFFrameSelected();
|
|
129 | 129 |
if (selectedFrames == null) return false; |
130 | 130 |
return (selectedFrames.length > 0); |
131 | 131 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/FFrameLegendExtension.java | ||
---|---|---|
43 | 43 |
import com.iver.andami.PluginServices; |
44 | 44 |
import com.iver.andami.plugins.Extension; |
45 | 45 |
import com.iver.andami.ui.mdiManager.IWindow; |
46 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
47 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend; |
|
48 | 46 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutGraphics; |
47 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameLegend; |
|
49 | 48 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
49 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
50 | 50 |
|
51 | 51 |
|
52 | 52 |
|
... | ... | |
82 | 82 |
*/ |
83 | 83 |
public boolean isEnabled() { |
84 | 84 |
Layout l = (Layout)PluginServices.getMDIManager().getActiveWindow(); |
85 |
IFFrame[] fframes = l.getFFrameSelected(); |
|
86 |
if (!l.isEditable()) |
|
85 |
IFFrame[] fframes = l.getLayoutContext().getFFrameSelected();
|
|
86 |
if (!l.getLayoutContext().isEditable())
|
|
87 | 87 |
return false; |
88 | 88 |
for (int i = 0; i < fframes.length; i++) { |
89 | 89 |
if (fframes[i] instanceof FFrameLegend) { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutInsertToolsExtension.java | ||
---|---|---|
45 | 45 |
import com.iver.andami.PluginServices; |
46 | 46 |
import com.iver.andami.plugins.Extension; |
47 | 47 |
import com.iver.andami.ui.mdiManager.IWindow; |
48 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
49 | 48 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutFunctions; |
49 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
50 | 50 |
|
51 | 51 |
|
52 | 52 |
/** |
... | ... | |
70 | 70 |
logger.debug("Comand : " + s); |
71 | 71 |
boolean insertGroupPosibility=false; |
72 | 72 |
if (s.equals("SELECT")) { |
73 |
layout.setTool(Layout.SELECT);
|
|
73 |
layout.getLayoutControl().setTool("layoutselect");
|
|
74 | 74 |
} else if (s.equals("RECTANGLEVIEW")) { |
75 |
layout.setTool(Layout.RECTANGLEVIEW);
|
|
75 |
layout.getLayoutControl().setTool("layoutaddview");
|
|
76 | 76 |
insertGroupPosibility=true; |
77 | 77 |
} else if (s.equals("RECTANGLEOVERVIEW")) { |
78 |
layout.setTool(Layout.RECTANGLEOVERVIEW);
|
|
78 |
layout.getLayoutControl().setTool("layoutaddoverview");
|
|
79 | 79 |
insertGroupPosibility=true; |
80 | 80 |
} else if (s.equals("RECTANGLEPICTURE")) { |
81 |
layout.setTool(Layout.RECTANGLEPICTURE);
|
|
81 |
layout.getLayoutControl().setTool("layoutaddpicture");
|
|
82 | 82 |
insertGroupPosibility=true; |
83 | 83 |
} else if (s.equals("RECTANGLESCALEBAR")) { |
84 |
layout.setTool(Layout.RECTANGLESCALEBAR);
|
|
84 |
layout.getLayoutControl().setTool("layoutaddscale");
|
|
85 | 85 |
insertGroupPosibility=true; |
86 | 86 |
} else if (s.equals("RECTANGLELEGEND")) { |
87 |
layout.setTool(Layout.RECTANGLELEGEND);
|
|
87 |
layout.getLayoutControl().setTool("layoutaddlegend");
|
|
88 | 88 |
insertGroupPosibility=true; |
89 | 89 |
} else if (s.equals("RECTANGLETEXT")) { |
90 |
layout.setTool(Layout.RECTANGLETEXT);
|
|
90 |
layout.getLayoutControl().setTool("layoutaddtext");
|
|
91 | 91 |
insertGroupPosibility=true; |
92 | 92 |
} else if (s.equals("RECTANGLENORTH")) { |
93 |
layout.setTool(Layout.RECTANGLENORTH);
|
|
93 |
layout.getLayoutControl().setTool("layoutaddnorth");
|
|
94 | 94 |
insertGroupPosibility=true; |
95 | 95 |
} else if (s.equals("RECTANGLEBOX")) { |
96 |
layout.setTool(Layout.RECTANGLEBOX);
|
|
96 |
layout.getLayoutControl().setTool("layoutaddbox");
|
|
97 | 97 |
insertGroupPosibility=true; |
98 | 98 |
} else if (s.equals("POINT")) { |
99 |
layout.setTool(Layout.POINT);
|
|
99 |
layout.getLayoutControl().setTool("layoutaddpoint");
|
|
100 | 100 |
} else if (s.equals("LINE")) { |
101 |
layout.setTool(Layout.LINE);
|
|
101 |
layout.getLayoutControl().setTool("layoutaddline");
|
|
102 | 102 |
} else if (s.equals("POLYLINE")) { |
103 |
layout.setTool(Layout.POLYLINE);
|
|
103 |
layout.getLayoutControl().setTool("layoutaddpolyline");
|
|
104 | 104 |
} else if (s.equals("CIRCLE")) { |
105 |
layout.setTool(Layout.CIRCLE);
|
|
105 |
layout.getLayoutControl().setTool("layoutaddcircle");
|
|
106 | 106 |
} else if (s.equals("RECTANGLESIMPLE")) { |
107 |
layout.setTool(Layout.RECTANGLESIMPLE);
|
|
107 |
layout.getLayoutControl().setTool("layoutaddrectangle");
|
|
108 | 108 |
} else if (s.equals("POLYGON")) { |
109 |
layout.setTool(Layout.POLYGON);
|
|
109 |
layout.getLayoutControl().setTool("layoutaddpolygon");
|
|
110 | 110 |
} else if (s.equals("REMOVE")){ |
111 |
layout.delFFrameSelected(); |
|
112 |
layout.refresh(); |
|
111 |
layout.getLayoutContext().delFFrameSelected();
|
|
112 |
layout.getLayoutControl().refresh();
|
|
113 | 113 |
} |
114 |
if (layout.isEditGroup() && insertGroupPosibility){ |
|
115 |
FLayoutFunctions funtions=new FLayoutFunctions(layout); |
|
116 |
funtions.addFFrame(); |
|
117 |
} |
|
118 | 114 |
} |
119 | 115 |
|
120 | 116 |
|
... | ... | |
126 | 122 |
} |
127 | 123 |
|
128 | 124 |
if (f instanceof Layout) { |
129 |
return ((Layout) f).isEditable(); |
|
125 |
return ((Layout) f).getLayoutContext().isEditable();
|
|
130 | 126 |
} |
131 | 127 |
|
132 | 128 |
return false; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutRedoExtension.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import com.iver.andami.PluginServices; |
44 | 44 |
import com.iver.andami.plugins.Extension; |
45 |
import com.iver.cit.gvsig.gui.layout.Layout;
|
|
45 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout;
|
|
46 | 46 |
|
47 | 47 |
public class LayoutRedoExtension extends Extension{ |
48 | 48 |
|
... | ... | |
53 | 53 |
public void execute(String actionCommand) { |
54 | 54 |
Layout layout=(Layout)PluginServices.getMDIManager().getActiveWindow(); |
55 | 55 |
if (actionCommand.equals("REDO")){ |
56 |
layout.getEFS().redo(); |
|
57 |
layout.updateFFrames(); |
|
58 |
layout.refresh(); |
|
56 |
layout.getLayoutContext().getEFS().redo();
|
|
57 |
layout.getLayoutContext().updateFFrames();
|
|
58 |
layout.getLayoutControl().refresh();
|
|
59 | 59 |
} |
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
public boolean isEnabled() { |
63 | 63 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof Layout){ |
64 | 64 |
Layout layout=(Layout)PluginServices.getMDIManager().getActiveWindow(); |
65 |
if (layout.getEFS().moreRedoCommands() && layout.isEditable())
|
|
65 |
if (layout.getLayoutContext().getEFS().moreRedoCommands() && layout.getLayoutContext().isEditable())
|
|
66 | 66 |
return true; |
67 | 67 |
} |
68 | 68 |
return false; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/gui/ViewProperties.java | ||
---|---|---|
55 | 55 |
import com.iver.andami.PluginServices; |
56 | 56 |
import com.iver.andami.ui.mdiManager.SingletonWindow; |
57 | 57 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
58 |
import com.iver.cit.gvsig.gui.layout.Attributes; |
|
59 | 58 |
import com.iver.cit.gvsig.gui.panels.CRSSelectPanel; |
59 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
|
60 | 60 |
import com.iver.cit.gvsig.project.documents.view.ProjectView; |
61 | 61 |
/** |
62 | 62 |
* Dialogo donde se muestran las propiedades de una vista |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/EventsHandler.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 27-jul-2004 |
|
3 |
* |
|
4 |
*/ |
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
6 |
* |
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
8 |
* |
|
9 |
* This program is free software; you can redistribute it and/or |
|
10 |
* modify it under the terms of the GNU General Public License |
|
11 |
* as published by the Free Software Foundation; either version 2 |
|
12 |
* of the License, or (at your option) any later version. |
|
13 |
* |
|
14 |
* This program is distributed in the hope that it will be useful, |
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
* GNU General Public License for more details. |
|
18 |
* |
|
19 |
* You should have received a copy of the GNU General Public License |
|
20 |
* along with this program; if not, write to the Free Software |
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
22 |
* |
|
23 |
* For more information, contact: |
|
24 |
* |
|
25 |
* Generalitat Valenciana |
|
26 |
* Conselleria d'Infraestructures i Transport |
|
27 |
* Av. Blasco Ib??ez, 50 |
|
28 |
* 46010 VALENCIA |
|
29 |
* SPAIN |
|
30 |
* |
|
31 |
* +34 963862235 |
|
32 |
* gvsig@gva.es |
|
33 |
* www.gvsig.gva.es |
|
34 |
* |
|
35 |
* or |
|
36 |
* |
|
37 |
* IVER T.I. S.A |
|
38 |
* Salamanca 50 |
|
39 |
* 46005 Valencia |
|
40 |
* Spain |
|
41 |
* |
|
42 |
* +34 963163400 |
|
43 |
* dac@iver.es |
|
44 |
*/ |
|
45 |
package com.iver.cit.gvsig.project.documents.layout; |
|
46 |
|
|
47 |
import java.awt.Cursor; |
|
48 |
import java.awt.Image; |
|
49 |
import java.awt.Point; |
|
50 |
import java.awt.event.ActionEvent; |
|
51 |
import java.awt.event.ActionListener; |
|
52 |
import java.awt.event.ComponentEvent; |
|
53 |
import java.awt.event.ComponentListener; |
|
54 |
import java.awt.event.MouseEvent; |
|
55 |
import java.awt.event.MouseListener; |
|
56 |
import java.awt.event.MouseMotionListener; |
|
57 |
import java.awt.geom.Point2D; |
|
58 |
import java.util.ArrayList; |
|
59 |
|
|
60 |
import com.iver.andami.PluginServices; |
|
61 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
62 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
|
63 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameEditableVertex; |
|
64 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameGroupSelectable; |
|
65 |
import com.iver.cit.gvsig.project.documents.layout.gui.Popupmenu; |
|
66 |
|
|
67 |
|
|
68 |
/** |
|
69 |
* Eventos que se realizan sobre el Layout. |
|
70 |
* |
|
71 |
* @author Vicente Caballero Navarro |
|
72 |
*/ |
|
73 |
public class EventsHandler implements ActionListener, ComponentListener, |
|
74 |
MouseMotionListener, MouseListener{ |
|
75 |
private Layout layout = null; |
|
76 |
private Point2D.Double m_pointSelected = null; |
|
77 |
private int index = 0; |
|
78 |
private ArrayList lastSelect = new ArrayList(); |
|
79 |
private FLayoutFunctions events = null; |
|
80 |
private FLayoutZooms zooms = null; |
|
81 |
/** |
|
82 |
* Crea un nuevo EventsHandler. |
|
83 |
* |
|
84 |
* @param l Referencia al Layout. |
|
85 |
*/ |
|
86 |
public EventsHandler(Layout l) { |
|
87 |
layout = l; |
|
88 |
events = new FLayoutFunctions(layout); |
|
89 |
zooms = new FLayoutZooms(layout); |
|
90 |
} |
|
91 |
|
|
92 |
/** |
|
93 |
* @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent) |
|
94 |
*/ |
|
95 |
public void componentHidden(ComponentEvent arg0) { |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent) |
|
100 |
*/ |
|
101 |
public void componentMoved(ComponentEvent arg0) { |
|
102 |
} |
|
103 |
|
|
104 |
/** |
|
105 |
* @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent) |
|
106 |
*/ |
|
107 |
public void componentResized(ComponentEvent arg0) { |
|
108 |
layout.fullRect(); |
|
109 |
} |
|
110 |
|
|
111 |
/** |
|
112 |
* @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent) |
|
113 |
*/ |
|
114 |
public void componentShown(ComponentEvent arg0) { |
|
115 |
} |
|
116 |
|
|
117 |
/** |
|
118 |
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) |
|
119 |
*/ |
|
120 |
public void actionPerformed(ActionEvent arg0) { |
|
121 |
layout.repaint(); |
|
122 |
} |
|
123 |
|
|
124 |
/** |
|
125 |
* @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent) |
|
126 |
*/ |
|
127 |
public void mouseDragged(MouseEvent e) { |
|
128 |
if (e.getButton() != MouseEvent.BUTTON3) { |
|
129 |
layout.setLastPoint(); |
|
130 |
layout.repaint(); |
|
131 |
} |
|
132 |
if (layout.getTool() == Layout.EDIT){ |
|
133 |
IFFrame[] fframes=layout.getFFrames(); |
|
134 |
for (int i=0;i<fframes.length;i++){ |
|
135 |
IFFrame frame=fframes[i]; |
|
136 |
if (frame instanceof IFFrameEditableVertex){ |
|
137 |
((IFFrameEditableVertex)frame).pointDragged(FLayoutUtilities.toSheetPoint(e.getPoint(),layout.getAT())); |
|
138 |
layout.setStatus(Layout.GRAPHICS); |
|
139 |
|
|
140 |
} |
|
141 |
} |
|
142 |
|
|
143 |
} |
|
144 |
layout.setPosition(e.getPoint()); |
|
145 |
} |
|
146 |
|
|
147 |
/** |
|
148 |
* @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent) |
|
149 |
*/ |
|
150 |
public void mouseMoved(MouseEvent E) { |
|
151 |
if ((layout.getTool() == Layout.POLYLINE) || |
|
152 |
(layout.getTool() == Layout.POLYGON) || |
|
153 |
(layout.getTool() == Layout.LINE) || |
|
154 |
(layout.getTool() == Layout.CIRCLE) || |
|
155 |
(layout.getTool() == Layout.RECTANGLESIMPLE)) { |
|
156 |
layout.setGeometryAdapterPoinPosition(); |
|
157 |
layout.setStatus(Layout.GRAPHICS); |
|
158 |
// layout.repaint(); |
|
159 |
} |
|
160 |
|
|
161 |
if (layout.getTool() == Layout.SELECT) { |
|
162 |
Image cursor = null; |
|
163 |
Point2D.Double p = new Point2D.Double(E.getX(), E.getY()); |
|
164 |
IFFrame[] fframes=layout.getFFrameSelected(); |
|
165 |
for (int i = 0; i < fframes.length; i++) { |
|
166 |
if (fframes[i].getContains(p)!=IFFrame.NOSELECT){ |
|
167 |
cursor=fframes[i].getMapCursor(p); |
|
168 |
} |
|
169 |
if (cursor != null) { |
|
170 |
layout.setMapCursor(cursor); |
|
171 |
} else { |
|
172 |
layout.setMapCursor(Layout.icrux); |
|
173 |
} |
|
174 |
} |
|
175 |
///layout.setStatus(Layout.SELECT); |
|
176 |
} |
|
177 |
layout.setPosition(E.getPoint()); |
|
178 |
layout.repaint(); |
|
179 |
} |
|
180 |
|
|
181 |
/** |
|
182 |
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) |
|
183 |
*/ |
|
184 |
public void mouseClicked(MouseEvent E) { |
|
185 |
if ((E.getClickCount() == 2) && |
|
186 |
((layout.getTool() == Layout.POLYLINE) || |
|
187 |
(layout.getTool() == Layout.POLYGON))) { |
|
188 |
layout.delLastPoint(); |
|
189 |
layout.endGraphic(); |
|
190 |
} else { |
|
191 |
if (E.getButton() == MouseEvent.BUTTON1) { |
|
192 |
if (layout.getTool() == Layout.SELECT) { |
|
193 |
m_pointSelected = new Point2D.Double(E.getX(), E.getY()); |
|
194 |
IFFrame[] fframes=layout.getFFrames(); |
|
195 |
if (fframes.length > 0) { |
|
196 |
ArrayList listSelect = new ArrayList(); |
|
197 |
for (int j = 0; j < fframes.length; j++) { |
|
198 |
if (fframes[j].getContains( |
|
199 |
m_pointSelected) != IFFrame.NOSELECT) { |
|
200 |
listSelect.add(fframes[j]); |
|
201 |
} |
|
202 |
} |
|
203 |
|
|
204 |
if (listSelect.size() > 0) { |
|
205 |
for (int k = 0; k < listSelect.size(); k++) { |
|
206 |
if (((IFFrame) listSelect.get(k)).getSelected() != IFFrame.NOSELECT) { |
|
207 |
index = listSelect.size() - k; |
|
208 |
|
|
209 |
break; |
|
210 |
} |
|
211 |
} |
|
212 |
|
|
213 |
if (!FLayoutUtilities.isEqualList(listSelect, |
|
214 |
lastSelect) || |
|
215 |
(index > (listSelect.size() - 1))) { |
|
216 |
index = 0; |
|
217 |
} |
|
218 |
for (int j = 0; j < fframes.length; |
|
219 |
j++) { |
|
220 |
IFFrame fframe = fframes[j]; |
|
221 |
|
|
222 |
if (!E.isShiftDown()) { |
|
223 |
fframe.setSelected(false); |
|
224 |
} else { |
|
225 |
if (fframe.getSelected() != IFFrame.NOSELECT) { |
|
226 |
if (fframe.getContains(m_pointSelected) != IFFrame.NOSELECT) { |
|
227 |
fframe.setSelected(false); |
|
228 |
} |
|
229 |
} |
|
230 |
} |
|
231 |
} |
|
232 |
|
|
233 |
((IFFrame) listSelect.get((listSelect.size() - 1 - |
|
234 |
index))).setSelected(true); |
|
235 |
index++; |
|
236 |
lastSelect = listSelect; |
|
237 |
} |
|
238 |
|
|
239 |
layout.setStatus(Layout.SELECT); |
|
240 |
layout.repaint(); |
|
241 |
|
|
242 |
if (E.getClickCount() > 1) { |
|
243 |
FLayoutGraphics flg = new FLayoutGraphics(layout); |
|
244 |
flg.openFFrameDialog(); |
|
245 |
layout.setStatus(Layout.DESACTUALIZADO); |
|
246 |
layout.repaint(); |
|
247 |
|
|
248 |
//layout.setStatus(Layout.SELECT); |
|
249 |
} |
|
250 |
} |
|
251 |
|
|
252 |
PluginServices.getMainFrame().enableControls(); |
|
253 |
} |
|
254 |
} else if (E.getButton() == MouseEvent.BUTTON2) { |
|
255 |
} |
|
256 |
} |
|
257 |
} |
|
258 |
|
|
259 |
/** |
|
260 |
* @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) |
|
261 |
*/ |
|
262 |
public void mouseEntered(MouseEvent arg0) { |
|
263 |
layout.clearMouseImage(); |
|
264 |
/* TODO PluginServices.getMainFrame().getStatusBar().setMessage("0", |
|
265 |
layout.getAtributes().getNameUnit()); |
|
266 |
|
|
267 |
if (layout.getTool() == Layout.PAN) { |
|
268 |
layout.setMapCursor(Layout.iLayoutpan); |
|
269 |
} else if (layout.getTool() == Layout.ZOOM_MAS) { |
|
270 |
layout.setMapCursor(Layout.iLayoutzoomin); |
|
271 |
} else if (layout.getTool() == Layout.ZOOM_MENOS) { |
|
272 |
layout.setMapCursor(Layout.iLayoutzoomout); |
|
273 |
} else if (layout.getTool() == Layout.VIEW_PAN) { |
|
274 |
layout.setMapCursor(Layout.ipan); |
|
275 |
} else if (layout.getTool() == Layout.VIEW_ZOOMIN) { |
|
276 |
layout.setMapCursor(Layout.izoomin); |
|
277 |
} else if (layout.getTool() == Layout.VIEW_ZOOMOUT) { |
|
278 |
layout.setMapCursor(Layout.izoomout); |
|
279 |
} |
|
280 |
*/ |
|
281 |
} |
|
282 |
|
|
283 |
/** |
|
284 |
* @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) |
|
285 |
*/ |
|
286 |
public void mouseExited(MouseEvent arg0) { |
|
287 |
///TODO PluginServices.getMainFrame().getStatusBar().setMessage("0", ""); |
|
288 |
} |
|
289 |
|
|
290 |
/** |
|
291 |
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) |
|
292 |
*/ |
|
293 |
public void mousePressed(MouseEvent E) { |
|
294 |
if (E.getButton() == MouseEvent.BUTTON1) { |
|
295 |
layout.setPointAnt(); |
|
296 |
layout.setFirstPoint(); |
|
297 |
|
|
298 |
if ((layout.getTool() == Layout.ZOOM_MAS) || |
|
299 |
(layout.getTool() == Layout.VIEW_ZOOMIN)) { |
|
300 |
layout.setStatus(Layout.ZOOM_MAS); |
|
301 |
} else if ((layout.getTool() == Layout.RECTANGLEVIEW) || |
|
302 |
(layout.getTool() == Layout.RECTANGLEOVERVIEW) || |
|
303 |
(layout.getTool() == Layout.RECTANGLEPICTURE) || |
|
304 |
(layout.getTool() == Layout.RECTANGLESCALEBAR) || |
|
305 |
(layout.getTool() == Layout.RECTANGLELEGEND) || |
|
306 |
(layout.getTool() == Layout.RECTANGLENORTH) || |
|
307 |
(layout.getTool() == Layout.RECTANGLETEXT)|| |
|
308 |
(layout.getTool() == Layout.RECTANGLEBOX)) { |
|
309 |
layout.setStatus(Layout.RECTANGLE); |
|
310 |
} else if ((layout.getTool() == Layout.POINT) ) { |
|
311 |
layout.addGeometryAdapterPoint(); |
|
312 |
layout.endGraphic(); |
|
313 |
//layout.setStatus(Layout.GRAPHICS); |
|
314 |
} else if ((layout.getTool() == Layout.POLYLINE) || |
|
315 |
(layout.getTool() == Layout.POLYGON)) { |
|
316 |
layout.addGeometryAdapterPoint(); |
|
317 |
layout.setStatus(Layout.GRAPHICS); |
|
318 |
} else if ((layout.getTool() == Layout.LINE) || |
|
319 |
(layout.getTool() == Layout.CIRCLE) || |
|
320 |
(layout.getTool() == Layout.RECTANGLESIMPLE)) { |
|
321 |
if (layout.addGeometryAdapterPoint() == 2) { |
|
322 |
layout.endGraphic(); |
|
323 |
layout.setStatus(Layout.DESACTUALIZADO); |
|
324 |
} else { |
|
325 |
layout.setStatus(Layout.GRAPHICS); |
|
326 |
} |
|
327 |
} else if (layout.getTool() == Layout.PAN) { |
|
328 |
layout.getRectOrigin().setLocation(layout.getRect().x, |
|
329 |
layout.getRect().y); |
|
330 |
layout.setStatus(Layout.PAN); |
|
331 |
} else if (layout.getTool() == Layout.VIEW_PAN) { |
|
332 |
/* layout.getRectOrigin().setLocation(layout.getRect().x, |
|
333 |
layout.getRect().y); |
|
334 |
*/ |
|
335 |
layout.setStatus(Layout.VIEW_PAN); |
|
336 |
} else if (layout.getTool() == Layout.ZOOM_MENOS) { |
|
337 |
layout.setCancelDrawing(true); |
|
338 |
} else if ((layout.getTool() == Layout.ZOOM_MAS) || |
|
339 |
(layout.getTool() == Layout.PAN)) { |
|
340 |
layout.setCancelDrawing(true); |
|
341 |
} else if (layout.getTool() == Layout.SELECT) { |
|
342 |
m_pointSelected = new Point2D.Double(E.getX(), E.getY()); |
|
343 |
IFFrame[] fframes=layout.getFFrames(); |
|
344 |
for (int i = 0; i < fframes.length; i++) { |
|
345 |
IFFrame fframe = fframes[i]; |
|
346 |
|
|
347 |
if (m_pointSelected != null) { |
|
348 |
if (!E.isShiftDown()) { |
|
349 |
if ((fframe.getSelected() != IFFrame.NOSELECT)) { |
|
350 |
fframe.setSelected(m_pointSelected,E); |
|
351 |
} |
|
352 |
}else if (fframe instanceof IFFrameGroupSelectable){ |
|
353 |
fframe.setSelected(m_pointSelected,E); |
|
354 |
} |
|
355 |
} |
|
356 |
|
|
357 |
if (fframe.getSelected() != IFFrame.NOSELECT) { |
|
358 |
layout.setIsReSel(false); |
|
359 |
} |
|
360 |
} |
|
361 |
|
|
362 |
if ((layout.getLastPoint() != null) && |
|
363 |
(layout.getFirstPoint() != null)) { |
|
364 |
layout.getLastPoint().setLocation(layout.getFirstPoint()); |
|
365 |
} |
|
366 |
|
|
367 |
if (E.getClickCount() < 2) { |
|
368 |
layout.setStatus(Layout.SELECT); |
|
369 |
layout.repaint(); |
|
370 |
} |
|
371 |
} else if (layout.getTool() == Layout.SET_TAG) { |
|
372 |
m_pointSelected = new Point2D.Double(E.getX(), E.getY()); |
|
373 |
IFFrame[] fframes=layout.getFFrames(); |
|
374 |
for (int i = 0; i < fframes.length; i++) { |
|
375 |
IFFrame fframe = fframes[i]; |
|
376 |
|
|
377 |
if (m_pointSelected != null) { |
|
378 |
if (fframe.contains(m_pointSelected)) { |
|
379 |
fframe.openTag(); |
|
380 |
} |
|
381 |
} |
|
382 |
} |
|
383 |
} else if (layout.getTool() == Layout.EDIT){ |
|
384 |
IFFrame[] fframes=layout.getFFrames(); |
|
385 |
for (int i=0;i<fframes.length;i++){ |
|
386 |
IFFrame frame=fframes[i]; |
|
387 |
if (frame instanceof IFFrameEditableVertex){ |
|
388 |
((IFFrameEditableVertex)frame).pointPressed(FLayoutUtilities.toSheetPoint(E.getPoint(),layout.getAT())); |
|
389 |
} |
|
390 |
} |
|
391 |
} |
|
392 |
} else if (E.getButton() == MouseEvent.BUTTON3) { |
|
393 |
new Popupmenu(layout, E.getPoint()); |
|
394 |
} |
|
395 |
} |
|
396 |
|
|
397 |
/** |
|
398 |
* @see java.awt.event.MouseListener#mouseReleassed(java.awt.event.MouseEvent) |
|
399 |
*/ |
|
400 |
public void mouseReleased(MouseEvent E) { |
|
401 |
if (E.getButton() != MouseEvent.BUTTON3) { |
|
402 |
layout.setLastPoint(); |
|
403 |
} |
|
404 |
|
|
405 |
if (E.getButton() == MouseEvent.BUTTON1) { |
|
406 |
Point p1 = layout.getFirstPoint(); |
|
407 |
Point p2 = new Point(E.getX(), E.getY()); |
|
408 |
|
|
409 |
if (layout.getTool() == Layout.ZOOM_MAS) { |
|
410 |
zooms.setZoomIn(p1, p2); |
|
411 |
layout.refresh(); |
|
412 |
} else if ((layout.getTool() == Layout.ZOOM_MENOS) || |
|
413 |
(E.getButton() == MouseEvent.BUTTON3)) { |
|
414 |
zooms.setZoomOut(p2); |
|
415 |
layout.refresh(); |
|
416 |
} else if (layout.getTool() == Layout.SELECT) { |
|
417 |
events.setSelect(); |
|
418 |
layout.refresh(); |
|
419 |
} else if ((layout.getTool() == Layout.RECTANGLEVIEW) || |
|
420 |
(layout.getTool() == Layout.RECTANGLEOVERVIEW) || |
|
421 |
(layout.getTool() == Layout.RECTANGLEPICTURE) || |
|
422 |
(layout.getTool() == Layout.RECTANGLESCALEBAR) || |
|
423 |
(layout.getTool() == Layout.RECTANGLELEGEND) || |
|
424 |
(layout.getTool() == Layout.RECTANGLETEXT) || |
|
425 |
(layout.getTool() == Layout.RECTANGLENORTH)|| |
|
426 |
(layout.getTool() == Layout.RECTANGLEBOX)) { |
|
427 |
events.addFFrame(); |
|
428 |
PluginServices.getMainFrame().enableControls(); |
|
429 |
layout.refresh(); |
|
430 |
} else if (layout.getTool() == Layout.VIEW_ZOOMIN) { |
|
431 |
zooms.setViewZoomIn(p1, p2); |
|
432 |
layout.refresh(); |
|
433 |
} else if (layout.getTool() == Layout.VIEW_ZOOMOUT) { |
|
434 |
zooms.setViewZoomOut(p2); |
|
435 |
layout.refresh(); |
|
436 |
} else if (layout.getTool() == Layout.VIEW_PAN) { |
|
437 |
events.setViewPan(p1, p2); |
|
438 |
layout.refresh(); |
|
439 |
} else if ((layout.getTool() == Layout.POLYLINE) || |
|
440 |
(layout.getTool() == Layout.POLYGON)) { |
|
441 |
layout.setStatus(Layout.GRAPHICS); |
|
442 |
layout.repaint(); |
|
443 |
} else if (layout.getTool() == Layout.EDIT){ |
|
444 |
IFFrame[] fframes=layout.getFFrames(); |
|
445 |
for (int i=0;i<fframes.length;i++){ |
|
446 |
IFFrame frame=fframes[i]; |
|
447 |
if (frame instanceof IFFrameEditableVertex){ |
|
448 |
if (frame.getSelected()!=IFFrame.NOSELECT && ((IFFrameEditableVertex)frame).isEditing()){ |
|
449 |
IFFrame fframeAux=frame.cloneFFrame(layout); |
|
450 |
((IFFrameEditableVertex)fframeAux).startEditing(); |
|
451 |
((IFFrameEditableVertex)fframeAux).pointReleased(FLayoutUtilities.toSheetPoint(E.getPoint(),layout.getAT()),((IFFrameEditableVertex)frame).getGeometry()); |
|
452 |
layout.getEFS().modifyFFrame(frame,fframeAux); |
|
453 |
fframeAux.getBoundingBox(layout.getAT()); |
|
454 |
layout.updateFFrames(); |
|
455 |
} |
|
456 |
} |
|
457 |
} |
|
458 |
layout.refresh(); |
|
459 |
} else if (layout.getTool() == Layout.PAN) { |
|
460 |
zooms.setPan(p1,p2); |
|
461 |
layout.refresh(); |
|
462 |
} |
|
463 |
layout.setCancelDrawing(false); |
|
464 |
} else if (E.getButton() == MouseEvent.BUTTON3) { |
|
465 |
} |
|
466 |
|
|
467 |
|
|
468 |
} |
|
469 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutZooms.java | ||
---|---|---|
51 | 51 |
import java.util.prefs.Preferences; |
52 | 52 |
|
53 | 53 |
import com.iver.cit.gvsig.fmap.MapContext; |
54 |
import com.iver.cit.gvsig.gui.layout.Attributes; |
|
55 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
56 | 54 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
57 | 55 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameUseFMap; |
56 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
58 | 57 |
|
59 | 58 |
|
60 | 59 |
/** |
... | ... | |
77 | 76 |
* @param p2 punto final del rec?ngulo. |
78 | 77 |
*/ |
79 | 78 |
public void setZoomIn(Point p1, Point p2) { |
80 |
if (java.lang.Math.abs(layout.getFirstPoint().x - p2.x) < 4) { |
|
79 |
if (java.lang.Math.abs(layout.getLayoutControl().getFirstPoint().x - p2.x) < 4) {
|
|
81 | 80 |
double difw = 2; |
82 | 81 |
setZoom(difw, p2); |
83 | 82 |
} else { |
... | ... | |
94 | 93 |
} |
95 | 94 |
|
96 | 95 |
Point2D.Double pSheet1 = FLayoutUtilities.toSheetPoint( |
97 |
new Point2D.Double(p1.getX(), p1.getY()), layout.getAT()); |
|
96 |
new Point2D.Double(p1.getX(), p1.getY()), layout.getLayoutControl().getAT());
|
|
98 | 97 |
Point2D.Double pSheet2 = FLayoutUtilities.toSheetPoint( |
99 |
new Point2D.Double(p2.getX(), p2.getY()), layout.getAT()); |
|
98 |
new Point2D.Double(p2.getX(), p2.getY()), layout.getLayoutControl().getAT());
|
|
100 | 99 |
|
101 | 100 |
double xmin; |
102 | 101 |
double xmax; |
... | ... | |
122 | 121 |
Rectangle2D.Double rScreen = new Rectangle2D.Double(); |
123 | 122 |
Rectangle2D.Double rSheet = new Rectangle2D.Double(); |
124 | 123 |
double x = FLayoutUtilities.toSheetDistance( |
125 |
layout.getRect().getX(), layout.getAT());
|
|
124 |
layout.getLayoutControl().getRect().getX(), layout.getLayoutControl().getAT());
|
|
126 | 125 |
double y = FLayoutUtilities.toSheetDistance( |
127 |
layout.getRect().getY(), layout.getAT());
|
|
128 |
double w = FLayoutUtilities.toSheetDistance(layout.getRect() |
|
129 |
.getWidth(), layout.getAT()); |
|
130 |
double h = FLayoutUtilities.toSheetDistance(layout.getRect() |
|
131 |
.getHeight(), layout.getAT()); |
|
126 |
layout.getLayoutControl().getRect().getY(), layout.getLayoutControl().getAT());
|
|
127 |
double w = FLayoutUtilities.toSheetDistance(layout.getLayoutControl().getRect()
|
|
128 |
.getWidth(), layout.getLayoutControl().getAT());
|
|
129 |
double h = FLayoutUtilities.toSheetDistance(layout.getLayoutControl().getRect()
|
|
130 |
.getHeight(), layout.getLayoutControl().getAT());
|
|
132 | 131 |
|
133 | 132 |
double wv = FLayoutUtilities.toSheetDistance(layout |
134 |
.getVisibleRect().getWidth(), layout.getAT()); |
|
133 |
.getVisibleRect().getWidth(), layout.getLayoutControl().getAT());
|
|
135 | 134 |
double hv = FLayoutUtilities.toSheetDistance(layout |
136 |
.getVisibleRect().getHeight(), layout.getAT()); |
|
135 |
.getVisibleRect().getHeight(), layout.getLayoutControl().getAT());
|
|
137 | 136 |
double mw = xmax - xmin; |
138 | 137 |
double mh = ymax - ymin; |
139 | 138 |
double difw = wv / mw; |
... | ... | |
161 | 160 |
rSheet.height = h * difh; |
162 | 161 |
} |
163 | 162 |
setPointsToZoom(p1, p2); |
164 |
rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet, layout |
|
163 |
rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet, layout.getLayoutControl()
|
|
165 | 164 |
.getAT())); |
166 | 165 |
if (FLayoutUtilities.isPosible(rScreen)) { |
167 |
layout.getRect().setRect(rScreen); |
|
166 |
layout.getLayoutControl().getRect().setRect(rScreen);
|
|
168 | 167 |
} |
169 | 168 |
} |
170 | 169 |
} |
... | ... | |
187 | 186 |
*/ |
188 | 187 |
public void setZoom(double dif, Point p2) { |
189 | 188 |
Point2D.Double pSheet2 = FLayoutUtilities.toSheetPoint(new Point2D.Double( |
190 |
p2.getX(), p2.getY()), layout.getAT()); |
|
189 |
p2.getX(), p2.getY()), layout.getLayoutControl().getAT());
|
|
191 | 190 |
Rectangle2D.Double rScreen = new Rectangle2D.Double(); |
192 | 191 |
Rectangle2D.Double rSheet = new Rectangle2D.Double(); |
193 | 192 |
|
194 | 193 |
double difw = dif; |
195 | 194 |
|
196 | 195 |
rSheet.x = (-pSheet2.getX() * difw) - |
197 |
FLayoutUtilities.toSheetDistance(layout.getRect().getX(), |
|
198 |
layout.getAT()) +
|
|
196 |
FLayoutUtilities.toSheetDistance(layout.getLayoutControl().getRect().getX(),
|
|
197 |
layout.getLayoutControl().getAT()) +
|
|
199 | 198 |
FLayoutUtilities.toSheetDistance(layout.getWidth() / 2, |
200 |
layout.getAT());
|
|
199 |
layout.getLayoutControl().getAT());
|
|
201 | 200 |
rSheet.y = (-pSheet2.getY() * difw) - |
202 |
FLayoutUtilities.toSheetDistance(layout.getRect().getY(), |
|
203 |
layout.getAT()) +
|
|
201 |
FLayoutUtilities.toSheetDistance(layout.getLayoutControl().getRect().getY(),
|
|
202 |
layout.getLayoutControl().getAT()) +
|
|
204 | 203 |
FLayoutUtilities.toSheetDistance(layout.getHeight() / 2, |
205 |
layout.getAT());
|
|
204 |
layout.getLayoutControl().getAT());
|
|
206 | 205 |
|
207 |
rSheet.width = FLayoutUtilities.toSheetDistance(layout.getRect() |
|
206 |
rSheet.width = FLayoutUtilities.toSheetDistance(layout.getLayoutControl().getRect()
|
|
208 | 207 |
.getWidth(), |
209 |
layout.getAT()) * difw;
|
|
210 |
rSheet.height = FLayoutUtilities.toSheetDistance(layout.getRect() |
|
208 |
layout.getLayoutControl().getAT()) * difw;
|
|
209 |
rSheet.height = FLayoutUtilities.toSheetDistance(layout.getLayoutControl().getRect()
|
|
211 | 210 |
.getHeight(), |
212 |
layout.getAT()) * difw;
|
|
211 |
layout.getLayoutControl().getAT()) * difw;
|
|
213 | 212 |
|
214 |
rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet, layout.getAT())); |
|
213 |
rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet, layout.getLayoutControl().getAT()));
|
|
215 | 214 |
|
216 | 215 |
if (FLayoutUtilities.isPosible(rScreen)) { |
217 |
layout.getRect().setRect(rScreen);
|
|
216 |
layout.getLayoutControl().getRect().setRect(rScreen);
|
|
218 | 217 |
} |
219 | 218 |
|
220 | 219 |
// Para realizar el zoom a partir de un punto. |
... | ... | |
229 | 228 |
* Introduce los puntos de control para controlar el zoom del Layout. |
230 | 229 |
*/ |
231 | 230 |
private void setPointsToZoom(Point p1, Point p2) { |
232 |
IFFrame[] fframes = layout.getFFrames(); |
|
231 |
IFFrame[] fframes = layout.getLayoutContext().getFFrames();
|
|
233 | 232 |
|
234 | 233 |
for (int i = 0; i < fframes.length; i++) { |
235 | 234 |
if (fframes[i] instanceof IFFrameUseFMap) { |
... | ... | |
248 | 247 |
*/ |
249 | 248 |
public void realZoom() { |
250 | 249 |
Preferences prefsResolution = Preferences.userRoot().node( "gvsig.configuration.screen" ); |
251 |
double cm = layout.getAtributes().getPixXCm(layout.getRect());
|
|
250 |
double cm = layout.getLayoutContext().getAtributes().getPixXCm(layout.getLayoutControl().getRect());
|
|
252 | 251 |
Toolkit kit = Toolkit.getDefaultToolkit(); |
253 | 252 |
double dpi = prefsResolution.getInt("dpi",kit.getScreenResolution()); |
254 | 253 |
double dif = (cm * Attributes.PULGADA) / dpi; |
255 | 254 |
setZoom(1 / dif, |
256 | 255 |
new Point(layout.getWidth() / 2, layout.getHeight() / 2)); |
257 |
layout.refresh(); |
|
256 |
layout.getLayoutControl().refresh();
|
|
258 | 257 |
} |
259 | 258 |
|
260 | 259 |
/** |
... | ... | |
262 | 261 |
*/ |
263 | 262 |
public void zoomIn() { |
264 | 263 |
setZoom(2, new Point(layout.getWidth() / 2, layout.getHeight() / 2)); |
265 |
layout.refresh();
|
|
264 |
layout.getLayoutControl().refresh();
|
|
266 | 265 |
} |
267 | 266 |
|
268 | 267 |
/** |
... | ... | |
270 | 269 |
*/ |
271 | 270 |
public void zoomOut() { |
272 | 271 |
setZoom(0.5, new Point(layout.getWidth() / 2, layout.getHeight() / 2)); |
273 |
layout.refresh();
|
|
272 |
layout.getLayoutControl().refresh();
|
|
274 | 273 |
} |
275 | 274 |
|
276 | 275 |
/** |
... | ... | |
279 | 278 |
*/ |
280 | 279 |
public void zoomSelect() { |
281 | 280 |
Rectangle2D.Double recaux = null; |
282 |
IFFrame[] fframes=layout.getFFrames(); |
|
281 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames();
|
|
283 | 282 |
for (int i = 0; i < fframes.length; i++) { |
284 | 283 |
if (fframes[i].getSelected() != IFFrame.NOSELECT) { |
285 | 284 |
if (recaux == null) { |
286 |
recaux = fframes[i].getBoundingBox(layout.getAT()); |
|
285 |
recaux = fframes[i].getBoundingBox(layout.getLayoutControl().getAT());
|
|
287 | 286 |
} else { |
288 | 287 |
recaux.add(fframes[i].getBoundingBox( |
289 |
layout.getAT()));
|
|
288 |
layout.getLayoutControl().getAT()));
|
|
290 | 289 |
} |
291 | 290 |
} |
292 | 291 |
} |
... | ... | |
295 | 294 |
Point p1 = new Point((int) recaux.x, (int) recaux.y); |
296 | 295 |
Point p2 = new Point((int) recaux.getMaxX(), (int) recaux.getMaxY()); |
297 | 296 |
setZoomIn(p1, p2); |
298 |
layout.refresh(); |
|
297 |
layout.getLayoutControl().refresh();
|
|
299 | 298 |
} |
300 | 299 |
} |
301 | 300 |
/** |
... | ... | |
303 | 302 |
*/ |
304 | 303 |
public void zoomAllFrames() { |
305 | 304 |
Rectangle2D.Double recaux = null; |
306 |
IFFrame[] fframes=layout.getFFrames(); |
|
305 |
IFFrame[] fframes=layout.getLayoutControl().getLayoutContext().getFFrames();
|
|
307 | 306 |
for (int i = 0; i < fframes.length; i++) { |
308 | 307 |
if (recaux == null) { |
309 |
recaux = fframes[i].getBoundingBox(layout.getAT()); |
|
308 |
recaux = fframes[i].getBoundingBox(layout.getLayoutControl().getAT());
|
|
310 | 309 |
} else { |
311 | 310 |
recaux.add(fframes[i].getBoundingBox( |
312 |
layout.getAT()));
|
|
311 |
layout.getLayoutControl().getAT()));
|
|
313 | 312 |
} |
314 | 313 |
} |
315 | 314 |
|
... | ... | |
317 | 316 |
Point p1 = new Point((int) recaux.x, (int) recaux.y); |
318 | 317 |
Point p2 = new Point((int) recaux.getMaxX(), (int) recaux.getMaxY()); |
319 | 318 |
setZoomIn(p1, p2); |
320 |
layout.refresh(); |
|
319 |
layout.getLayoutControl().refresh();
|
|
321 | 320 |
} |
322 | 321 |
} |
323 | 322 |
|
... | ... | |
328 | 327 |
* @param p2 Punto final del rect?ngulo |
329 | 328 |
*/ |
330 | 329 |
public void setViewZoomIn(Point2D p1, Point2D p2) { |
331 |
IFFrame[] fframes=layout.getFFrames(); |
|
330 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames();
|
|
332 | 331 |
for (int i = 0; i < fframes.length; i++) { |
333 | 332 |
if (fframes[i] instanceof IFFrameUseFMap) { |
334 | 333 |
IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i]; |
... | ... | |
340 | 339 |
|
341 | 340 |
|
342 | 341 |
// Borramos el anterior |
343 |
layout.setStatus(Layout.DESACTUALIZADO);
|
|
342 |
layout.getLayoutControl().setStatus(LayoutControl.DESACTUALIZADO);
|
|
344 | 343 |
Rectangle2D.Double r = new Rectangle2D.Double(); |
345 | 344 |
|
346 | 345 |
if (java.lang.Math.abs(p1.getX() - p2.getX()) <= 3) { |
... | ... | |
401 | 400 |
*/ |
402 | 401 |
public void setViewZoomOut(Point p2) { |
403 | 402 |
Point2D.Double pWorld; |
404 |
IFFrame[] fframes=layout.getFFrames(); |
|
403 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames();
|
|
405 | 404 |
for (int i = 0; i < fframes.length; i++) { |
406 | 405 |
if (fframes[i] instanceof IFFrameUseFMap) { |
407 | 406 |
IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i]; |
... | ... | |
457 | 456 |
* @param p2 Punto final |
458 | 457 |
*/ |
459 | 458 |
public void setPan(Point p1, Point p2) { |
460 |
IFFrame[] fframes = layout.getFFrames(); |
|
459 |
IFFrame[] fframes = layout.getLayoutContext().getFFrames();
|
|
461 | 460 |
|
462 | 461 |
for (int i = 0; i < fframes.length; i++) { |
463 | 462 |
if (fframes[i] instanceof IFFrameUseFMap) { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutFunctions.java | ||
---|---|---|
51 | 51 |
import java.awt.geom.Point2D; |
52 | 52 |
import java.awt.geom.Rectangle2D; |
53 | 53 |
|
54 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
55 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics; |
|
56 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup; |
|
57 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend; |
|
58 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameNorth; |
|
59 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameOverView; |
|
60 |
import com.iver.cit.gvsig.gui.layout.fframes.FFramePicture; |
|
61 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar; |
|
62 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameTable; |
|
63 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameText; |
|
64 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameView; |
|
65 | 54 |
import com.iver.cit.gvsig.project.documents.layout.commands.EditableFeatureSource; |
55 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameGroup; |
|
66 | 56 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
67 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameLayoutDependence; |
|
68 | 57 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameUseFMap; |
58 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
69 | 59 |
|
70 | 60 |
|
71 | 61 |
/** |
72 |
* Funciones utilizadas desde la clase EventsHandler.
|
|
62 |
* Funciones utilizadas desde el Layout.
|
|
73 | 63 |
* |
74 | 64 |
* @author Vicente Caballero Navarro |
75 | 65 |
*/ |
... | ... | |
91 | 81 |
public void setSelect() { |
92 | 82 |
IFFrame fframe = null; |
93 | 83 |
boolean isUpdate = false; |
94 |
layout.updateFFrames(); |
|
95 |
IFFrame[] fframes=layout.getFFrames(); |
|
96 |
EditableFeatureSource efs=layout.getEFS(); |
|
84 |
layout.getLayoutContext().updateFFrames();
|
|
85 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames();
|
|
86 |
EditableFeatureSource efs=layout.getLayoutContext().getEFS();
|
|
97 | 87 |
efs.startComplexCommand(); |
98 | 88 |
for (int i = 0; i < fframes.length; i++) { |
99 | 89 |
fframe = fframes[i]; |
100 | 90 |
|
101 |
int difx = (layout.getLastPoint().x - layout.getFirstPoint().x);
|
|
102 |
int dify = (layout.getLastPoint().y - layout.getFirstPoint().y);
|
|
91 |
int difx = (layout.getLayoutControl().getLastPoint().x - layout.getLayoutControl().getFirstPoint().x);
|
|
92 |
int dify = (layout.getLayoutControl().getLastPoint().y - layout.getLayoutControl().getFirstPoint().y);
|
|
103 | 93 |
|
104 | 94 |
if (((Math.abs(difx) > 3) || (Math.abs(dify) > 3)) && |
105 | 95 |
(fframe.getSelected() != IFFrame.NOSELECT)) { |
... | ... | |
114 | 104 |
// } |
115 | 105 |
|
116 | 106 |
if (fframe instanceof FFrameGroup) { |
117 |
((FFrameGroup) fframe).setAt(layout.getAT()); |
|
107 |
((FFrameGroup) fframe).setAt(layout.getLayoutControl().getAT());
|
|
118 | 108 |
} |
119 | 109 |
|
120 | 110 |
IFFrame fframeAux=fframe.cloneFFrame(layout); |
121 | 111 |
fframeAux.setBoundBox(FLayoutUtilities.toSheetRect(rectangle, |
122 |
layout.getAT())); |
|
112 |
layout.getLayoutControl().getAT()));
|
|
123 | 113 |
if (fframeAux instanceof IFFrameUseFMap) |
124 | 114 |
((IFFrameUseFMap)fframeAux).refresh(); |
125 | 115 |
efs.modifyFFrame(fframe,fframeAux); |
126 |
fframeAux.getBoundingBox(layout.getAT()); |
|
116 |
fframeAux.getBoundingBox(layout.getLayoutControl().getAT());
|
|
127 | 117 |
|
128 | 118 |
isUpdate = true; |
129 | 119 |
} |
130 | 120 |
Rectangle rect=null; |
131 |
if (layout.getReSel()==null){ |
|
121 |
if (layout.getLayoutControl().getReSel()==null){
|
|
132 | 122 |
rect=new Rectangle(); |
133 |
rect.setFrameFromDiagonal(layout.getFirstPoint(), layout.getLastPoint());
|
|
123 |
rect.setFrameFromDiagonal(layout.getLayoutControl().getFirstPoint(), layout.getLayoutControl().getLastPoint());
|
|
134 | 124 |
}else{ |
135 |
rect=layout.getReSel(); |
|
125 |
rect=layout.getLayoutControl().getReSel();
|
|
136 | 126 |
} |
Also available in: Unified diff