1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
package ThePEG;
import javax.swing.tree.*;
public class ObjectNode extends DefaultMutableTreeNode {
ObjectRef ref;
boolean expanded = false;
public ObjectNode(SetupThePEG tp, String nm, String fn, boolean isd) {
super(new ObjectRef(tp, nm, fn, isd));
ref = (ObjectRef)getUserObject();
setAllowsChildren(ref.isDir());
}
public ObjectNode(SetupThePEG tp, String f) {
super(new ObjectRef(tp, f));
ref = (ObjectRef)getUserObject();
setAllowsChildren(ref.isDir());
}
public ObjectRef getObject() {
return ref;
}
public boolean isDir() {
return ref.isDir();
}
public String getFullName() {
return ref.getFullName();
}
public void setExpanded(boolean ex) {
expanded = ex;
}
public boolean isExpanded() {
return expanded;
}
public static void classcheck() {}
}
|