Statistics
| Revision:

root / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / ui / ShowTreeDialogPanel.java @ 3073

History | View | Annotate | Download (3.24 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
* For more information, contact:
20
*
21
*  Generalitat Valenciana
22
*   Conselleria d'Infraestructures i Transport
23
*   Av. Blasco Ib??ez, 50
24
*   46010 VALENCIA
25
*   SPAIN
26
*
27
*      +34 963862235
28
*   gvsig@gva.es
29
*      www.gvsig.gva.es
30
*
31
*    or
32
*
33
*   IVER T.I. S.A
34
*   Salamanca 50
35
*   46005 Valencia
36
*   Spain
37
*
38
*   +34 963163400
39
*   dac@iver.es
40
*/
41
package es.gva.cit.catalogClient.ui;
42

    
43

    
44
import java.awt.Dimension;
45
import java.awt.FlowLayout;
46
import java.awt.event.ActionEvent;
47
import java.awt.event.ActionListener;
48

    
49
import javax.swing.BoxLayout;
50
import javax.swing.JButton;
51
import javax.swing.JPanel;
52

    
53
import es.gva.cit.catalogClient.metadataXML.XMLNode;
54

    
55

    
56
/**
57
 * @author Jorge Piera Llodra (piera_jor@gva.es)
58
 */
59
public class ShowTreeDialogPanel extends JPanel implements ActionListener {
60
    //Panels
61
    JPanel ppalPanel = null;
62
    ShowTreePanel controlsPanel = null;
63
    JPanel buttonsPanel = null;
64

    
65
    //Buttons
66
    JButton close = null;
67

    
68
    //Otros
69
    XMLNode node = null;
70
    boolean nuevo = true;
71

    
72
    public ShowTreeDialogPanel(XMLNode node) {
73
        this.node = node;
74

    
75
        ppalPanel = new JPanel();
76
        ppalPanel.setLayout(new BoxLayout(ppalPanel, BoxLayout.Y_AXIS));
77

    
78
        ppalPanel.add(getControlsPanel(), null);
79
        ppalPanel.add(getButtonPanel(), null);
80

    
81
        add(ppalPanel);
82

    
83
        setDefaultButtonListeners();
84
    }
85

    
86
    public JPanel getControlsPanel() {
87
        if (controlsPanel == null) {
88
            controlsPanel = new ShowTreePanel(node);
89
        }
90

    
91
        return controlsPanel;
92
    }
93

    
94
    public JPanel getButtonPanel() {
95
        if (buttonsPanel == null) {
96
            buttonsPanel = new JPanel(new FlowLayout());
97
            buttonsPanel.add(getCloseButton());
98
        }
99

    
100
        return buttonsPanel;
101
    }
102

    
103
    public JButton getCloseButton() {
104
        if (close == null) {
105
            close = new JButton("Cerrar");
106
            close.setSize(new Dimension(30, 20));
107
            close.setActionCommand("Cerrar");
108
        }
109

    
110
        return close;
111
    }
112

    
113
    public void setDefaultButtonListeners() {
114
        getCloseButton().addActionListener(this);
115
    }
116
    
117
    public void closeButtonActionPerformed(){
118
        this.setVisible(false);
119
    }
120

    
121
    /* (non-Javadoc)
122
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
123
     */
124
    public void actionPerformed(ActionEvent e) {
125
        //Buscar
126
        if (e.getActionCommand() == "Cerrar") {
127
            closeButtonActionPerformed();
128
        }
129
    }
130
}