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

  1. // UnitePanel.java
  2. // 18.03.96
  3. //
  4. // the screen to select a room number
  5.  
  6. package cybcerone.unite;
  7.  
  8. import java.awt.Event;
  9. import java.util.Vector;
  10.  
  11. import cybcerone.utils.Appletlike;
  12. import cybcerone.utils.SuperPanel;
  13. import cybcerone.utils.PaintableVector;
  14. import cybcerone.utils.Unite;
  15.  
  16. /**
  17.  * The panel for finding a room at BFSH2, the main building.
  18.  */
  19. public class UnitePanel extends SuperPanel {
  20.   public static final String id = "UnitePanel";
  21.   public static final String imagePath = "unite/";
  22.   public static final String dataPath = "unite/";
  23.   private static final String statusText = "";
  24.   private static final String dataFile = dataPath + "liste";
  25.  
  26.   private static UnitePaper thePaper;
  27.   private static UniteKeypad theKeypad;
  28.   
  29.   public UnitePanel (Appletlike app) {
  30.     super (id, statusText, app);
  31.     
  32.     add (thePaper = new UnitePaper (this));
  33.     add (theKeypad = new UniteKeypad (this));
  34.  
  35.     getData (dataFile, new Unite (), this);
  36.   }
  37.  
  38.   public void reset () {
  39.     theKeypad.reset ();
  40.   }
  41.  
  42.   /**
  43.    * This is the name we want to search for.
  44.    */
  45.   protected void update (String name) {
  46.     thePaper.update (name);
  47.   }
  48.  
  49.   /**
  50.    * This is the data for the paper.
  51.    */
  52.   protected void update (Vector data) {
  53.     thePaper.setData (new PaintableVector (data));
  54.   }
  55.   
  56.   /**
  57.    * I want the keypad to accept keystrokes even when the mouse is
  58.    * anywhere in the person screen.
  59.    */
  60.   public boolean keyDown (Event evt, int key) {
  61.     return theKeypad.keyDown (evt, key);
  62.   }
  63.   
  64.   /**
  65.    * Ditto on the above.
  66.    */
  67.   public boolean keyUp (Event evt, int key) {
  68.     return theKeypad.keyUp (evt, key);
  69.   }
  70.  
  71. }
  72.  
  73.