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

  1. // UnilButton.java
  2. // 19.03.96
  3. //
  4. // the UNIL button on the control panel
  5.  
  6. package cybcerone.control;
  7.  
  8. import java.awt.Rectangle;
  9.  
  10. import cybcerone.utils.Appletlike;
  11. import cybcerone.utils.IdPanel;
  12.  
  13. /**
  14.  * The button to return to the main screen.
  15.  */
  16. class UnilButton extends ControlButton {
  17.   private static final Rectangle placement = 
  18.     new Rectangle (434, 0, 155, 100);
  19.   
  20.   private static final String id = "UnilButton";
  21.   private static final String statusText = "Click to go Home";
  22.  
  23.   private static final String bgFile = imagePath + "home_lache.gif";
  24.   private static final String pressedBgFile = imagePath + "home_presse.gif";
  25.   private static final String disabledBgFile = imagePath + "home_disabled.gif";
  26.   
  27.   UnilButton (Appletlike app) {
  28.     super (id, statusText, app);
  29.     reshape (placement);
  30.  
  31.     setBackground (bgFile, 1);
  32.     setPressedBg (pressedBgFile, 1);
  33.     setDisabledBg (disabledBgFile, 0);
  34.   }
  35.  
  36.   void update (String newPanelId) {
  37.     if (newPanelId.equals (next))
  38.       disable ();
  39.     else
  40.       enable ();
  41.   }
  42.  
  43.   protected void doAction () {
  44.     app.reset ();
  45.   }
  46. }
  47.