home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Graphics;
- import java.awt.Image;
-
- public class MarqueeForImages extends Applet implements Runnable {
- Thread runner;
- String text;
- String ImageSrc;
- int step;
- // $FF: renamed from: x int
- int field_0;
- Image OffscreenImage;
- Image Img;
- Graphics OffscreenGraphics;
-
- public void init() {
- this.ImageSrc = ((Applet)this).getParameter("ImageSrc");
- this.ImageSrc = this.ImageSrc == null ? "HTMLtool.gif" : this.ImageSrc;
- if (((Applet)this).getParameter("Step") == null) {
- this.step = 1;
- } else {
- this.step = Integer.parseInt(((Applet)this).getParameter("step"));
- }
-
- this.field_0 = ((Component)this).size().width;
- this.OffscreenImage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
- this.OffscreenGraphics = this.OffscreenImage.getGraphics();
- this.Img = ((Applet)this).getImage(((Applet)this).getCodeBase(), this.ImageSrc);
- }
-
- public void run() {
- while(true) {
- try {
- Thread.sleep(10L);
- this.field_0 -= this.step;
- ((Component)this).repaint();
- } catch (InterruptedException var1) {
- }
- }
- }
-
- public void update(Graphics g) {
- this.paint(g);
- }
-
- public void paint(Graphics g) {
- if (this.field_0 < -this.Img.getWidth(this)) {
- this.field_0 = ((Component)this).size().width;
- }
-
- this.OffscreenGraphics.setColor(Color.lightGray);
- this.OffscreenGraphics.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
- this.OffscreenGraphics.drawImage(this.Img, this.field_0, 0, this);
- g.drawImage(this.OffscreenImage, 0, 0, this);
- }
-
- public void stop() {
- if (this.runner != null) {
- this.runner.stop();
- this.runner = null;
- }
-
- }
-
- public void start() {
- if (this.runner == null) {
- this.runner = new Thread(this);
- this.runner.start();
- }
-
- }
-
- public String getAppletInfo() {
- return "Marquee for Images v1.1 copyright 1997 by Lorenz Graf";
- }
- }
-