Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / ViewPropertiesExtension.java @ 9532

History | View | Annotate | Download (4.06 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
42
 *
43
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
44
 *
45
 * This program is free software; you can redistribute it and/or
46
 * modify it under the terms of the GNU General Public License
47
 * as published by the Free Software Foundation; either version 2
48
 * of the License, or (at your option) any later version.
49
 *
50
 * This program is distributed in the hope that it will be useful,
51
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
52
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
53
 * GNU General Public License for more details.
54
 *
55
 * You should have received a copy of the GNU General Public License
56
 * along with this program; if not, write to the Free Software
57
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
58
 *
59
 * For more information, contact:
60
 *
61
 *  Generalitat Valenciana
62
 *   Conselleria d'Infraestructures i Transport
63
 *   Av. Blasco Ib??ez, 50
64
 *   46010 VALENCIA
65
 *   SPAIN
66
 *
67
 *      +34 963862235
68
 *   gvsig@gva.es
69
 *      www.gvsig.gva.es
70
 *
71
 *    or
72
 *
73
 *   IVER T.I. S.A
74
 *   Salamanca 50
75
 *   46005 Valencia
76
 *   Spain
77
 *
78
 *   +34 963163400
79
 *   dac@iver.es
80
 */
81
package com.iver.cit.gvsig;
82

    
83
import com.iver.andami.PluginServices;
84
import com.iver.andami.plugins.Extension;
85
import com.iver.cit.gvsig.project.documents.view.IProjectView;
86
import com.iver.cit.gvsig.project.documents.view.ProjectView;
87
import com.iver.cit.gvsig.project.documents.view.gui.View;
88
import com.iver.cit.gvsig.project.documents.view.gui.ViewProperties;
89

    
90

    
91
/**
92
 * DOCUMENT ME!
93
 *
94
 * @author Vicente Caballero Navarro
95
 */
96
public class ViewPropertiesExtension extends Extension {
97
    /**
98
     * DOCUMENT ME!
99
     */
100
    public void initialize() {
101
    }
102

    
103
    /**
104
     * DOCUMENT ME!
105
     *
106
     * @param s DOCUMENT ME!
107
     */
108
    public void execute(String s) {
109
        View vista = (View) PluginServices.getMDIManager().getActiveWindow();
110
        IProjectView model = vista.getModel();
111

    
112
        if (s.compareTo("PROPERTIES") == 0) {
113
                ProjectView viewModel = (ProjectView)model;
114
                if (viewModel != null) {
115
              ViewProperties viewProperties = new ViewProperties(viewModel);
116
              PluginServices.getMDIManager().addWindow(viewProperties);
117
              if (viewProperties.isAcceppted()) {
118
                      viewModel.setModified(true);
119
              }
120
                }
121
        }
122
    }
123

    
124
    /**
125
     * DOCUMENT ME!
126
     *
127
     * @return DOCUMENT ME!
128
     */
129
    public boolean isEnabled() {
130
        return true;
131
    }
132

    
133
    /**
134
     * DOCUMENT ME!
135
     *
136
     * @return DOCUMENT ME!
137
     */
138
    public boolean isVisible() {
139
        com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager()
140
                                                             .getActiveWindow();
141
        if (f == null) {
142
            return false;
143
        }
144
        return (f instanceof View);
145
    }
146
}