home *** CD-ROM | disk | FTP | other *** search
/ Australian PC Authority 1999 May / may1999.iso / May / JBUILDER / JSAMPLES.Z / ToolTipPanel$Easter.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-30  |  5.3 KB  |  191 lines

  1. import com.sun.java.swing.ImageIcon;
  2. import com.sun.java.swing.JComponent;
  3. import java.awt.Component;
  4. import java.awt.Graphics;
  5.  
  6. class ToolTipPanel$Easter extends JComponent {
  7.    // $FF: synthetic field
  8.    private final ToolTipPanel this$0;
  9.    ToolTipPanel$AnimationThread animator;
  10.    public boolean running;
  11.    private ImageIcon amy;
  12.    private ImageIcon jag;
  13.    private ImageIcon jeff;
  14.    private ImageIcon tim;
  15.    private ImageIcon tom;
  16.    private ImageIcon rick;
  17.    private ImageIcon hans1;
  18.    private ImageIcon hans2;
  19.    private ImageIcon ges;
  20.    private ImageIcon phil;
  21.    private ImageIcon arnaud;
  22.    private ImageIcon rich;
  23.    int tmpScale;
  24.    // $FF: renamed from: x1 double
  25.    private double field_0;
  26.    // $FF: renamed from: y1 double
  27.    private double field_1;
  28.    // $FF: renamed from: x2 double
  29.    private double field_2;
  30.    // $FF: renamed from: y2 double
  31.    private double field_3;
  32.    private int xAmy;
  33.    private int xJag;
  34.    private int xJeff;
  35.    private int xTim;
  36.    private int xTom;
  37.    private int xRick;
  38.    private int xHans;
  39.    private int xGes;
  40.    private int xPhil;
  41.    private int xArnaud;
  42.    private int xRich;
  43.    private int yAmy;
  44.    private int yJag;
  45.    private int yJeff;
  46.    private int yTim;
  47.    private int yTom;
  48.    private int yRick;
  49.    private int yHans;
  50.    private int yGes;
  51.    private int yPhil;
  52.    private int yArnaud;
  53.    private int yRich;
  54.  
  55.    public ToolTipPanel$Easter(ToolTipPanel var1) {
  56.       this.this$0 = var1;
  57.       this.this$0 = var1;
  58.       this.running = false;
  59.       this.amy = SwingSet.sharedInstance().loadImageIcon("images/people/amy.gif", "Amy Fowler");
  60.       this.jag = SwingSet.sharedInstance().loadImageIcon("images/people/jag.gif", "James Gosling");
  61.       this.jeff = SwingSet.sharedInstance().loadImageIcon("images/people/jeff.gif", "Jeff Dinkins");
  62.       this.tim = SwingSet.sharedInstance().loadImageIcon("images/people/tim.gif", "Tim Prinzing");
  63.       this.tom = SwingSet.sharedInstance().loadImageIcon("images/people/tom.gif", "Tom Ball");
  64.       this.rick = SwingSet.sharedInstance().loadImageIcon("images/people/rick.gif", "Rick Levenson");
  65.       this.hans1 = SwingSet.sharedInstance().loadImageIcon("images/people/mathew.gif", "Mathew Muller");
  66.       this.hans2 = SwingSet.sharedInstance().loadImageIcon("images/people/pl.gif", "Project Lead");
  67.       this.ges = SwingSet.sharedInstance().loadImageIcon("images/people/ges.gif", "Georges Saab");
  68.       this.phil = SwingSet.sharedInstance().loadImageIcon("images/people/phil.gif", "Phillip Milne");
  69.       this.arnaud = SwingSet.sharedInstance().loadImageIcon("images/people/nathan.gif", "Arnaud Webber");
  70.       this.rich = SwingSet.sharedInstance().loadImageIcon("images/people/rich.gif", "Rich Schiavi");
  71.    }
  72.  
  73.    // $FF: renamed from: go () void
  74.    public void method_0() {
  75.       this.animator = new ToolTipPanel$AnimationThread(this.this$0, this);
  76.       this.animator.setPriority(1);
  77.       this.animator.start();
  78.    }
  79.  
  80.    public void paint(Graphics var1) {
  81.       var1.setColor(((Component)this).getParent().getBackground());
  82.       var1.fillRect(0, 0, ((JComponent)this).getWidth(), ((JComponent)this).getHeight());
  83.       if (this.running) {
  84.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)0.0F)) * (double)10.0F);
  85.          double var2 = (double)this.tmpScale / (double)10.0F;
  86.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)10.0F)) * (double)10.0F);
  87.          double var4 = (double)this.tmpScale / (double)10.0F;
  88.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)20.0F)) * (double)10.0F);
  89.          double var6 = (double)this.tmpScale / (double)10.0F;
  90.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)30.0F)) * (double)10.0F);
  91.          double var8 = (double)this.tmpScale / (double)10.0F;
  92.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)40.0F)) * (double)11.0F);
  93.          double var10 = (double)this.tmpScale / (double)10.0F;
  94.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)50.0F)) * (double)11.0F);
  95.          double var12 = (double)this.tmpScale / (double)10.0F;
  96.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_2 + (double)60.0F)) * (double)11.0F);
  97.          double var14 = (double)this.tmpScale / (double)10.0F;
  98.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_2 + (double)70.0F)) * (double)10.0F);
  99.          double var16 = (double)this.tmpScale / (double)10.0F;
  100.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)10.0F)) * (double)10.0F);
  101.          double var18 = (double)this.tmpScale / (double)10.0F;
  102.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)90.0F)) * (double)10.0F);
  103.          double var20 = (double)this.tmpScale / (double)10.0F;
  104.          this.tmpScale = (int)(Math.abs(Math.sin(this.field_0 + (double)80.0F)) * (double)10.0F);
  105.          double var22 = (double)this.tmpScale / (double)10.0F;
  106.          this.field_0 += 0.1;
  107.          this.field_2 += 0.065;
  108.          int var24 = (int)((double)((JComponent)this).getWidth() / (double)2.0F * 0.8);
  109.          this.xTom = (int)(Math.sin(this.field_0 + (double)0.0F) * (double)var24) + var24;
  110.          this.xAmy = (int)(Math.sin(this.field_0 + (double)10.0F) * (double)var24) + var24;
  111.          this.xGes = (int)(Math.sin(this.field_2 + (double)20.0F) * (double)var24) + var24;
  112.          this.xRick = (int)(Math.sin(this.field_0 + (double)30.0F) * (double)var24) + var24;
  113.          this.xJeff = (int)(Math.sin(this.field_0 + (double)40.0F) * (double)var24) + var24;
  114.          this.xPhil = (int)(Math.sin(this.field_0 + (double)51.0F) * (double)var24) + var24;
  115.          this.xTim = (int)(Math.sin(this.field_0 + (double)60.0F) * (double)var24) + var24;
  116.          this.xRich = (int)(Math.sin(this.field_0 + (double)65.0F) * (double)var24) + var24;
  117.          this.xArnaud = (int)(Math.sin(this.field_0 + (double)70.0F) * (double)var24) + var24;
  118.          this.xHans = (int)(Math.sin(this.field_2 + (double)85.0F) * (double)var24) + var24;
  119.          this.xJag = (int)(Math.sin(this.field_0 + (double)90.0F) * (double)var24) + var24;
  120.          this.field_1 += 0.1;
  121.          this.field_3 += 0.05;
  122.          int var25 = (int)((double)((JComponent)this).getHeight() / (double)2.0F * 0.6);
  123.          int var26 = (int)((double)((JComponent)this).getHeight() / (double)2.0F * 0.45);
  124.          int var27 = (int)((double)((JComponent)this).getHeight() / (double)2.0F * 0.2);
  125.          this.yTom = (int)(Math.sin(this.field_1 + (double)0.0F) * (double)var25) + var25;
  126.          this.yTim = (int)(Math.sin(this.field_1 + (double)10.0F) * (double)var25) + var25;
  127.          this.yRich = (int)(Math.sin(this.field_1 + (double)15.0F) * (double)var25) + var25;
  128.          this.yJeff = (int)(Math.sin(this.field_1 + (double)20.0F) * (double)var26) + var25;
  129.          this.yHans = (int)(Math.sin(this.field_3 + (double)33.0F) * (double)var25) + var25;
  130.          this.yPhil = (int)(Math.sin(this.field_1 + (double)45.0F) * (double)var27) + var25;
  131.          this.yAmy = (int)(Math.sin(this.field_1 + (double)50.0F) * (double)var25) + var25;
  132.          this.yArnaud = (int)(Math.sin(this.field_1 + (double)60.0F) * (double)var25) + var25;
  133.          this.yGes = (int)(Math.sin(this.field_3 + (double)70.0F) * (double)var25) + var25;
  134.          this.yRick = (int)(Math.sin(this.field_1 + (double)80.0F) * (double)var26) + var25;
  135.          this.yJag = (int)(Math.sin(this.field_1 + (double)90.0F) * (double)var25) + var25;
  136.          if (this.field_0 > (double)30.0F) {
  137.             this.squish(var1, this.arnaud, this.xArnaud, this.yArnaud, var20);
  138.          }
  139.  
  140.          if (this.field_0 > (double)15.0F) {
  141.             this.squish(var1, this.phil, this.xPhil, this.yPhil, var18);
  142.          }
  143.  
  144.          if (this.field_0 > (double)9.0F) {
  145.             this.squish(var1, this.rick, this.xRick, this.yRick, var12);
  146.          }
  147.  
  148.          if (this.field_0 > (double)27.0F) {
  149.             this.squish(var1, this.tim, this.xTim, this.yTim, var4);
  150.          }
  151.  
  152.          if (this.field_0 > (double)12.0F) {
  153.             this.squish(var1, this.tom, this.xTom, this.yTom, var6);
  154.          }
  155.  
  156.          if (this.field_0 > (double)33.0F) {
  157.             if (var14 > 0.65) {
  158.                this.squish(var1, this.hans1, this.xHans, this.yHans, var14);
  159.             } else {
  160.                this.squish(var1, this.hans2, this.xHans, this.yHans, var14);
  161.             }
  162.          }
  163.  
  164.          if (this.field_0 > (double)21.0F) {
  165.             this.squish(var1, this.amy, this.xAmy, this.yAmy, var10);
  166.          }
  167.  
  168.          if (this.field_0 > (double)6.0F) {
  169.             this.squish(var1, this.jag, this.xJag, this.yTom, var8);
  170.          }
  171.  
  172.          this.squish(var1, this.jeff, this.xJeff, this.yJeff, var2);
  173.          if (this.field_0 > (double)3.0F) {
  174.             this.squish(var1, this.ges, this.xGes, this.yGes, var16);
  175.          }
  176.  
  177.          if (this.field_0 > (double)18.0F) {
  178.             this.squish(var1, this.rich, this.xRich, this.yRich, var22);
  179.          }
  180.  
  181.       }
  182.    }
  183.  
  184.    public void squish(Graphics var1, ImageIcon var2, int var3, int var4, double var5) {
  185.       if (((Component)this).isVisible()) {
  186.          var1.drawImage(var2.getImage(), var3, var4, (int)((double)var2.getIconWidth() * var5), (int)((double)var2.getIconHeight() * var5), this);
  187.       }
  188.  
  189.    }
  190. }
  191.