home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / OS2 / NETREXX.ARJ / NETREXX.ZIP / NetRexx / ArchText.class (.txt) next >
Encoding:
Java Class File  |  1997-06-25  |  2.1 KB  |  73 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Image;
  7. import java.awt.image.ImageObserver;
  8.  
  9. public class ArchText extends Applet implements Runnable {
  10.    protected String text = "NetRexx";
  11.    protected int tick;
  12.    protected Thread timer;
  13.    protected Image shadow;
  14.    protected Graphics draw;
  15.    // $FF: renamed from: $0 java.lang.String
  16.    private static final String field_0 = "ArchText.nrx";
  17.  
  18.    public void init() {
  19.       String var1 = ((Applet)this).getParameter("text");
  20.       if (var1 != null) {
  21.          this.text = var1;
  22.       }
  23.  
  24.       this.shadow = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
  25.       this.draw = this.shadow.getGraphics();
  26.       this.draw.setColor(Color.white);
  27.       this.draw.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  28.       this.draw.setFont(new Font("TimesRoman", 1, 30));
  29.    }
  30.  
  31.    public void start() {
  32.       if (this.timer == null) {
  33.          this.timer = new Thread(this);
  34.       }
  35.  
  36.       this.timer.setPriority(10);
  37.       this.timer.start();
  38.    }
  39.  
  40.    public void stop() {
  41.       if (this.timer != null) {
  42.          this.timer.stop();
  43.          this.timer = null;
  44.       }
  45.    }
  46.  
  47.    public void run() {
  48.       float var1 = 0.0F;
  49.  
  50.       try {
  51.          while(this.timer != null) {
  52.             ++this.tick;
  53.             var1 = (float)((this.tick + 133) % 191) / 191.0F;
  54.             this.draw.setColor(Color.getHSBColor(var1, 1.0F, 0.7F));
  55.             this.draw.drawString(this.text, 0, 30);
  56.             ((Component)this).repaint();
  57.             Thread.sleep(119L);
  58.          }
  59.       } catch (InterruptedException var2) {
  60.       }
  61.  
  62.       this.timer = null;
  63.    }
  64.  
  65.    public void update(Graphics var1) {
  66.       this.paint(var1);
  67.    }
  68.  
  69.    public void paint(Graphics var1) {
  70.       var1.drawImage(this.shadow, 0, 0, (ImageObserver)null);
  71.    }
  72. }
  73.