Revision 31496 branches/v2_0_0_prep/extensions/extRemoteSensing/src/org/gvsig/remotesensing/ClassificationExtension.java
ClassificationExtension.java | ||
---|---|---|
43 | 43 |
|
44 | 44 |
import org.gvsig.andami.PluginServices; |
45 | 45 |
import org.gvsig.andami.plugins.Extension; |
46 |
import org.gvsig.app.project.documents.view.IProjectView;
|
|
47 |
import org.gvsig.app.project.documents.view.gui.View;
|
|
46 |
import org.gvsig.app.project.documents.view.ViewDocument;
|
|
47 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel;
|
|
48 | 48 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
49 | 49 |
import org.gvsig.fmap.mapcontext.MapContext; |
50 | 50 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
89 | 89 |
org.gvsig.andami.ui.mdiManager.IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow(); |
90 | 90 |
|
91 | 91 |
//si la ventana activa es de tipo Vista |
92 |
if (activeWindow instanceof View) {
|
|
93 |
ClassificationPanel clasificationDialog =new ClassificationPanel((View)activeWindow);
|
|
92 |
if (activeWindow instanceof DefaultViewPanel) {
|
|
93 |
ClassificationPanel clasificationDialog =new ClassificationPanel((DefaultViewPanel)activeWindow);
|
|
94 | 94 |
//Mostrar la calculadora. |
95 | 95 |
PluginServices.getMDIManager().addWindow(clasificationDialog); |
96 | 96 |
} |
... | ... | |
106 | 106 |
if (f == null) { |
107 | 107 |
return false; |
108 | 108 |
} |
109 |
if (f.getClass() == View.class) {
|
|
110 |
View vista = (View) f;
|
|
111 |
IProjectView model = vista.getModel();
|
|
109 |
if (f.getClass() == DefaultViewPanel.class) {
|
|
110 |
DefaultViewPanel vista = (DefaultViewPanel) f;
|
|
111 |
ViewDocument model = vista.getModel();
|
|
112 | 112 |
MapContext mapa = model.getMapContext(); |
113 | 113 |
FLayers layers = mapa.getLayers(); |
114 | 114 |
for (int i = 0; i < layers.getLayersCount(); i++) |
... | ... | |
127 | 127 |
if (f == null) { |
128 | 128 |
return false; |
129 | 129 |
} |
130 |
if (f instanceof View) {
|
|
131 |
View vista = (View) f;
|
|
132 |
IProjectView model = vista.getModel();
|
|
130 |
if (f instanceof DefaultViewPanel) {
|
|
131 |
DefaultViewPanel vista = (DefaultViewPanel) f;
|
|
132 |
ViewDocument model = vista.getModel();
|
|
133 | 133 |
MapContext mapa = model.getMapContext(); |
134 | 134 |
return mapa.getLayers().getLayersCount() > 0; |
135 | 135 |
} else { |
Also available in: Unified diff