01: /*
02: * $RCSfile: AbstractVAIBuilderNode.java,v $
03: * @modification $Date: 2001/09/28 19:41:42 $
04: * @version $Id: AbstractVAIBuilderNode.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.util;
09:
10: import com.memoire.vainstall.builder.VAIBuilderController;
11: import com.memoire.vainstall.builder.VAIBuilderModel;
12:
13: import javax.swing.tree.*;
14:
15: /**
16: * This is a abstract node in a tree which is able to perform methods on the
17: * builder.
18: * The class is a kind of base support class for generating tree like
19: * views on the datamodel
20: *
21: * @see com.memoire.vainstall.builder.VAIBuilderController
22: * @see com.memoire.vainstall.builder.VAIBuilderModel
23: * @see com.memoire.vainstall.builder.util.VAINodeInterface
24: * @see javax.swing.tree.DefaultMutableTreeNode
25: *
26: * @author Henrik Falk
27: * @version $Id: AbstractVAIBuilderNode.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
28: */
29: public abstract class AbstractVAIBuilderNode extends
30: DefaultMutableTreeNode implements VAINodeInterface {
31:
32: /**
33: * Keep reference to builder controller
34: */
35: VAIBuilderController controller;
36:
37: /**
38: * Keep reference to builder data model
39: */
40: VAIBuilderModel model;
41:
42: /**
43: * Default constructor
44: */
45: public AbstractVAIBuilderNode() {
46: super ();
47:
48: // we are the user object due implementation of VAINodeInterface
49: setUserObject(this );
50: }
51:
52: public String toString() {
53: return "";
54: }
55:
56: /**
57: * initialize the node
58: * @param controller VAIBuilderController
59: */
60: public void initialize(VAIBuilderController controller) {
61: this .controller = controller;
62: this .model = controller.getModel();
63: }
64:
65: /**
66: * return the builder controller
67: * @return the builder controller
68: */
69: protected VAIBuilderController getController() {
70: return controller;
71: }
72:
73: /**
74: * return the builder data model
75: * @return the builder data model
76: */
77: protected VAIBuilderModel getModel() {
78: return model;
79: }
80:
81: }
|