import java.awt.*; import Tree; import RedBlack; import Display; import InfoPanel; import CtrlPanel; // This is the main window class. It include the control panel, // information panel and the display. Beside that it also include // the tree object. it is used mainly as a container of the display // and the panels and as a mean for the objects communication. public class MainWin extends Frame { private RedBlack Parent; Display display; Tree tree; CtrlPanel ctrlpanel; InfoPanel infopanel; // constructor create all the abjects and locate the visual ones on // the window. public MainWin(RedBlack p) { Parent = p; tree = new Tree(this); display = new Display(this); ctrlpanel = new CtrlPanel(this); infopanel = new InfoPanel(this); add("West",ctrlpanel); add("Center",display); add("North",infopanel); } // this method dispose the object and the open dialogs by calling // to the Free method of the ctrlpanel. public void dispose() { Parent.start.enable(); ctrlpanel.Free(); super.dispose(); } // This method clear the tree, i.e. create a new tree object // and clear the display and the height bar. public void ClearTree() { tree = new Tree(this); display.drawTree(); infopanel.setMessage(""); infopanel.drawBar(); } }