1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.gui.table;
21
22 import javax.swing.SwingUtilities;
23
24 import org.xnap.event.StateEvent;
25 import org.xnap.event.StateListener;
26 import org.xnap.transfer.Transfer;
27
28 /***
29 * Provides a node for transfer objects that have no children.
30 */
31 public class TransferTreeTableNode extends LeafTreeTableNode
32 implements StateListener
33 {
34
35
36
37
38
39 TransferTableModel model;
40
41
42
43 /***
44 * Constructs the node.
45 *
46 * @param model the table model
47 * @param transfer the transfer, should not implements TransferContainer
48 */
49 public TransferTreeTableNode
50 (TransferTableModel model, Transfer transfer)
51 {
52 super(transfer);
53
54 this.model = model;
55
56 transfer.addStateListener(this);
57 }
58
59
60
61
62 public void stateChanged(final StateEvent event)
63 {
64 Runnable runner = new Runnable()
65 {
66 public void run()
67 {
68 model.nodeChanged(TransferTreeTableNode.this);
69 }
70 };
71 SwingUtilities.invokeLater(runner);
72 }
73
74 }