01: package vicazh.hyperpool;
02:
03: import javax.swing.*;
04: import javax.swing.tree.*;
05: import javax.swing.event.*;
06: import java.awt.*;
07:
08: /**
09: * The graphic manager
10: *
11: * @author Victor Zhigunov
12: * @version 0.3.4
13: */
14: public class IManager implements TreeSelectionListener {
15: private Container container;
16:
17: private CardLayout layout;
18:
19: /**
20: * @param container
21: * manager container
22: */
23: public IManager(Container container) {
24: this .container = container;
25: layout = (CardLayout) container.getLayout();
26: }
27:
28: public void valueChanged(TreeSelectionEvent e) {
29: DefaultMutableTreeNode node = (DefaultMutableTreeNode) ((JTree) e
30: .getSource()).getLastSelectedPathComponent();
31: if (node != null)
32: layout.show(container, String.valueOf(node.getUserObject()
33: .hashCode()));
34: }
35: }
|