Revision 31496 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/FFrameLegendExtension.java
FFrameLegendExtension.java | ||
---|---|---|
46 | 46 |
import org.gvsig.app.project.documents.layout.FLayoutGraphics; |
47 | 47 |
import org.gvsig.app.project.documents.layout.fframes.FFrameLegend; |
48 | 48 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
49 |
import org.gvsig.app.project.documents.layout.gui.Layout; |
|
49 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
|
|
50 | 50 |
|
51 | 51 |
|
52 | 52 |
|
... | ... | |
58 | 58 |
* @author Vicente Caballero Navarro |
59 | 59 |
*/ |
60 | 60 |
public class FFrameLegendExtension extends Extension { |
61 |
private Layout layout = null; |
|
61 |
private LayoutPanel layout = null;
|
|
62 | 62 |
|
63 | 63 |
/** |
64 | 64 |
* @see org.gvsig.andami.plugins.IExtension#initialize() |
... | ... | |
70 | 70 |
* @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String) |
71 | 71 |
*/ |
72 | 72 |
public void execute(String s) { |
73 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
73 |
layout = (LayoutPanel) PluginServices.getMDIManager().getActiveWindow();
|
|
74 | 74 |
FLayoutGraphics lg = new FLayoutGraphics(layout); |
75 | 75 |
if (s.compareTo("SIMPLIFICAR") == 0) { |
76 | 76 |
lg.simplify(); |
... | ... | |
82 | 82 |
* @see org.gvsig.andami.plugins.IExtension#isEnabled() |
83 | 83 |
*/ |
84 | 84 |
public boolean isEnabled() { |
85 |
Layout l = (Layout)PluginServices.getMDIManager().getActiveWindow();
|
|
85 |
LayoutPanel l = (LayoutPanel)PluginServices.getMDIManager().getActiveWindow();
|
|
86 | 86 |
IFFrame[] fframes = l.getLayoutContext().getFFrameSelected(); |
87 | 87 |
if (!l.getLayoutContext().isEditable()) |
88 | 88 |
return false; |
... | ... | |
105 | 105 |
return false; |
106 | 106 |
} |
107 | 107 |
|
108 |
if (f instanceof Layout) { |
|
108 |
if (f instanceof LayoutPanel) {
|
|
109 | 109 |
return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0; |
110 | 110 |
} else { |
111 | 111 |
return false; |
Also available in: Unified diff