Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extRasterTools-SE / src / org / gvsig / rastertools / filter / ui / FilterMainPanel.java @ 30008

History | View | Annotate | Download (3.32 KB)

1 19285 bsanchez
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 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.filter.ui;
20
21
import java.awt.BorderLayout;
22
23
import javax.swing.JPanel;
24
25
import org.gvsig.gui.beans.treelist.TreeListContainer;
26
import org.gvsig.raster.beans.previewbase.IUserPanelInterface;
27 20277 bsanchez
import org.gvsig.raster.util.RasterToolsUtil;
28 19285 bsanchez
import org.gvsig.rastertools.filter.FilterListener;
29
/**
30 19305 bsanchez
 * Es el panel central del panel de filtros. Se compone de dos partes.
31
 * El lateral izquierdo contiene la lista de filtros posibles y filtros seleccionados
32
 * La parte derecha contiene las opciones de los filtros
33
 * En la parte de abajo tenemos el fichero de salida.
34 19285 bsanchez
 *
35
 * @version 22/02/2008
36
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
37
 */
38 19535 bsanchez
public class FilterMainPanel extends JPanel implements IUserPanelInterface {
39 19305 bsanchez
        private static final long serialVersionUID = -406089078173595028L;
40 19285 bsanchez
        private TreeListContainer treeListContainer = null;
41
        private JPanel            centralPanel      = null;
42
        private FilterListener    filterListener    = null;
43
44
        public FilterMainPanel(FilterListener filterListener) {
45
                this.filterListener = filterListener;
46
                initialize();
47
        }
48
49
        private void initialize() {
50
                setLayout(new BorderLayout(5, 5));
51
                add(getTreeListContainer(), BorderLayout.WEST);
52
                add(getCentralPanel(), BorderLayout.CENTER);
53
        }
54
55
        /*
56
         * (non-Javadoc)
57
         * @see org.gvsig.raster.beans.previewbase.IUserPanelInterface#getPanel()
58
         */
59
        public JPanel getPanel() {
60
                return this;
61
        }
62
63
        /**
64
         * This method initializes jPanel
65
         * @return javax.swing.JPanel
66
         */
67
        public TreeListContainer getTreeListContainer() {
68
                if (treeListContainer == null) {
69
                        treeListContainer = new TreeListContainer();
70
                        treeListContainer.getTree().expandRow(0);
71
                        treeListContainer.addTreeListListener(filterListener);
72
                        treeListContainer.addChangeSelectionListener(filterListener);
73 20277 bsanchez
                        treeListContainer.setAddToolTipText(RasterToolsUtil.getText(this, "anadir_filtro"));
74
                        treeListContainer.setDelToolTipText(RasterToolsUtil.getText(this, "eliminar_filtro"));
75 19285 bsanchez
                }
76
                return treeListContainer;
77
        }
78
79
        /**
80
         * Obtener y generar el JPanel central que contendr? las propiedades
81
         * @return
82
         */
83
        public JPanel getCentralPanel() {
84
                if (centralPanel == null) {
85
                        centralPanel = new JPanel();
86
                        centralPanel.setLayout(new BorderLayout());
87
                }
88
                return centralPanel;
89
        }
90
91
        /*
92
         * (non-Javadoc)
93
         * @see org.gvsig.raster.beans.previewbase.IUserPanelInterface#getTitle()
94
         */
95
        public String getTitle() {
96
                return "Filtros";
97
        }
98
}