/Users/lyon/j4p/src/j2d/animation/ImageSequenceProcessorDisplayController.java

1    package j2d.animation; 
2     
3    import j2d.ImageProcessorInterface; 
4     
5    import java.awt.*; 
6     
7    import utils.SystemUtils; 
8     
9    /** 
10    * Created by IntelliJ IDEA. 
11    * User: lyon 
12    * Date: May 4, 2003 
13    * Time: 7:19:43 AM 
14    * To change this template use Options | File Templates. 
15    */ 
16   public class ImageSequenceProcessorDisplayController 
17           implements ImageProcessorInterface { 
18       private Image ia[] = null; 
19       private int index = 0; 
20    
21       public Image process(Image img) { 
22           index++; 
23           System.out.println("next image=" + index); 
24           SystemUtils.free(); 
25           if (index >= ia.length) index = 0; 
26           return ia[index]; 
27    
28       } 
29    
30       public ImageSequenceProcessorDisplayController(Image image[]) { 
31           this.ia = image; 
32       } 
33   } 
34