root / trunk / extensions / extCAD / src / com / iver / cit / gvsig / LayerPropertiesExtension.java @ 8931
History | View | Annotate | Download (1.26 KB)
1 |
package com.iver.cit.gvsig; |
---|---|
2 |
|
3 |
import com.iver.andami.PluginServices; |
4 |
import com.iver.andami.plugins.Extension; |
5 |
import com.iver.cit.gvsig.fmap.MapContext; |
6 |
import com.iver.cit.gvsig.fmap.MapControl; |
7 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
8 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
9 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
10 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
11 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.LayerProperties; |
12 |
|
13 |
public class LayerPropertiesExtension extends Extension{ |
14 |
|
15 |
public void initialize() { |
16 |
// TODO Auto-generated method stub
|
17 |
|
18 |
} |
19 |
|
20 |
public void execute(String actionCommand) { |
21 |
com.iver.andami.ui.mdiManager.IWindow view = PluginServices.getMDIManager().getActiveWindow(); |
22 |
if (!(view instanceof View)) |
23 |
return;
|
24 |
View vista=(View)view; |
25 |
IProjectView model = vista.getModel(); |
26 |
MapContext mapa = model.getMapContext(); |
27 |
MapControl mapCtrl = vista.getMapControl(); |
28 |
FLayer[] layers=mapa.getLayers().getActives();
|
29 |
//layers[0].
|
30 |
LayerProperties layerProperties=new LayerProperties(layers[0],((FLyrVect)layers[0]).getLegend()); |
31 |
PluginServices.getMDIManager().addWindow(layerProperties); |
32 |
} |
33 |
|
34 |
public boolean isEnabled() { |
35 |
return true; |
36 |
} |
37 |
|
38 |
public boolean isVisible() { |
39 |
return true; |
40 |
} |
41 |
|
42 |
} |