home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.image.ImageObserver;
-
- public class tinyScroller extends Applet implements Runnable {
- int maxLines = 100;
- int direction;
- int delay = 100;
- int startDelay;
- int spacing = 12;
- int XPos = 5;
- int maxLine;
- int current;
- int height;
- String[] Line;
- Image offImage;
- // $FF: renamed from: bg java.awt.Image
- Image field_0;
- Graphics offGrfx;
- Font outFont;
- boolean customFont;
- Color background;
- Color fontColor;
- Thread runner;
-
- public void init() {
- String var1 = ((Applet)this).getParameter("BGRED");
- String var2 = ((Applet)this).getParameter("BGGREEN");
- String var3 = ((Applet)this).getParameter("BGBLUE");
- String var4 = ((Applet)this).getParameter("FGRED");
- String var5 = ((Applet)this).getParameter("FGGREEN");
- String var6 = ((Applet)this).getParameter("FGBLUE");
- String var7 = ((Applet)this).getParameter("SPACING");
- String var8 = ((Applet)this).getParameter("DELAY");
- String var9 = ((Applet)this).getParameter("STARTDELAY");
- String var10 = ((Applet)this).getParameter("XPOS");
- ((Applet)this).getParameter("MAXLINE");
- String var11 = ((Applet)this).getParameter("BACKGROUND");
- String var12 = ((Applet)this).getParameter("FONTNAME");
- String var13 = ((Applet)this).getParameter("FONTSIZE");
- String var14 = ((Applet)this).getParameter("DIRECTION");
-
- for(int var15 = 0; var15 < this.maxLines; ++var15) {
- this.Line[var15] = ((Applet)this).getParameter("LINE" + Integer.toString(var15 + 1));
- }
-
- if (var13 != null && var12 != null) {
- int var16 = Integer.parseInt(var13);
- this.outFont = new Font(var12, 0, var16);
- this.customFont = true;
- }
-
- for(int var23 = 0; var23 < this.maxLines && this.Line[var23] != null; ++var23) {
- ++this.maxLine;
- }
-
- int var17 = 255;
- if (var1 != null) {
- var17 = Integer.parseInt(var1);
- }
-
- int var18 = 255;
- if (var2 != null) {
- var18 = Integer.parseInt(var2);
- }
-
- int var19 = 255;
- if (var3 != null) {
- var19 = Integer.parseInt(var3);
- }
-
- int var20 = 0;
- if (var4 != null) {
- var20 = Integer.parseInt(var4);
- }
-
- int var21 = 0;
- if (var5 != null) {
- var21 = Integer.parseInt(var5);
- }
-
- int var22 = 0;
- if (var6 != null) {
- var22 = Integer.parseInt(var6);
- }
-
- if (var7 != null) {
- this.spacing = Integer.parseInt(var7);
- }
-
- if (var8 != null) {
- this.delay = Integer.parseInt(var8);
- }
-
- if (var9 != null) {
- this.startDelay = Integer.parseInt(var9);
- }
-
- if (var10 != null) {
- this.XPos = Integer.parseInt(var10);
- }
-
- this.height = ((Component)this).size().height;
- if (var14 != null) {
- this.direction = Integer.parseInt(var14);
- }
-
- if (var11 != null) {
- this.field_0 = ((Applet)this).getImage(((Applet)this).getDocumentBase(), var11);
- }
-
- if (this.direction == 0) {
- this.current = this.height;
- } else {
- this.current = -(this.maxLine * this.spacing);
- }
-
- this.fontColor = new Color(var20, var21, var22);
- this.background = new Color(var17, var18, var19);
- ((Component)this).setBackground(this.background);
- this.offImage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
- this.offGrfx = this.offImage.getGraphics();
- }
-
- public void paint(Graphics var1) {
- this.offGrfx.setColor(this.background);
- this.offGrfx.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
- if (this.field_0 != null) {
- this.offGrfx.drawImage(this.field_0, 0, this.current - this.height, (ImageObserver)null);
- }
-
- this.offGrfx.setColor(this.fontColor);
-
- try {
- this.offGrfx.setFont(this.outFont);
- } catch (NullPointerException var3) {
- }
-
- if (this.direction == 0) {
- for(int var2 = 0; var2 < this.maxLine; ++var2) {
- this.offGrfx.drawString(this.Line[var2], this.XPos, this.current + var2 * this.spacing);
- }
- } else {
- for(int var4 = 0; var4 < this.maxLine; ++var4) {
- this.offGrfx.drawString(this.Line[var4], this.XPos, this.current + (this.maxLine - var4) * this.spacing);
- }
- }
-
- var1.drawImage(this.offImage, 0, 0, this);
- }
-
- public void update(Graphics var1) {
- this.paint(var1);
- }
-
- public void start() {
- if (this.runner == null) {
- this.runner = new Thread(this);
- this.runner.start();
- }
-
- }
-
- public void run() {
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)this.startDelay);
- } catch (InterruptedException var2) {
- }
-
- while(true) {
- ((Component)this).repaint();
- if (this.direction == 0) {
- --this.current;
- if (this.current + this.maxLine * this.spacing < 0) {
- this.current = this.height + this.spacing;
- }
- } else {
- ++this.current;
- if (this.current > this.height) {
- this.current = -(this.maxLine * this.spacing);
- }
- }
-
- try {
- Thread.sleep((long)this.delay);
- } catch (InterruptedException var1) {
- }
- }
- }
-
- public void stop() {
- if (this.runner != null) {
- this.runner.stop();
- this.runner = null;
- }
-
- }
-
- public tinyScroller() {
- this.Line = new String[this.maxLines];
- this.customFont = false;
- }
- }
-