public class XeoMenu extends Applet { // The background image. This had better not be null. Image image;
// These two fields are used to do double-buffering. // The dimensions of bbuf is exactly the dimensions of the applet. Image bbuf; GraphiCS bbufG;
// This field is set to true only when the background image has // completely loaded. boolean imageDone;
/* Menu data */ Rectangle[] hitArea; Rectangle[] srcRect; Point[] dstPt; boolean[] down; String[] url;
/* Submenu data */ String[][] itemUrl; String[][] item;
// If >= 0, this fields holds the index of the current menu. // If -1, no menu is current. int curMenu;
// If >= 0, this fields holds the index of the current menu item. // If -1, no menu item is current. int curMenuItem;
// This is an array of rectangles - one rectangle for each menu item. // Each rectangle specifies the // location (relative to the left-corner of the applet) of a menu item. // // menuItemRect is null when curMenu is -1. // It becomes non-null when curMenu >= 0. // // Note: it would have been better programming to define classes for // the menu and menu items. However, I decided for this little applet // to keep the number of class files to a minimum to minimize the download // time. Rectangle[] menuItemRect;