Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / gui / ViewProperties.java @ 41402

History | View | Annotate | Download (2.93 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.app.project.documents.view.gui;
25

    
26
import java.awt.Dimension;
27
import org.gvsig.andami.PluginServices;
28
import org.gvsig.andami.ui.mdiManager.SingletonWindow;
29
import org.gvsig.andami.ui.mdiManager.WindowInfo;
30
import org.gvsig.app.project.documents.view.ViewDocument;
31
import org.gvsig.i18n.Messages;
32
import org.gvsig.propertypage.BasePropertiesPageDialog;
33

    
34
/**
35
 * Dialogo donde se muestran las propiedades de una vista
36
 * 
37
 * @author gvSIG Team
38
 */
39
public class ViewProperties extends BasePropertiesPageDialog implements SingletonWindow {
40

    
41
    private static final long serialVersionUID = 5328865370833315385L;
42
    private ViewDocument viewDocument;
43
    
44
    /**
45
     * This is the default constructor
46
     * 
47
     * @param viewDocument
48
     *            Vista que se representa
49
     */
50
    public ViewProperties(ViewDocument viewDocument) {
51
        this.viewDocument = viewDocument;
52
        this.init(ViewDocument.VIEW_PROPERTIES_PAGE_GROUP,viewDocument);
53
    }
54

    
55
    @Override
56
    protected boolean useTabsAlwais() {
57
        return super.useTabsAlwais();
58
        // return true;
59
    }
60

    
61
    
62
    public boolean isAcceppted() {
63
        return this.getUserAction()==BasePropertiesPageDialog.ACTION_ACCEPT;
64
    }
65

    
66
    public Object getWindowModel() {
67
        return viewDocument;
68
    }
69

    
70
    public Object getWindowProfile() {
71
        return WindowInfo.PROPERTIES_PROFILE;
72
    }
73
    
74
    public WindowInfo getWindowInfo() {
75
        WindowInfo m_viewinfo = new WindowInfo(
76
                WindowInfo.RESIZABLE |
77
                WindowInfo.MAXIMIZABLE |
78
                WindowInfo.MAXIMIZABLE |
79
                WindowInfo.ICONIFIABLE
80
        );
81
        
82
        this.validate();
83
        m_viewinfo.setTitle(Messages.getText("propiedades_vista"));
84
        Dimension dim = getPreferredSize();
85
        m_viewinfo.setWidth(dim.width);
86
        m_viewinfo.setHeight(dim.height);
87
        return m_viewinfo;
88
    }    
89

    
90
    @Override
91
    protected void closeDialog() {
92
        PluginServices.getMDIManager().closeWindow(this);
93
    }
94
    
95
    
96
}