Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / properties / dialog / PropertiesRasterRegistrableDialog.java @ 12154

History | View | Annotate | Download (3.31 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 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.properties.dialog;
20

    
21
import java.awt.BorderLayout;
22
import java.util.TreeMap;
23

    
24
import javax.swing.JPanel;
25

    
26
import com.iver.andami.PluginServices;
27
import com.iver.andami.ui.mdiManager.IWindow;
28
import com.iver.andami.ui.mdiManager.WindowInfo;
29
/**
30
 * @author Nacho Brodin (nachobrodin@gmail.com)
31
 */
32
public class PropertiesRasterRegistrableDialog extends JPanel implements IWindow{
33
        private static final long   serialVersionUID = -2920327107654323732L;
34
        private RegistrableTabPanel registrable      = null;
35
        private ButtonsPanel        buttons          = null;
36
        private TreeMap             params           = new TreeMap();
37

    
38
        public PropertiesRasterRegistrableDialog() {
39
                registrable = new RegistrableTabPanel();
40
                buttons = new ButtonsPanel();
41
                new PropertiesRasterListener(this);
42
                initialize();
43
        }
44

    
45
        private void initialize() {
46
                this.setLayout(new BorderLayout());
47
                add(registrable, BorderLayout.CENTER);
48
                add(buttons, BorderLayout.SOUTH);
49
        }
50

    
51
        /**
52
         * Add params to register panels. Each extension knows the name and the class to its 
53
         * parameters. This method provide a generic way to register this.
54
         * @param key Parameter name
55
         * @param value parameter's value
56
         */
57
        public void setParam(String key, Object value) {
58
                params.put(key, value);
59
        }
60

    
61
        /**
62
         * Get a parameter registered by the user of this class. Each extension knows the 
63
         * name and the class to its parameters. This method provide a generic way to recover this.
64
         * @param key Parameter name
65
         * @return parameter's value
66
         */
67
        public Object getParam(String key) {
68
                return params.get(key);
69
        }
70

    
71
        /*
72
         *  (non-Javadoc)
73
         * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
74
         */
75
        public WindowInfo getWindowInfo() {
76
                WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
77
                m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_raster"));
78
                m_viewinfo.setWidth(500);
79
                m_viewinfo.setHeight(310);
80
                return m_viewinfo;
81
        }
82

    
83
        /**
84
         * Get buttons panel
85
         * @return ButtonsPanel
86
         */
87
        public ButtonsPanel getButtonsPanel() {
88
                return this.buttons;
89
        }
90

    
91
        /**
92
         * Get registrable panel
93
         * @return RegistrableTabPanel
94
         */
95
        public RegistrableTabPanel getRegistrablePanel() {
96
                return this.registrable;
97
        }
98

    
99
        /**
100
         * Acciones a ejecutar cuando se cancela
101
         */
102
        public void close() {
103
                try {
104
                        PluginServices.getMDIManager().closeWindow(PropertiesRasterRegistrableDialog.this);
105
                } catch (ArrayIndexOutOfBoundsException e) {
106
                        // Si la ventana no se puede eliminar no hacemos nada
107
                }
108
        }
109
}