com.jgoodies.uif.splash
Class Splash

java.lang.Object
  extended by com.jgoodies.uif.splash.Splash

public final class Splash
extends Object

A singleton that provides access to a pluggable splash to improve the application's feedback during startup. You can open and close it, set messages and indicate progress.

The concrete work is done by pluggable splash providers, which you can set via #setProvider, for example a splash window or splash panel. The default provider is NullSplash, other providers are ImageSplash and JWindowSplash.

This class logs splash events on CONFIG level with the elapsed time. You must invoke #initStartTime in your application's #main method to get accurate timing information.

Version:
$Revision: 1.4 $
Author:
Karsten Lentzsch
See Also:
SplashProvider

Method Summary
static void close()
          Closes the splash by calling the providers #closeSplash method.
static long elapsedTime()
          Computes and returns the elapsed time since the last invocation of #resetStartTime().
static void ensureClosed()
          Ensures that the splash is closed, calls #close if necessary.
static void ensureOpen()
          Ensures that the splash is open, calls #open if necessary.
static SplashProvider getProvider()
          Returns the current SplashProvider.
static void open()
          Opens the splash by calling the providers #openSplash method.
static void resetStartTime()
          Resets the start time that is used to compute the elapsed time.
static void setNote(String message)
          Sets the splash note.
static void setNote(String message, int percent)
          Sets the splash note and progress at the same time.
static void setProgress(int percent)
          Sets the splash progress percent value.
static void setProvider(SplashProvider newProvider)
          Sets a SplashProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resetStartTime

public static void resetStartTime()
Resets the start time that is used to compute the elapsed time.


elapsedTime

public static long elapsedTime()
Computes and returns the elapsed time since the last invocation of #resetStartTime().

Returns:
the time that has been elapsed since the time has been reset

ensureOpen

public static void ensureOpen()
Ensures that the splash is open, calls #open if necessary.


ensureClosed

public static void ensureClosed()
Ensures that the splash is closed, calls #close if necessary.


open

public static void open()
Opens the splash by calling the providers #openSplash method.


close

public static void close()
Closes the splash by calling the providers #closeSplash method.


setNote

public static void setNote(String message)
Sets the splash note.

Parameters:
message - the text to be set as current splash note

setProgress

public static void setProgress(int percent)
Sets the splash progress percent value.

Parameters:
percent - the progress in percent to be set as splash progress

setNote

public static void setNote(String message,
                           int percent)
Sets the splash note and progress at the same time.

Parameters:
message - the text to be set as current splash note
percent - the progress in percent to be set as splash progress

getProvider

public static SplashProvider getProvider()
Returns the current SplashProvider.

Returns:
the current SplashProvider.

setProvider

public static void setProvider(SplashProvider newProvider)
Sets a SplashProvider.

Parameters:
newProvider - the SplashProvider to be set


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.