Class QueryApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----com.sun.java.swing.JApplet
                                           |
                                           +----QueryApplet

public class QueryApplet
extends JApplet
implements Runnable

Constructor Index

 o QueryApplet()

Method Index

 o addLinkMenu()
 o Delete_Action(ActionEvent)
Opens Client's Query List for Deletion.
 o Exit_Action(ActionEvent)
Hyperlinks back to the DSRG Homepage
 o init()
Initializes the GUI.
 o makeCookie(JSObject)
Sets & returns the client cookie.
 o makeTableEtc(Object[][], Object[])
Calculates preferred width for JFrame, adds Link Menu if table contains a Home Page column, Makes the table, & shows it in a JFrame.
 o New_Action(ActionEvent)
Clears the Text Area.
 o Open_Action(ActionEvent)
Retrieves Client's Saved Queries.
 o QuerySelected_Action()
Prints the Selected Values to the Text Area.
 o run()
Runs Thread which Queries Server.
 o Save_Action(ActionEvent)
Saves Query currently in the Text Area.
 o SQLHelp_Action(ActionEvent)
Hyperlinks to a web page with an SQL tutorial
 o submit_server()
Starts Thread to Query Server.
 o URL_Action()
Uses showDocument(URL) of the Applet Context class to hyperlink to the selected URL

Constructors

 o QueryApplet
 public QueryApplet()

Methods

 o URL_Action
 public void URL_Action()
Uses showDocument(URL) of the Applet Context class to hyperlink to the selected URL

 o addLinkMenu
 public void addLinkMenu()
 o makeCookie
 public String makeCookie(JSObject win)
Sets & returns the client cookie. Uses the JSObject to call Javascript functions setCookie, etc.

 o init
 public void init()
Initializes the GUI. Assigns a cookie (the local host), retrieves a copy of the RMI query interface, draws the GUI components, and defines a convenience class which forwards component ActionEvents to the methods which handle them

Overrides:
init in class Applet
 o Open_Action
 public void Open_Action(ActionEvent event)
Retrieves Client's Saved Queries. Queries are retrieved using RMI and returned as a List inside a new Frame. If the frame was opened specifically for deletion, multiple selection is possible. (Deletion of a single selection is possible regardless from the frame's menu bar.

 o QuerySelected_Action
 public void QuerySelected_Action()
Prints the Selected Values to the Text Area.

 o New_Action
 public void New_Action(ActionEvent event)
Clears the Text Area.

 o Save_Action
 public void Save_Action(ActionEvent event)
Saves Query currently in the Text Area. Passes the query to the Server using RMI where it is saved in a text file named with the client's cookie.

 o Delete_Action
 public void Delete_Action(ActionEvent event)
Opens Client's Query List for Deletion. This is simply a call to the Open_Action method in deletion mode.

 o SQLHelp_Action
 public void SQLHelp_Action(ActionEvent event)
Hyperlinks to a web page with an SQL tutorial

 o Exit_Action
 public void Exit_Action(ActionEvent event)
Hyperlinks back to the DSRG Homepage

 o submit_server
 public void submit_server()
Starts Thread to Query Server. Method captures the SQL query currently showing in the Text area and disposes of the "Open" frame if it hasn't been already.

 o makeTableEtc
 public void makeTableEtc(Object Data[][],
                          Object ColumnNames[])
Calculates preferred width for JFrame, adds Link Menu if table contains a Home Page column, Makes the table, & shows it in a JFrame.

 o run
 public void run()
Runs Thread which Queries Server. If the call to the server's query method returned no errors in the Return object, a Table is Created with the Query Results and displayed in a Frame; Otherwise the errors are printed one by one to the Text Area. [There is currently no reason to thread the QueryApplet but it has been done for the sake of possible future extensions using animation--and to say we did ;)]