home *** CD-ROM | disk | FTP | other *** search
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.PrintStream;
-
- public class Example1 {
- private Frame frm;
- private Animator animator;
- // $FF: renamed from: g java.awt.Graphics
- private Graphics field_0;
- private static final int WIDTH = 200;
- private static final int HEIGHT = 200;
- private static final int BORDER = 20;
-
- public static void main(String[] var0) {
- Example1 var1 = new Example1();
- var1.init();
- }
-
- public void init() {
- this.frm = new Frame();
- this.frm.setLayout(new BorderLayout());
- this.frm.setTitle("Processing...");
- this.frm.setSize(200, 220);
- this.frm.addWindowListener(new Example1$1(this));
- this.frm.show();
- }
-
- private void createAnim() {
- Image var1 = this.frm.createImage(200, 200);
- Graphics var2 = var1.getGraphics();
- this.animator = Animator.getInstance("GIF", 200, 200);
- this.animator.setFPS(40);
- this.field_0 = this.frm.getGraphics();
-
- for(int var3 = 0; var3 < 100; var3 += 3) {
- var2.setColor(Color.white);
- var2.fillRect(0, 0, 200, 200);
- var2.setColor(new Color(2 * var3, 0, 255 - 2 * var3));
- var2.fillRect(var3, var3, 100, 100);
- this.animator.addImage(var1, this.frm);
- this.field_0.drawImage(var1, 0, 20, this.frm);
- }
-
- try {
- this.animator.getAnimation().serializeTo(new PrintStream(new FileOutputStream("ex1.gif")));
- } catch (IOException var4) {
- }
-
- System.exit(0);
- }
-
- // $FF: synthetic method
- static void access$0(Example1 var0) {
- var0.createAnim();
- }
- }
-