/* * @(#)TreeJApplication.java * * Last Modified: 9/01/02 */ import javax.swing.*; import javax.swing.JApplet; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.net.*; /** * The TreeJApplet presents an applet that allows for the drawing * of different forms of tress. *

* @author Corey Sanders * @version 2.5 9/01/02 */ public class TreeApplication implements WindowListener { public static final String PROGRAM_INFORMATION = "Growing Tree!!\n\n"+ "An educational applet that presents different types of searching trees\n"+ "and animates the numerous manipulating methods available for the specific\n"+ "type of tree.\n\n"+ "The program currently supports Binary Search Trees including Red-Black Trees,\n"+ "Splay Trees, Root-Insertion Trees, and Balanced Trees. It supports insertion,\n"+ "deletion, searching, and selection. Furthermore, clicking upon nodes supports,\n"+ "inidividualized functions.\n\n\n"+ "Questions or Modification ideas, please notify the creator.\n"; public static final String LICENSE_INFORMATION = "Currently Unlicensed and Copyright pending\n\n"+ "Enjoy free use of this program.\n\n\n"; public static final String CREATOR_INFORMATION = "Author : Corey Michael Sanders (csanders@princeton.edu)\n"+ "Supervisors : Professor Robert Sedgewick (rs@cs.Princeton.EDU) of Princeton University\n"+ "and Professor Kevin Wayne of Princeton University (wayne@CS.Princeton.EDU)\n\n"+ "Special Thanks for Coding Help : Kevin Wayne, Jason Sanders (my older and smarter brother), Brian Tsang, \n Michael Schidlowsky (he wrote that Java Algorithm book)\n\n"+ "Final Modification Date : 9/1/02\n\n"; //protected JApplet current = this; /** * Creates new Applet */ public static void main(String[] args) { TreeApplication newApp = new TreeApplication(); } JWindow splashScreen; public TreeApplication() { //Construct centerFrame. CenterJFrame centerFrame = new CenterJFrame(); centerFrame.setSize(900,700); centerFrame.setLocation(60,0); centerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); centerFrame.show(); splashScreen = new JWindow(centerFrame); SplashPanel splashPanel = new SplashPanel(); splashPanel.setBorder(BorderFactory.createLineBorder(Color.black)); splashScreen.setSize(648,432); splashScreen.setLocation(200,170); splashScreen.getContentPane().add(splashPanel, BorderLayout.CENTER); splashScreen.show(); try { Thread.sleep(6000); } catch (InterruptedException e){ } splashScreen.dispose(); } //////////////////////////// // Implements Window Listener //////////////////////////// /** * Invoked when the Window is set to be the active Window. */ public void windowActivated(WindowEvent e) { } /** * Invoked when a window has been closed as the result of calling dispose on the window. */ public void windowClosed(WindowEvent e) { System.exit(0); } /** * Invoked when the user attempts to close the window from the window's system menu. */ public void windowClosing(WindowEvent e) { System.exit(0); } /** * Invoked when a Window is no longer the active Window. */ public void windowDeactivated(WindowEvent e) { } /** * Invoked when a window is changed from a minimized to a normal state. */ public void windowDeiconified(WindowEvent e) { } /** * Invoked when a window is changed from a normal to a minimized state. */ public void windowIconified(WindowEvent e) { } /** * Invoked the first time a window is made visible. */ public void windowOpened(WindowEvent e) { } }