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

  1. // FacultePanel.java
  2. // 01.03.96
  3. //
  4. // the faculte screen
  5.  
  6. package cybcerone.faculte;
  7.  
  8. import java.util.Vector;
  9.  
  10. import cybcerone.utils.Appletlike;
  11. import cybcerone.utils.SuperPanel;
  12. import cybcerone.utils.PaintableVector;
  13. import cybcerone.utils.Faculte;
  14.  
  15. /**
  16.  * The facultes screen.
  17.  */
  18. public class FacultePanel extends SuperPanel {
  19.   public static final String id = "facultePanel";
  20.   public static final String imagePath = "facultes/";
  21.   public static final String dataPath = "facultes/";
  22.   private static final String statusText = "";
  23.   private static final String dataFile = dataPath + "listfac";
  24.  
  25.   private static final String nodeImageFile = imagePath + "folder.gif";
  26.   private static final String leafImageFile = imagePath + "doc.gif";
  27.   
  28.   private static FacultePaper thePaper;
  29.   private static FaculteKeypad theKeypad;
  30.   
  31.   public FacultePanel (Appletlike app) {
  32.     super (id, statusText, app);
  33.     
  34.     add (thePaper = new FacultePaper (this));
  35.     add (theKeypad = new FaculteKeypad (this));
  36.  
  37.     Faculte.setIconImages (getImage (leafImageFile, 1),
  38.                getImage (nodeImageFile, 1));
  39.     
  40.     getData (dataFile, new Faculte (), this);
  41.   }
  42.  
  43.   public void reset () {
  44.     theKeypad.reset ();
  45.   }
  46.   
  47.   /**
  48.    * Extend the SuperPanel update command to handle Faculte objects.
  49.    */
  50.   /*
  51.   public void update (Object updateVal) {
  52.     if (updateVal instanceof Faculte)
  53.       update ((Faculte)updateVal);
  54.     else
  55.       super.update (updateVal);
  56.   }
  57.   */
  58.  
  59.   /**
  60.    * Show this faculte on my paper.
  61.    */
  62.   /*
  63.   protected void update (Faculte theFaculte) {
  64.     thePaper.update (theFaculte);
  65.   }
  66.   */
  67.  
  68.   /**
  69.    * Show the faculte with this name on my paper.
  70.    */
  71.   protected void update (String faculteName) {
  72.     thePaper.update (faculteName);
  73.   }
  74.  
  75.   /**
  76.    * My facultes are loaded at last!  Let my paper know of this
  77.    * joyous occasion.
  78.    */
  79.   protected void update (Vector data) {
  80.     thePaper.setData (new PaintableVector (data));
  81.   }
  82.  
  83. }
  84.  
  85.