Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extEditing / src / org / gvsig / editing / LayerPropertiesExtension.java @ 38539

History | View | Annotate | Download (2.74 KB)

1 29616 jpiera
package org.gvsig.editing;
2 8931 caballero
3 29616 jpiera
import org.gvsig.andami.PluginServices;
4
import org.gvsig.andami.plugins.Extension;
5 31496 jjdelcerro
import org.gvsig.app.project.documents.view.ViewDocument;
6
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel;
7 21666 vcaballero
import org.gvsig.fmap.mapcontext.MapContext;
8
import org.gvsig.fmap.mapcontext.layers.FLayer;
9
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
10
import org.gvsig.fmap.mapcontrol.MapControl;
11 15637 jmvivo
12 8931 caballero
13 29685 jpiera
14 8931 caballero
public class LayerPropertiesExtension extends Extension{
15
16
        public void initialize() {
17
                // TODO Auto-generated method stub
18 15637 jmvivo
                registerIcons();
19 8931 caballero
        }
20 21666 vcaballero
21 15637 jmvivo
        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 8931 caballero
64
        public void execute(String actionCommand) {
65 29616 jpiera
                org.gvsig.andami.ui.mdiManager.IWindow view = PluginServices.getMDIManager().getActiveWindow();
66 31496 jjdelcerro
                if (!(view instanceof DefaultViewPanel))
67 8931 caballero
                        return;
68 31496 jjdelcerro
                DefaultViewPanel vista=(DefaultViewPanel)view;
69
                ViewDocument model = vista.getModel();
70 8931 caballero
                MapContext mapa = model.getMapContext();
71
                MapControl mapCtrl = vista.getMapControl();
72
                FLayer[] layers=mapa.getLayers().getActives();
73
                //layers[0].
74 29685 jpiera
                //REFACTORING
75
                //LayerProperties layerProperties=new LayerProperties(layers[0],((FLyrVect)layers[0]).getLegend());
76
                //PluginServices.getMDIManager().addWindow(layerProperties);
77 8931 caballero
        }
78
79
        public boolean isEnabled() {
80
                return true;
81
        }
82
83
        public boolean isVisible() {
84
                return true;
85
        }
86
87
}