Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / vectorizacion / MainDialog.java @ 24986

History | View | Annotate | Download (3.38 KB)

1 22396 nbrodin
/* 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
package org.gvsig.rastertools.vectorizacion;
20
21
import java.awt.BorderLayout;
22
import java.awt.Dimension;
23
24
import javax.swing.JPanel;
25
26
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
27
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
28
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
29
30
import com.iver.andami.PluginServices;
31
import com.iver.andami.ui.mdiManager.IWindow;
32
import com.iver.andami.ui.mdiManager.WindowInfo;
33
34
/**
35
 * Dialogo para el preprocesado del raster antes de la aplicaci?n de la vectorizaci?n.
36
 *
37
 * 12/06/2008
38
 * @author Nacho Brodin nachobrodin@gmail.com
39
 */
40
public class MainDialog extends JPanel implements IWindow, ButtonsPanelListener {
41
        private static final long            serialVersionUID = -5374834293534046986L;
42
        private String                       name             = null;
43
        private MainPanel                    panel            = null;
44
45
        /**
46
         * Constructor
47
         * @param width Ancho
48
         * @param height Alto
49
         */
50 22827 nbrodin
        public MainDialog(int width, int height, String name, MainPanel mainPanel) {
51 22396 nbrodin
                this.name = name;
52
                this.panel = mainPanel;
53
                this.setPreferredSize(new Dimension(width, height));
54
                this.setSize(width, height);
55
                this.setLayout(new BorderLayout(5, 5));
56
                this.add(mainPanel, java.awt.BorderLayout.CENTER);
57
        }
58
59
        /**
60
         * Obtiene el panel principal
61
         * @return HistogramPanel
62
         */
63
        public MainPanel getMainPanel() {
64
                return panel;
65
        }
66
67
68
        /*
69
         * (non-Javadoc)
70
         * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
71
         */
72
        public WindowInfo getWindowInfo() {
73
                WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
74
                if (name != null)
75
                        m_viewinfo.setAdditionalInfo(name);
76
                m_viewinfo.setTitle(PluginServices.getText(this, "vectorization"));
77
                m_viewinfo.setHeight(this.getHeight());
78
                m_viewinfo.setWidth(this.getWidth());
79
                return m_viewinfo;
80
        }
81
82
        /**
83
         * Acciones a ejecutar cuando se cancela
84
         */
85
        public void close() {
86
                try {
87
                        PluginServices.getMDIManager().closeWindow(this);
88
                } catch (ArrayIndexOutOfBoundsException e) {
89
                        // Si la ventana no se puede eliminar no hacemos nada
90
                }
91
        }
92
93
        /*
94
         * (non-Javadoc)
95
         * @see org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener#actionButtonPressed(org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent)
96
         */
97
        public void actionButtonPressed(ButtonsPanelEvent e) {
98
                if (e.getButton() == ButtonsPanel.BUTTON_CLOSE) {
99
                        close();
100
                }
101
        }
102 24986 jcampos
103
        public Object getWindowProfile() {
104
                return WindowInfo.PROPERTIES_PROFILE;
105
        }
106 22396 nbrodin
}