-
- All Implemented Interfaces:
public class ConsoleLoadingAnimationA simple function to create a loading animation in the console. Useful while startup routines to show a user that the software is still working. Cant be used with ConsoleManager together.
-
-
Method Summary
Modifier and Type Method Description static voidsetAnimation(Array<char> animation)The animation chars in the correct order. static voidsetSpeed(int speed)The speed of the animation. static voidenable()Enable the loading animation and take over print stream to prevent output while loading. static synchronized voidenable(boolean takeOverSystemOutputStream)Enable the loading animation. static synchronized voiddisable()Disable and remove the loading animation. static booleanisEnabled()Is the animation enabled? -
-
Method Detail
-
setAnimation
static void setAnimation(Array<char> animation)
The animation chars in the correct order. Will also reset the animation to start at the beginning.
- Parameters:
animation- Default is {'⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷'}.
-
setSpeed
static void setSpeed(int speed)
The speed of the animation. Higher is slower.
- Parameters:
speed- Default is 25.
-
enable
static void enable()
Enable the loading animation and take over print stream to prevent output while loading. Cant be used with ConsoleManager together.
-
enable
static synchronized void enable(boolean takeOverSystemOutputStream)
Enable the loading animation. Cant be used with ConsoleManager together.
- Parameters:
takeOverSystemOutputStream- Take over the output stream from System.out to prevent output while showing loading animation?
-
disable
static synchronized void disable()
Disable and remove the loading animation.
-
isEnabled
static boolean isEnabled()
Is the animation enabled?
-
-
-
-