SoftTech TreeApplet was developed for Oakscape Corp.

</COMMENT>

What Does This Applet Do?

This applet is merely part of a larger applet that allows users to make selections from four tree components which represent data from a database. The data which populates each JTreePlus component (JTreePlus is a custom component I wrote to extend JTree) is stored in an Oracle database and read into the applet via servlets (http tunneling).

The entire tree is NOT loaded from the database upon applet startup (some trees might contain as many as 70,000 nodes! Each time a user expands a tree node (by clicking on it), a background thread is started which begins looking ahead to populate the next level(s) of the tree.

When the TreeAppletPanel starts up, it initially establishes connections to two servlets:

Inside of init(), TreeAppletPanel creates and runs 4 PopulateTreeThread objects (one for each JTree) which populates the first couple of levels of each tree by making calls to the TreeNodeServlet. The TreeNodeServlet reads a parent tree node as a input parameter (via an ObjectInputStream), and write out a simple array of TreeNodeData objects which represent the direct children (nodes) of the given parent (node).

When a user right clicks on a parent node (not a leaf node), a pop up menu appears giving them options to set attributes for the node's children. The options are:

When a user checks or unchecks a leaf, the summary information is updated in the JTextPane to the right.

When a user changes the value in one of the combo boxes, the trees are re-ordered on the screen accordingly.

When a user presses the options button, an options dialog appears giving the user the ability to reorder the trees and set other NIM options.

When a user presses the Cancel button, a message appears (not yet implemented).

When a user presses the Save button, the user selections are written back to the servlet

When a user presses the Refresh button, the summary text updates.