All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.tool.progressbar.ConsoleWindmillBar Maven / Gradle / Ivy

Go to download

Panda Tool contains some commonly used tools and source code generator for Panda Mvc. Can generate Entity/Query/Dao/Action class, Freemarker (HTML) template file.

There is a newer version: 1.5.3
Show newest version
package panda.tool.progressbar;

import java.io.PrintStream;


/**
 * A progress windmill of console
 */
public class ConsoleWindmillBar extends ConsoleProgressBar {

	private static final char[] WINDMILL = { '-', '\\', '|', '/' };
	
	private int frame = 0;
	
	/**
	 * constructor
	 */
	public ConsoleWindmillBar() {
		super();

		setSize(1);
	}

	/**
	 * constructor
	 * @param out output
	 */
	public ConsoleWindmillBar(PrintStream out) {
		super(out);
		
		setSize(1);
	}

	/**
	 * draw progress
	 */
	protected void draw() {
		clear();
		out.print(WINDMILL[frame]);
		out.flush();
		
		frame++;
		if (frame >= WINDMILL.length) {
			frame = 0;
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy