|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.ultraswing.SplashScreen
A splash screen implementation.
Usage Example:
SplashScreen splash = new SplashScreen("/images/splash.jpg", true); splash.setProgressBarColor(Color.gray, Color.blue); splash.start(); for (int i = 0; i < 10 ; i++) { // do initialization ..... splash.setProgress(10 * i);//total progress value is 100 //Add sleep time because there's little to load for this demo, and we don't want splash disappear too quickly Thread.sleep(200); } splash.close();
Field Summary |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
SplashScreen(String imgFileURL,
boolean showProgressBar)
Creates a SplashScreen object |
Method Summary | |
void |
close()
Closes splash screen |
Dimension |
getImageSize()
Returns the image size |
int |
getProgress()
Returns the progress bar's current value |
void |
paint(Graphics aoGraphics)
|
void |
setProgress(int percent)
Sets the progress bar value. |
void |
setProgressBarBounds(int x,
int y,
int width,
int height)
Sets the bounds of progress bar. |
void |
setProgressBarColor(Color background,
Color barColor)
Sets progress bar's colors. |
void |
start()
Starts to show splash screen |
void |
update(Graphics aoGraphics)
|
Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SplashScreen(String imgFileURL, boolean showProgressBar)
imgFileURL
- url of splash imageshowProgressBar
- if true, show progress bar on splash screenMethod Detail |
public Dimension getImageSize()
public void setProgressBarBounds(int x, int y, int width, int height)
public void setProgressBarColor(Color background, Color barColor)
background
- progress bar's background colorbarColor
- progress bar's colorpublic void start()
public void close()
public void setProgress(int percent)
public int getProgress()
public void update(Graphics aoGraphics)
update
in class Canvas
public void paint(Graphics aoGraphics)
paint
in class Canvas
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |