home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / unuy2wen / cybcerone / utils / button.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  705 b   |  37 lines

  1. // Button.java
  2. // 29.03.96
  3. //
  4. // A logical, not graphical, button
  5.  
  6. package cybcerone.utils;
  7.  
  8. import java.awt.Rectangle;
  9.  
  10. /**
  11.  * Logical object to make handling mouse clicks and moves easier.
  12.  */
  13. public class Button {
  14.   private String statusText;
  15.   private Object next;
  16.   private Rectangle position;
  17.  
  18.   public Button (Object next, String statusText, 
  19.          int x, int y, int width, int height) {
  20.     this.next = next;
  21.     this.statusText = statusText;
  22.     this.position = Scaler.scale (x, y, width, height);
  23.   }
  24.  
  25.   public boolean inside (int x, int y) {
  26.     return position.inside (x, y);
  27.   }
  28.  
  29.   public Object getNext () {
  30.     return next;
  31.   }
  32.  
  33.   public String getStatusText () {
  34.     return statusText;
  35.   }
  36. }
  37.