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