Revision 31496 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/layout/LayoutKeyEvent.java
LayoutKeyEvent.java | ||
---|---|---|
7 | 7 |
import org.gvsig.andami.PluginServices; |
8 | 8 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
9 | 9 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
10 |
import org.gvsig.app.project.documents.layout.gui.Layout; |
|
10 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
|
|
11 | 11 |
import org.gvsig.tools.undo.RedoException; |
12 | 12 |
import org.gvsig.tools.undo.UndoException; |
13 | 13 |
|
... | ... | |
17 | 17 |
private int difX; |
18 | 18 |
private int difY; |
19 | 19 |
|
20 |
public static boolean copy(Layout layout) { |
|
20 |
public static boolean copy(LayoutPanel layout) {
|
|
21 | 21 |
IFFrame[] fframes = layout.getLayoutContext().getFFrameSelected(); |
22 | 22 |
if (fframes.length==0) |
23 | 23 |
return false; |
... | ... | |
27 | 27 |
} |
28 | 28 |
return true; |
29 | 29 |
} |
30 |
public static boolean cut(Layout layout) { |
|
30 |
public static boolean cut(LayoutPanel layout) {
|
|
31 | 31 |
IFFrame[] fframes = layout.getLayoutContext().getFFrameSelected(); |
32 | 32 |
if (fframes.length==0) |
33 | 33 |
return false; |
... | ... | |
39 | 39 |
layout.getLayoutContext().callLayoutDrawListeners(); |
40 | 40 |
return true; |
41 | 41 |
} |
42 |
public static boolean paste(Layout layout) { |
|
42 |
public static boolean paste(LayoutPanel layout) {
|
|
43 | 43 |
IFFrame copyFFrame = null; |
44 | 44 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex(PluginServices.getText(layout, "paste_elements")); |
45 | 45 |
for (int i = 0; i < selectFFrames.length; i++) { |
... | ... | |
53 | 53 |
layout.getLayoutContext().callLayoutDrawListeners(); |
54 | 54 |
return true; |
55 | 55 |
} |
56 |
public static boolean undo(Layout layout) { |
|
56 |
public static boolean undo(LayoutPanel layout) {
|
|
57 | 57 |
LayoutContext lcontext=layout.getLayoutContext(); |
58 | 58 |
try { |
59 | 59 |
lcontext.getFrameCommandsRecord().undo(); |
... | ... | |
65 | 65 |
PluginServices.getMainFrame().enableControls(); |
66 | 66 |
return true; |
67 | 67 |
} |
68 |
public static boolean redo(Layout layout) { |
|
68 |
public static boolean redo(LayoutPanel layout) {
|
|
69 | 69 |
LayoutContext lcontext=layout.getLayoutContext(); |
70 | 70 |
try { |
71 | 71 |
lcontext.getFrameCommandsRecord().redo(); |
... | ... | |
81 | 81 |
public boolean dispatchKeyEvent(KeyEvent e) { |
82 | 82 |
IWindow view = PluginServices.getMDIManager().getActiveWindow(); |
83 | 83 |
|
84 |
if (e.getID() == KeyEvent.KEY_PRESSED || !(view instanceof Layout) || !(e.getSource() instanceof LayoutControl)) |
|
84 |
if (e.getID() == KeyEvent.KEY_PRESSED || !(view instanceof LayoutPanel) || !(e.getSource() instanceof LayoutControl))
|
|
85 | 85 |
return false; |
86 |
Layout layout=(Layout)view;
|
|
86 |
LayoutPanel layout=(LayoutPanel)view;
|
|
87 | 87 |
if (!layout.getLayoutContext().isEditable()) |
88 | 88 |
return false; |
89 | 89 |
IFFrame[] fframes = layout.getLayoutContext().getFFrameSelected(); |
Also available in: Unified diff