FreeWRL/FreeX3D  3.0.0
BaseNode.java
1 package vrml;
2 
3 // This is the general BaseNode class
4 //
5 public abstract class BaseNode
6 {
7  String nodeid; // id for communication
8  String myType = null;
9 
10  public BaseNode() {}
11 
12  public BaseNode(String id) {
13  nodeid = id;
14  }
15 
16  public void _set_nodeid(String id) {
17  nodeid = id;
18  }
19  public String _get_nodeid() {
20  return nodeid;
21  }
22 
23  // Returns the type of the node. If the node is a prototype
24  // it returns the name of the prototype.
25  public String getType() {
26  if (myType == null) {
27  myType = FWJavaScript.getNodeType(this);
28  }
29  return myType;
30  }
31 
32  // Get the Browser that this node is contained in.
33  public Browser getBrowser() {
34  return FWJavaScript.getBrowser();
35  }
36 }
37