01: package vicazh.hyperpool;
02:
03: import java.util.logging.*;
04: import javax.swing.tree.*;
05:
06: /**
07: * The editor tree model
08: *
09: * @author Victor Zhigunov
10: * @version 0.4.0
11: */
12: public class IModel extends DefaultTreeModel {
13:
14: public IModel() {
15: super (null);
16: }
17:
18: private ICom com;
19:
20: /**
21: * @param com
22: * communicator
23: */
24: public void setCom(ICom com) {
25: this .com = com;
26: }
27:
28: public void valueForPathChanged(TreePath path, Object newValue) {
29: DefaultMutableTreeNode node = ((DefaultMutableTreeNode) path
30: .getLastPathComponent());
31: IUnit element = (IUnit) node.getUserObject();
32: super .valueForPathChanged(path, element);
33: try {
34: com.setAttribute(ComMBean.CHANGED, new ComData(
35: ((String) newValue).getBytes(), element.id));
36: } catch (Exception e) {
37: Start.logger.log(Level.SEVERE, e.getMessage(), e);
38: }
39: }
40: }
|