home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 046A / COOBAR.ZIP / COOHINT.CLA (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-03  |  2.5 KB  |  78 lines

  1. import java.awt.Color;
  2. import java.awt.Component;
  3. import java.awt.Container;
  4. import java.awt.Event;
  5. import java.awt.Frame;
  6. import java.awt.LayoutManager;
  7. import java.awt.Window;
  8.  
  9. public class coohint extends Window {
  10.    // $FF: renamed from: w int
  11.    int field_0;
  12.    // $FF: renamed from: h int
  13.    int field_1;
  14.    coobar m_applet;
  15.    coolab labtips;
  16.  
  17.    void coohint_MouseEnter(Event event) {
  18.       this.moveHint();
  19.       this.labtips.disable();
  20.    }
  21.  
  22.    void labtips_MouseEnter(Event event) {
  23.       this.moveHint();
  24.       this.labtips.disable();
  25.    }
  26.  
  27.    public coohint(coobar applet, Frame parent, String content) {
  28.       super(parent);
  29.       this.m_applet = applet;
  30.       ((Container)this).setLayout((LayoutManager)null);
  31.       ((Window)this).addNotify();
  32.       ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 195, ((Container)this).insets().top + ((Container)this).insets().bottom + 135);
  33.       ((Component)this).setBackground(new Color(14606694));
  34.       this.labtips = new coolab("");
  35.       this.labtips.reshape(((Container)this).insets().left, ((Container)this).insets().top, 192, 132);
  36.       ((Container)this).add(this.labtips);
  37.       this.labtips.setText("12345678901234567890");
  38.       this.labtips.setText(content);
  39.    }
  40.  
  41.    public boolean handleEvent(Event event) {
  42.       if (event.target == this.labtips && event.id == 504) {
  43.          this.labtips_MouseEnter(event);
  44.          return true;
  45.       } else if (event.target == this && event.id == 504) {
  46.          this.coohint_MouseEnter(event);
  47.          return true;
  48.       } else {
  49.          return super.handleEvent(event);
  50.       }
  51.    }
  52.  
  53.    void moveHint() {
  54.       System.out.println("Enter moveHint");
  55.       this.m_applet.doCloseMenu = false;
  56.       double r = Math.random();
  57.       r = 0.6000000000000001;
  58.       if (r < (double)0.5F) {
  59.          if (this.m_applet.hintX - this.field_0 > 0) {
  60.             coobar var10000 = this.m_applet;
  61.             var10000.hintX -= this.field_0;
  62.          } else if (640 - this.m_applet.hintX > this.field_0) {
  63.             coobar var4 = this.m_applet;
  64.             var4.hintX += this.field_0;
  65.          }
  66.       } else if (this.m_applet.hintY - this.field_1 > 0) {
  67.          coobar var5 = this.m_applet;
  68.          var5.hintY -= this.field_1;
  69.       } else if (480 - this.m_applet.hintY > this.field_1) {
  70.          coobar var6 = this.m_applet;
  71.          var6.hintY += this.field_1;
  72.       }
  73.  
  74.       ((Component)this).reshape(this.m_applet.hintX, this.m_applet.hintY, this.field_0, this.field_1);
  75.       ((Component)this).requestFocus();
  76.    }
  77. }
  78.