home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / unuy2wen / cybcerone / orient / preorientpanel.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  1.6 KB  |  59 lines

  1. // PreorientPanel.java
  2. // 28.02.96
  3. //
  4. // before the orientation screen
  5.  
  6. package cybcerone.orient;
  7.  
  8. import java.awt.Event;
  9.  
  10. import cybcerone.utils.Appletlike;
  11. import cybcerone.utils.SuperPanel;
  12. import cybcerone.unite.UnitePanel;
  13.  
  14. /** 
  15.  * Before you orient, preorient.  This page gives you a choice between
  16.  * going directly to the mapping module or looking up a room in the 
  17.  * main building.
  18.  */
  19. public class PreorientPanel extends SuperPanel {
  20.   public static final String id = "preorient";
  21.   public static final String imagePath = "orientation/";
  22.  
  23.   private static final String statusText = "Maps and orientation";
  24.   private static final String bgFile = imagePath + "fond_preorientation.gif";
  25.  
  26.   Button orientButton;
  27.   Button thisBuildingButton;
  28.  
  29.   public PreorientPanel (Appletlike app) {
  30.     super (id, statusText, app);
  31.     setBackground (bgFile, 4);
  32.  
  33.     orientButton = new Button (OrientPanel.id, 170, 190, 180, 180);
  34.     thisBuildingButton = new Button (UnitePanel.id, 670, 190, 190, 180);
  35.   }
  36.   
  37.   public boolean mouseDown (Event evt, int x, int y) {
  38.     if (orientButton.inside (x, y)) {
  39.       app.update (orientButton.getNext ());
  40.       return true;
  41.     } else if (thisBuildingButton.inside (x, y)) {
  42.       app.update (thisBuildingButton.getNext ());
  43.       return true;
  44.     } else
  45.       return super.mouseDown (evt, x, y);
  46.   }
  47.  
  48.   public boolean mouseMove (Event evt, int x, int y) {
  49.     if (orientButton.inside (x, y)) {
  50.       app.showStatus ("Maps of the campus and surrounding area");
  51.     } else if (thisBuildingButton.inside (x, y)) {
  52.       app.showStatus ("Search for a room in the main building");
  53.     } else
  54.       app.showStatus (statusText);
  55.     return true;
  56.   }
  57.   
  58. }
  59.