svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extEditing / src / com / iver / cit / gvsig / LayerPropertiesExtension.java @ 25779
History | View | Annotate | Download (2.76 KB)
1 |
package com.iver.cit.gvsig; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.mapcontext.MapContext; |
4 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
5 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
6 |
import org.gvsig.fmap.mapcontrol.MapControl; |
7 |
|
8 |
import com.iver.andami.PluginServices; |
9 |
import com.iver.andami.plugins.Extension; |
10 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
11 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
12 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.LayerProperties; |
13 |
|
14 |
public class LayerPropertiesExtension extends Extension{ |
15 |
|
16 |
public void initialize() { |
17 |
// TODO Auto-generated method stub
|
18 |
registerIcons(); |
19 |
} |
20 |
|
21 |
private void registerIcons(){ |
22 |
PluginServices.getIconTheme().register( |
23 |
"images-selected-icon",
|
24 |
this.getClass().getClassLoader().getResource("images/selected.png") |
25 |
); |
26 |
PluginServices.getIconTheme().register( |
27 |
"images-notselected-icon",
|
28 |
this.getClass().getClassLoader().getResource("images/notSelected.png") |
29 |
); |
30 |
PluginServices.getIconTheme().register( |
31 |
"images-blocked-icon",
|
32 |
this.getClass().getClassLoader().getResource("images/blocked.png") |
33 |
); |
34 |
PluginServices.getIconTheme().register( |
35 |
"images-unblocked-icon",
|
36 |
this.getClass().getClassLoader().getResource("images/unblocked.png") |
37 |
); |
38 |
PluginServices.getIconTheme().register( |
39 |
"images-defuse-icon",
|
40 |
this.getClass().getClassLoader().getResource("images/defuse.png") |
41 |
); |
42 |
PluginServices.getIconTheme().register( |
43 |
"images-active-icon",
|
44 |
this.getClass().getClassLoader().getResource("images/active.png") |
45 |
); |
46 |
PluginServices.getIconTheme().register( |
47 |
"images-disabled-icon",
|
48 |
this.getClass().getClassLoader().getResource("images/disabled.png") |
49 |
); |
50 |
PluginServices.getIconTheme().register( |
51 |
"images-notdisabled-icon",
|
52 |
this.getClass().getClassLoader().getResource("images/notdisabled.png") |
53 |
); |
54 |
PluginServices.getIconTheme().register( |
55 |
"images-fill-icon",
|
56 |
this.getClass().getClassLoader().getResource("images/fill.png") |
57 |
); |
58 |
PluginServices.getIconTheme().register( |
59 |
"images-notfill-icon",
|
60 |
this.getClass().getClassLoader().getResource("images/notfill.png") |
61 |
); |
62 |
} |
63 |
|
64 |
public void execute(String actionCommand) { |
65 |
com.iver.andami.ui.mdiManager.IWindow view = PluginServices.getMDIManager().getActiveWindow(); |
66 |
if (!(view instanceof View)) |
67 |
return;
|
68 |
View vista=(View)view; |
69 |
IProjectView model = vista.getModel(); |
70 |
MapContext mapa = model.getMapContext(); |
71 |
MapControl mapCtrl = vista.getMapControl(); |
72 |
FLayer[] layers=mapa.getLayers().getActives();
|
73 |
//layers[0].
|
74 |
LayerProperties layerProperties=new LayerProperties(layers[0],((FLyrVect)layers[0]).getLegend()); |
75 |
PluginServices.getMDIManager().addWindow(layerProperties); |
76 |
} |
77 |
|
78 |
public boolean isEnabled() { |
79 |
return true; |
80 |
} |
81 |
|
82 |
public boolean isVisible() { |
83 |
return true; |
84 |
} |
85 |
|
86 |
} |