uic.widgets
Class Splash

java.lang.Object
  extended by uic.widgets.Splash
Direct Known Subclasses:
SplashScreen

public class Splash
extends Object

A Splash screen that will show a picture and possibly a progressbar. The splash screen is written for speed; on my 800 mHz machine it takes less then a second for this splash to be visible.
Positioning of the splash is in the center of the current screen (choosing the active monitor on a multi screen setup).

Since:
1.2

Constructor Summary
Splash(Image image, boolean showProgress)
          Start a Splash screen by providing an Image.
 
Method Summary
 void close()
          closes this splash screen.
 void setPartnerComponent(Component comp)
          Set a component which will cause the splash to hide if it becomes visible.
 void setProgress(int newValue)
          Set the new progress value for the progress bar.
 void setProgressBarLocation(int fromBottom)
           
 void setProgressBarLocation(int fromRight, int fromBottom)
           
 void setProgressBarLocation(int x, int y, int width, int height)
           
 void setProgressMax(int maxValue)
          Change the maximum value of the progress bar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Splash

public Splash(Image image,
              boolean showProgress)
Start a Splash screen by providing an Image. The most obvious usage is this;
  Splash s;
  try {
      Image image = new ImageIcon(new URL("file:/home/zander/sources/microweb/woonactueel/resources/nl/default/images/permissionsmanager.jpg")).getImage();
      s = new Splash(image, true);
  } catch (java.io.IOException e) {
      s = null;
  }
  
Note that this uses a Swing component (ImageIcon) which may delay loading. Note also that the SplashScreen class provides an easier way to construct; but that it requires the ImageIO package which has been introduced in JRE 1.4

Method Detail

setProgressBarLocation

public void setProgressBarLocation(int x,
                                   int y,
                                   int width,
                                   int height)

setProgressBarLocation

public void setProgressBarLocation(int fromRight,
                                   int fromBottom)

setProgressBarLocation

public void setProgressBarLocation(int fromBottom)

setPartnerComponent

public void setPartnerComponent(Component comp)
Set a component which will cause the splash to hide if it becomes visible. In order to use the splash screen in a 'create-and-forget' manner it is possible to set a component that can be called the partner component for this splash. The splash screen will stay on screen for as long as it taks Java to startup and show the partner component. Automatically closing itself as soon as the partner component becomes visible.

Parameters:
comp - the component which is a partner of this splash
Since:
2.0

setProgress

public void setProgress(int newValue)
Set the new progress value for the progress bar.

See Also:
setProgressMax(int)

setProgressMax

public void setProgressMax(int maxValue)
Change the maximum value of the progress bar. Normally the progressbar thinks in percentages, meaning the max is 100. Change this to make the progress value paint a different size progressbar.

See Also:
setProgress(int)

close

public void close()
closes this splash screen. Notice that the splash can not be reused afterwards.



Copyright © 2002-2004 Thomas Zander Available under the Free Apache licence