FileDocCategorySizeDatePackage
ASTFrame.javaAPI DocGlassfish v2 API2168Wed Aug 30 15:34:16 BST 2006persistence.antlr.debug.misc

ASTFrame

public class ASTFrame extends JFrame

Fields Summary
static final int
WIDTH
static final int
HEIGHT
Constructors Summary
public ASTFrame(String lab, AST r)

        super(lab);

        // Create the TreeSelectionListener
        TreeSelectionListener listener = new MyTreeSelectionListener();
        JTreeASTPanel tp = new JTreeASTPanel(new JTreeASTModel(r), null);
        Container content = getContentPane();
        content.add(tp, BorderLayout.CENTER);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                Frame f = (Frame)e.getSource();
                f.setVisible(false);
                f.dispose();
                // System.exit(0);
            }
        });
        setSize(WIDTH, HEIGHT);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        // Create the tree nodes
        ASTFactory factory = new ASTFactory();
        CommonAST r = (CommonAST)factory.create(0, "ROOT");
        r.addChild((CommonAST)factory.create(0, "C1"));
        r.addChild((CommonAST)factory.create(0, "C2"));
        r.addChild((CommonAST)factory.create(0, "C3"));

        ASTFrame frame = new ASTFrame("AST JTree Example", r);
        frame.setVisible(true);