svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / ui / ShowTreeDialogPanel.java @ 2658
History | View | Annotate | Download (1.74 KB)
1 |
/*
|
---|---|
2 |
* Created on 04-may-2005
|
3 |
*/
|
4 |
package es.gva.cit.catalogClient.ui; |
5 |
|
6 |
|
7 |
import java.awt.Dimension; |
8 |
import java.awt.FlowLayout; |
9 |
import java.awt.event.ActionEvent; |
10 |
import java.awt.event.ActionListener; |
11 |
|
12 |
|
13 |
import javax.swing.BoxLayout; |
14 |
import javax.swing.JButton; |
15 |
import javax.swing.JPanel; |
16 |
|
17 |
|
18 |
import org.w3c.dom.Node; |
19 |
|
20 |
|
21 |
|
22 |
/**
|
23 |
* @author jpiera
|
24 |
*/
|
25 |
public class ShowTreeDialogPanel extends JPanel implements ActionListener{ |
26 |
//Panels
|
27 |
JPanel ppalPanel = null; |
28 |
ShowTreePanel controlsPanel = null;
|
29 |
JPanel buttonsPanel = null; |
30 |
//Buttons
|
31 |
JButton close = null; |
32 |
//Otros
|
33 |
Node node = null;
|
34 |
boolean nuevo = true; |
35 |
|
36 |
public ShowTreeDialogPanel(Node node){
|
37 |
this.node = node;
|
38 |
|
39 |
ppalPanel = new JPanel(); |
40 |
ppalPanel.setLayout(new BoxLayout(ppalPanel, BoxLayout.Y_AXIS)); |
41 |
|
42 |
ppalPanel.add(getControlsPanel(),null);
|
43 |
ppalPanel.add(getButtonPanel(),null);
|
44 |
|
45 |
add(ppalPanel); |
46 |
|
47 |
setDefaultButtonListeners(); |
48 |
} |
49 |
|
50 |
public JPanel getControlsPanel() { |
51 |
if (controlsPanel == null){ |
52 |
controlsPanel = new ShowTreePanel(node);
|
53 |
} |
54 |
return controlsPanel;
|
55 |
} |
56 |
|
57 |
public JPanel getButtonPanel() { |
58 |
if (buttonsPanel == null) { |
59 |
buttonsPanel = new JPanel(new FlowLayout()); |
60 |
buttonsPanel.add(getCloseButton()); |
61 |
} |
62 |
return buttonsPanel;
|
63 |
} |
64 |
|
65 |
public JButton getCloseButton() { |
66 |
if (close == null) { |
67 |
close = new JButton("Cerrar"); |
68 |
close.setSize(new Dimension(30,20)); |
69 |
close.setActionCommand("Cerrar");
|
70 |
} |
71 |
return close;
|
72 |
} |
73 |
|
74 |
public void setDefaultButtonListeners() { |
75 |
getCloseButton().addActionListener(this);
|
76 |
} |
77 |
|
78 |
/* (non-Javadoc)
|
79 |
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
80 |
*/
|
81 |
public void actionPerformed(ActionEvent e) { |
82 |
//Buscar
|
83 |
if (e.getActionCommand() == "Cerrar"){ |
84 |
this.setVisible(false); |
85 |
} |
86 |
} |
87 |
|
88 |
|
89 |
} |