User:Simpsons contributor/CreateAnimatedFromString

package cellularautomaton;

import java.io.File; import java.io.FileNotFoundException; import java.io.IOException;

public class CreateAnimatedFromString {   public void createImage(String directory, String saveName, int firstNumber, int lastNumber) throws FileNotFoundException, IOException {       //Check that directory exists File dirTest = new File(directory); if(dirTest.isDirectory == false) throw new FileNotFoundException(directory + " foes not exist"); //Set up animated gif encoder AnimatedGifEncoder e = new AnimatedGifEncoder; e.start(saveName); e.setDelay(100); e.setRepeat(0); for(int i=firstNumber; i<=lastNumber; i++) {           System.out.println("Creating animated gif frame " + i +                               " out of " + lastNumber); String fileName = directory + i + ".png"; ImageHolder frame = new ImageHolder(fileName); e.addFrame(frame.getImage); } //End of create for System.out.println("Animated gif " + saveName + " created "); e.finish; }   }