Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.exportto.app / org.gvsig.exportto.app.mainplugin / src / main / java / org / gvsig / exportto / app / extension / ExporttoWindow.java @ 40557

History | View | Annotate | Download (2.97 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.exportto.app.extension;
25

    
26
import java.awt.BorderLayout;
27
import java.awt.Dimension;
28

    
29
import javax.swing.JPanel;
30

    
31
import org.gvsig.andami.ui.mdiManager.IWindow;
32
import org.gvsig.andami.ui.mdiManager.WindowInfo;
33
import org.gvsig.exportto.swing.ExporttoWindowManager;
34

    
35
/**
36
 * {@link IWindow} to show a Exportto.
37
 * 
38
 * @author gvSIG Team
39
 * @version $Id$
40
 */
41
public class ExporttoWindow extends JPanel implements IWindow {
42

    
43
    private static final long serialVersionUID = -4401123724140025094L;
44

    
45
    private WindowInfo info;
46

    
47
    private Object profile = WindowInfo.EDITOR_PROFILE;
48

    
49
    /**
50
     * Constructor.
51
     * 
52
     * @param panel
53
     *            the panel to show
54
     * @param title
55
     *            the window title
56
     * @param mode
57
     *            the window mode
58
     * @see {@link ExporttoWindowManager#MODE_DIALOG}
59
     * @see {@link ExporttoWindowManager#MODE_TOOL}
60
     * @see {@link ExporttoWindowManager#MODE_WINDOW}
61
     */
62
    public ExporttoWindow(JPanel panel, String title, int mode) {
63
        this.setLayout(new BorderLayout());
64
        add(panel, BorderLayout.CENTER);
65
        Dimension dimension = new Dimension(800, 400);
66
        setSize(dimension);
67
        int code =
68
            WindowInfo.ICONIFIABLE | WindowInfo.MAXIMIZABLE
69
                | WindowInfo.RESIZABLE;
70
        switch (mode) {
71
        case ExporttoWindowManager.MODE_DIALOG:
72
            code |= WindowInfo.MODALDIALOG;
73
            profile = WindowInfo.DIALOG_PROFILE;
74
            break;
75
        case ExporttoWindowManager.MODE_TOOL:
76
            code |= WindowInfo.PALETTE;
77
            profile = WindowInfo.TOOL_PROFILE;
78
            break;
79
        case ExporttoWindowManager.MODE_WINDOW:
80
        default:
81
            code |= WindowInfo.MODELESSDIALOG;
82
            profile = WindowInfo.EDITOR_PROFILE;
83
        }
84
        info = new WindowInfo(code);
85
        info.setTitle(title);
86
        info.setMinimumSize(dimension);
87
    }
88

    
89
    public WindowInfo getWindowInfo() {
90
        return info;
91
    }
92

    
93
    public Object getWindowProfile() {
94
        return profile;
95
    }
96
}