Statistics
| Revision:

gvsig-3d / 2.0 / trunk / org.gvsig.gvsig3d.app / org.gvsig.gvsig3d.app.extension / src / main / java / org / gvsig / gvsig3d / app / extension / Gvsig3DWindow.java @ 380

History | View | Annotate | Download (3.11 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.extension;
40

    
41
import java.awt.Dimension;
42

    
43
import javax.swing.JPanel;
44

    
45
import org.gvsig.andami.ui.mdiManager.IWindow;
46
import org.gvsig.andami.ui.mdiManager.WindowInfo;
47
import org.gvsig.gvsig3d.swing.Gvsig3DWindowManager;
48

    
49
/**
50
 * {@link IWindow} to show a Gvsig3D.
51
 * 
52
 * @author Jesus Zarzoso- jzarzoso@ai2.upv.es
53
 * @version $Id$
54
 */
55
public class Gvsig3DWindow extends JPanel implements IWindow {
56

    
57
    private static final long serialVersionUID = -4401123724140025094L;
58

    
59
    private WindowInfo info;
60

    
61
    private Object profile = WindowInfo.EDITOR_PROFILE;
62

    
63
    /**
64
     * Constructor.
65
     * 
66
     * @param panel
67
     *            the panel to show
68
     * @param title
69
     *            the window title
70
     * @param mode
71
     *            the window mode
72
     * @see {@link Gvsig3DWindowManager#MODE_DIALOG}
73
     * @see {@link Gvsig3DWindowManager#MODE_TOOL}
74
     * @see {@link Gvsig3DWindowManager#MODE_WINDOW}
75
     */
76
    public Gvsig3DWindow(JPanel panel, String title, int mode) {
77
        add(panel);
78
        Dimension dimension = new Dimension(600, 200);
79
        setSize(dimension);
80
        int code =
81
            WindowInfo.ICONIFIABLE | WindowInfo.MAXIMIZABLE
82
                | WindowInfo.RESIZABLE;
83
        switch (mode) {
84
        case Gvsig3DWindowManager.MODE_DIALOG:
85
            code |= WindowInfo.MODALDIALOG;
86
            profile = WindowInfo.DIALOG_PROFILE;
87
            break;
88
        case Gvsig3DWindowManager.MODE_TOOL:
89
            code |= WindowInfo.PALETTE;
90
            profile = WindowInfo.TOOL_PROFILE;
91
            break;
92
        case Gvsig3DWindowManager.MODE_WINDOW:
93
        default:
94
            code |= WindowInfo.MODELESSDIALOG;
95
            profile = WindowInfo.EDITOR_PROFILE;
96
        }
97
        info = new WindowInfo(code);
98
        info.setTitle(title);
99
        info.setMinimumSize(dimension);
100
    }
101

    
102
    public WindowInfo getWindowInfo() {
103
        return info;
104
    }
105

    
106
    public Object getWindowProfile() {
107
        return profile;
108
    }
109
}