Statistics
| Revision:

gvsig-3d / 2.1 / trunk / org.gvsig.gvsig3d / org.gvsig.gvsig3d.app / org.gvsig.gvsig3d.app.commons / src / main / java / org / gvsig / gvsig3d / app / view / ViewProperties3DExtension.java @ 385

History | View | Annotate | Download (2.48 KB)

1
/* gvSIG 3D extension for gvSIG
2
 *
3
 * Copyright (C) 2012 Prodevelop.
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
 *   Prodevelop, S.L.
22
 *   Pza. Don Juan de Villarrasa, 14 - 5
23
 *   46001 Valencia
24
 *   Spain
25
 *
26
 *   +34 963 510 612
27
 *   +34 963 510 968
28
 *   prode@prodevelop.es
29
 *   http://www.prodevelop.es
30
 */
31
/*
32
 * AUTHORS:
33
 * 2012 AI2 - Instituto Universitario de Automatica e Informatica Industrial.
34
 * Universitat Politecnica de Valencia (UPV)
35
 * http://www.ai2.upv.es
36
 */
37

    
38

    
39
package org.gvsig.gvsig3d.app.view;
40

    
41
import org.gvsig.andami.PluginServices;
42
import org.gvsig.andami.plugins.Extension;
43
import org.gvsig.andami.ui.mdiManager.IWindow;
44
import org.gvsig.app.project.documents.view.ViewDocument;
45
import org.gvsig.gvsig3d.app.extension.DefaultView3DPanel;
46

    
47

    
48
/**
49
 * @author Jesus Zarzoso- jzarzoso@ai2.upv.es
50
 * @version $Id$
51
 * 
52
 */
53
public class ViewProperties3DExtension extends Extension { 
54

    
55
        public void initialize() {
56
        }
57

    
58
        /**
59
         * DOCUMENT ME!
60
         * 
61
         * @param s
62
         *            DOCUMENT ME!
63
         */
64
        public void execute(String s) {
65
                IWindow view = PluginServices
66
                                .getMDIManager().getActiveWindow();
67
                if (!(view instanceof DefaultView3DPanel))
68
                        return;
69

    
70
                DefaultView3DPanel vista3D = (DefaultView3DPanel) view;
71
                ViewDocument model = vista3D.getViewDocument();
72

    
73
                if (s.equals("PROPERTIES")) {
74
                        ViewProperties3D viewProperties = new ViewProperties3D(vista3D.getViewDocument(),false);
75
                        PluginServices.getMDIManager().addWindow(viewProperties);
76
                }
77
        }
78

    
79
        /**
80
         * DOCUMENT ME!
81
         * 
82
         * @return DOCUMENT ME!
83
         */
84
        public boolean isEnabled() {
85
                return true;
86
        }
87

    
88
        /**
89
         * DOCUMENT ME!
90
         * 
91
         * @return DOCUMENT ME!
92
         */
93
        public boolean isVisible() {
94
                IWindow f = PluginServices
95
                                .getMDIManager().getActiveWindow();
96
                if (f == null) {
97
                        return false;
98
                }
99
                return (f instanceof DefaultView3DPanel);
100
        }
101
}