Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / colortable / ui / ColorTableDialog.java @ 24986

History | View | Annotate | Download (3.14 KB)

1
/* 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.colortable.ui;
20

    
21
import java.awt.BorderLayout;
22
import java.awt.Dimension;
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.IWindowListener;
29
import com.iver.andami.ui.mdiManager.WindowInfo;
30
import com.iver.cit.gvsig.fmap.layers.FLayer;
31
/**
32
* <code>ColorTableDialog</code>. Creaci?n de la ventana de ColorTable para gvSIG.
33
*
34
* @version 17/04/2007
35
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
36
*/
37
public class ColorTableDialog extends JPanel implements IWindow, IWindowListener {
38
        private static final long serialVersionUID = -5374834293534046986L;
39
        private FLayer layer = null;
40

    
41
        /**
42
         * Panel de recortado de imagen que est? en la libreria raster
43
         */
44
        private ColorTablePanel colorTablePanel = null;
45
        
46
        /**
47
         * Constructor
48
         * @param width Ancho
49
         * @param height Alto
50
         */
51
        public ColorTableDialog(FLayer layer, int width, int height) {
52
                this.layer = layer;
53
                setPreferredSize(new Dimension(width, height));
54
                setSize(width, height);
55
                setLayout(new BorderLayout(5, 5));
56
                add(getColorTablePanel(), java.awt.BorderLayout.CENTER);
57
        }
58

    
59
        /**
60
         * Obtiene el panel con el histograma
61
         * @return HistogramPanel
62
         */
63
        private ColorTablePanel getColorTablePanel() {
64
                if (colorTablePanel == null) {
65
                        colorTablePanel = new ColorTablePanel(layer, this);
66
                }
67
                return colorTablePanel;
68
        }
69

    
70
        /*
71
         * (non-Javadoc)
72
         * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
73
         */
74
        public WindowInfo getWindowInfo() {
75
                WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
76
                if(getColorTablePanel().getLayer() != null)
77
                        m_viewinfo.setAdditionalInfo(getColorTablePanel().getLayer().getName());
78
                m_viewinfo.setTitle(PluginServices.getText(this, "tablas_color"));
79
                m_viewinfo.setHeight(this.getHeight());
80
                m_viewinfo.setWidth(this.getWidth());
81
                return m_viewinfo;
82
        }
83

    
84
        /*
85
         * (non-Javadoc)
86
         * @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
87
         */
88
        public void windowClosed() {
89
                getColorTablePanel().windowClosed();
90
        }
91

    
92
        /*
93
         * (non-Javadoc)
94
         * @see com.iver.andami.ui.mdiManager.IWindowListener#windowActivated()
95
         */
96
        public void windowActivated() {}
97

    
98
        public Object getWindowProfile() {
99
                return WindowInfo.PROPERTIES_PROFILE;
100
        }
101
}