Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / GraphicControls.java @ 774

History | View | Annotate | Download (2.02 KB)

1
/*
2
 * Created on 15-jul-2004
3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6
 */
7
package com.iver.cit.gvsig;
8

    
9
import org.apache.log4j.Logger;
10

    
11
import com.iver.andami.PluginServices;
12
import com.iver.andami.plugins.Extension;
13
import com.iver.andami.ui.mdiManager.View;
14
import com.iver.cit.gvsig.gui.layout.FLayoutGraphics;
15
import com.iver.cit.gvsig.gui.layout.Layout;
16

    
17

    
18
/**
19
 * @author Vicente Caballero Navarro
20
 */
21
public class GraphicControls implements Extension {
22
        private static Logger logger = Logger.getLogger(LayoutControls.class.getName());
23

    
24
        /**
25
         * DOCUMENT ME!
26
         *
27
         * @param s DOCUMENT ME!
28
         */
29
        public void execute(String s) {
30
                Layout layout = (Layout) PluginServices.getMDIManager().getActiveView();
31
                FLayoutGraphics lg= new FLayoutGraphics(layout);
32
                logger.debug("Comand : " + s);
33

    
34
                if (s.compareTo("SIMPLIFICAR") == 0) {
35
                        lg.simplify();
36
                } else if (s.compareTo("AGRUPAR") == 0) {
37
                        lg.grouping();
38
                } else if (s.compareTo("DESAGRUPAR") == 0) {
39
                        lg.ungrouping();
40
                } else if (s.compareTo("PROPIEDADES") == 0) {
41
                        lg.openFFrameDialog();
42
                } else if (s.compareTo("ALINEAR") == 0) {
43
                        lg.aligning();
44
                } else if (s.compareTo("DETRAS") == 0) {
45
                        lg.behind();
46
                } else if (s.compareTo("DELANTE") == 0) {
47
                        lg.before();
48
                } else if (s.compareTo("BORDEAR") == 0) {
49
                        lg.border();
50
                } else if (s.compareTo("POSICIONAR") == 0) {
51
                        lg.position();
52
                } 
53
        }
54

    
55
        /**
56
         * @see com.iver.mdiApp.plugins.Extension#isVisible()
57
         */
58
        public boolean isVisible() {
59
                View f = PluginServices.getMDIManager().getActiveView();
60

    
61
                if (f == null) {
62
                        return false;
63
                }
64

    
65
                if (f.getClass() == Layout.class) {
66
                        Layout layout = (Layout) f;
67

    
68
                        return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0;
69
                } else {
70
                        return false;
71
                }
72
        }
73

    
74
        /**
75
         * @see com.iver.andami.plugins.Extension#inicializar()
76
         */
77
        public void inicializar() {
78
        }
79

    
80
        /**
81
         * @see com.iver.andami.plugins.Extension#isEnabled()
82
         */
83
        public boolean isEnabled() {
84
                return true;
85
        }
86
}