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

  1. // InitPanel.java
  2. // 25.03.96
  3. //
  4. // The screen during initialization
  5.  
  6. package cybcerone.init;
  7.  
  8. import java.awt.Image;
  9. import java.awt.Graphics;
  10. import java.util.Vector;
  11.  
  12. import cybcerone.utils.Appletlike;
  13. import cybcerone.utils.SuperPanel;
  14.  
  15. public class InitPanel extends SuperPanel {
  16.   public static final String id = "init";
  17.   public static final String imagePath = "init/";
  18.  
  19.   private static final String statusText = "Initializing...";
  20.   private static final String logoFile = imagePath + "layout_init.gif";
  21.   private static final String motdFile = "motd.txt";
  22.  
  23.   private Image logo;
  24.  
  25.   private Messages messagePanel;
  26.   private MotdPanel theMotdPanel;
  27.   
  28.   /**
  29.    * The panel that comes up during initialization.
  30.    */
  31.   public InitPanel (Appletlike app) {
  32.     super (id, statusText, app);
  33.     
  34.     logo = getImage (logoFile, 0);
  35.     add (theMotdPanel = new MotdPanel (this));
  36.     add (messagePanel = new Messages (this));
  37.     
  38.     app.getData (motdFile, this);
  39.   }
  40.  
  41.   /**
  42.    * We've received a message to display.
  43.    */
  44.   public void update (String message) {
  45.     messagePanel.update (message);
  46.   }
  47.  
  48.   /**
  49.    * Here's the lines in the message of the day file.
  50.    */
  51.   public void update (Vector motd) {
  52.     theMotdPanel.update (motd);
  53.   }
  54.  
  55.   public void paint (Graphics g) {
  56.     super.paint (g);
  57.     if (logo != null) {
  58.       g.drawImage (logo, scale (137), scale (45), this);
  59.     }
  60.   }
  61.  
  62. }
  63.