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
-
QueryApplet()
-
-
addLinkMenu()
-
-
Delete_Action(ActionEvent)
- Opens Client's Query List for Deletion.
-
Exit_Action(ActionEvent)
- Hyperlinks back to the DSRG Homepage
-
init()
- Initializes the GUI.
-
makeCookie(JSObject)
- Sets & returns the client cookie.
-
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.
-
New_Action(ActionEvent)
- Clears the Text Area.
-
Open_Action(ActionEvent)
- Retrieves Client's Saved Queries.
-
QuerySelected_Action()
- Prints the Selected Values to the Text Area.
-
run()
- Runs Thread which Queries Server.
-
Save_Action(ActionEvent)
- Saves Query currently in the Text Area.
-
SQLHelp_Action(ActionEvent)
- Hyperlinks to a web page with an SQL tutorial
-
submit_server()
- Starts Thread to Query Server.
-
URL_Action()
- Uses showDocument(URL) of the Applet Context class to hyperlink to the selected URL
QueryApplet
public QueryApplet()
URL_Action
public void URL_Action()
- Uses showDocument(URL) of the Applet Context class to hyperlink to the selected URL
addLinkMenu
public void addLinkMenu()
makeCookie
public String makeCookie(JSObject win)
- Sets & returns the client cookie. Uses the JSObject to call Javascript functions setCookie, etc.
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
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.
QuerySelected_Action
public void QuerySelected_Action()
- Prints the Selected Values to the Text Area.
New_Action
public void New_Action(ActionEvent event)
- Clears the Text Area.
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.
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.
SQLHelp_Action
public void SQLHelp_Action(ActionEvent event)
- Hyperlinks to a web page with an SQL tutorial
Exit_Action
public void Exit_Action(ActionEvent event)
- Hyperlinks back to the DSRG Homepage
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.
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.
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 ;)]