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

  1. // ManifPanel.java
  2. // 01.03.96
  3. //
  4. // the manifestations screen
  5.  
  6. package cybcerone.manif;
  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.Manif;
  14.  
  15. /**
  16.  * Access to events happening on campus.
  17.  */
  18. public class ManifPanel extends SuperPanel {
  19.   public static final String id = "manifPanel";
  20.   public static final String imagePath = "manifestations/";
  21.   public static final String dataPath = "events/";
  22.   private static final String statusText = "";
  23.   private static final String dataFile = dataPath + "live.online.events";
  24.  
  25.   private static ManifPaper thePaper;
  26.   private static ManifKeypad theKeypad;
  27.  
  28.   public ManifPanel (Appletlike app) {
  29.     super (id, statusText, app);
  30.  
  31.     add (thePaper = new ManifPaper (this));
  32.     add (theKeypad = new ManifKeypad (this));
  33.  
  34.     getData (dataFile, new Manif (), this);
  35.   }
  36.  
  37.   public void reset () {
  38.     theKeypad.reset ();
  39.   }
  40.  
  41.   public void update (Object updateVal) {
  42.     if (updateVal instanceof Interval)
  43.       update ((Interval)updateVal);
  44.     else if (updateVal instanceof Fac)
  45.       update ((Fac)updateVal);
  46.     else
  47.       super.update (updateVal);
  48.   }
  49.  
  50.   /** Set the new interval */
  51.   protected void update (Interval newInterval) {
  52.     thePaper.update (newInterval);
  53.   }
  54.  
  55.   protected void update (Fac newFac) {
  56.     thePaper.update (newFac);
  57.   }
  58.  
  59.   protected void update (Vector data) {
  60.     thePaper.setData (new PaintableVector (data));
  61.   }
  62.   
  63. }
  64.