Statistics
| Revision:

svn-gvsig-desktop / branches / gvSIG_GisPlanet / applications / appgvSIG / src / com / iver / cit / gvsig / GraphicControls.java @ 2147

History | View | Annotate | Download (3.34 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
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package com.iver.cit.gvsig;
48

    
49
import com.iver.andami.PluginServices;
50
import com.iver.andami.plugins.Extension;
51
import com.iver.andami.ui.mdiManager.View;
52

    
53
import com.iver.cit.gvsig.gui.layout.FLayoutGraphics;
54
import com.iver.cit.gvsig.gui.layout.Layout;
55

    
56
import org.apache.log4j.Logger;
57

    
58

    
59
/**
60
 * Extensi?n que actua sobre el Layout para controlas las diferentes
61
 * operaciones sobre los gr?ficos.
62
 *
63
 * @author Vicente Caballero Navarro
64
 */
65
public class GraphicControls implements Extension {
66
        private static Logger logger = Logger.getLogger(GraphicControls.class.getName());
67

    
68
        /**
69
         * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
70
         */
71
        public void execute(String s) {
72
                Layout layout = (Layout) PluginServices.getMDIManager().getActiveView();
73
                FLayoutGraphics lg = new FLayoutGraphics(layout);
74
                logger.debug("Comand : " + s);
75

    
76
                if (s.compareTo("SIMPLIFICAR") == 0) {
77
                        lg.simplify();
78
                } else if (s.compareTo("AGRUPAR") == 0) {
79
                        lg.grouping();
80
                } else if (s.compareTo("DESAGRUPAR") == 0) {
81
                        lg.ungrouping();
82
                } else if (s.compareTo("PROPIEDADES") == 0) {
83
                        lg.openFFrameDialog();
84
                } else if (s.compareTo("ALINEAR") == 0) {
85
                        lg.aligning();
86
                } else if (s.compareTo("DETRAS") == 0) {
87
                        lg.behind();
88
                } else if (s.compareTo("DELANTE") == 0) {
89
                        lg.before();
90
                } else if (s.compareTo("BORDEAR") == 0) {
91
                        lg.border();
92
                } else if (s.compareTo("POSICIONAR") == 0) {
93
                        lg.position();
94
                }
95
        }
96

    
97
        /**
98
         * @see com.iver.mdiApp.plugins.Extension#isVisible()
99
         */
100
        public boolean isVisible() {
101
                View f = PluginServices.getMDIManager().getActiveView();
102

    
103
                if (f == null) {
104
                        return false;
105
                }
106

    
107
                if (f.getClass() == Layout.class) {
108
                        Layout layout = (Layout) f;
109

    
110
                        return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0;
111
                } else {
112
                        return false;
113
                }
114
        }
115

    
116
        /**
117
         * @see com.iver.andami.plugins.Extension#inicializar()
118
         */
119
        public void inicializar() {
120
        }
121

    
122
        /**
123
         * @see com.iver.andami.plugins.Extension#isEnabled()
124
         */
125
        public boolean isEnabled() {
126
                return true;
127
        }
128
}