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

  1. // PersonPanel.java
  2. // 28.02.96
  3. //
  4. // the personne screen
  5.  
  6. package cybcerone.person;
  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.Person;
  15.  
  16. /**
  17.  * The SuperPanel for the person screen.
  18.  */
  19. public class PersonPanel extends SuperPanel {
  20.   public static final String id = "personPanel";
  21.   public static final String imagePath = "personnes/";
  22.   public static final String dataPath = "personnes/";
  23.   private static final String statusText = "";
  24.   private static final String dataFile = dataPath + "liste";
  25.  
  26.   private static PersonPaper thePaper;
  27.   private static PersonKeypad theKeypad;
  28.   
  29.   public PersonPanel (Appletlike app) {
  30.     super (id, statusText, app);
  31.     
  32.     add (thePaper = new PersonPaper (this));
  33.     add (theKeypad = new PersonKeypad (this));
  34.  
  35.     getData (dataFile, new Person (), this);
  36.   }
  37.  
  38.   /**
  39.    * This is the name we want to search for.
  40.    */
  41.   protected void update (String name) {
  42.     thePaper.update (name);
  43.   }
  44.  
  45.   /**
  46.    * This is the data for the paper.
  47.    */
  48.   protected void update (Vector data) {
  49.     thePaper.setData (new PaintableVector (data));
  50.   }
  51.   
  52.   /**
  53.    * I want the keypad to accept keystrokes even when the mouse is
  54.    * anywhere in the person screen.
  55.    */
  56.   public boolean keyDown (Event evt, int key) {
  57.     return theKeypad.keyDown (evt, key);
  58.   }
  59.   
  60.   /**
  61.    * Ditto on the above.
  62.    */
  63.   public boolean keyUp (Event evt, int key) {
  64.     return theKeypad.keyUp (evt, key);
  65.   }
  66.  
  67.   public void reset () {
  68.     theKeypad.reset ();
  69.   }
  70. }
  71.  
  72.