    1   /*
    2    * Created on Jun 21, 2004
    3    *
    4    */
    5   package baseCode.gui;
    6
    7   import java.io.IOException;
    8   import java.io.InputStream;
    9
    10  import javax.swing.JFrame;
    11  import javax.swing.JTree;
    12  import javax.swing.UIManager;
    13
    14  import org.xml.sax.SAXException;
    15
    16  import baseCode.gui.TreePanel;
    17  import baseCode.xml.GOParser;
    18
    19  /***
    20   * Not a 'real' test.
    21   * <p>
    22   * Copyright (c) Columbia University
    23   *
    24   * @author Paul Pavlidis
    25   * @version $Id: TreePanelApp.java,v 1.1 2005/03/17 13:58:42 pavlidis Exp $
    26   */
    27  public class TreePanelApp {
    28     private GOParser gOParser = null;
    29
    30     /***
    31      * Constructor for TestTreePanel.
    32      * @throws IOException
    33      * @throws SAXException
    34      */
    35     public TreePanelApp() throws  SAXException, IOException {
    36
    37        InputStream i =
    38        //           GOParser.class.getResourceAsStream("/data/go-termdb-sample.xml");
    39        GOParser.class.getResourceAsStream( "/data/go_200406-termdb.xml" );
    40        gOParser = new GOParser( i );
    41        final JTree t = gOParser.getGraph().treeView();
    42
    43        //Create and set up the window.
    44        JFrame frame = new JFrame( "GOTreeDemo" );
    45        frame.setSize( 200, 200 );
    46        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    47
    48        //Create and set up the content pane.
    49        TreePanel newContentPane = new TreePanel( t );
    50        newContentPane.setOpaque( true ); //content panes must be opaque
    51        frame.setContentPane( newContentPane );
    52        //Display the window.
    53        frame.pack();
    54        frame.setVisible( true );
    55
    56     }
    57
    58     public static void main( String[] args ) {
    59        try {
    60           UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
    61           new TreePanelApp();
    62        } catch ( Exception e ) {
    63           e.printStackTrace();
    64        }
    65
    66     }
    67
    68  }