|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
com.jgoodies.uif.splash.ImageSplash
public final class ImageSplash
This implementation of the SplashProvider
interface uses an
AWT Window to display a splash image and an optional progress
bar. It has been optimized for quick startup.
TODO: Add features for an optional drop shadow (platform dependent) and using translucent splash images showing the desktop background.
Splash
,
SplashProvider
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
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 | |
---|---|
ImageSplash(Frame owner,
Image image,
String initialNote,
boolean progressVisible)
Constructs an AWT based splash for the given Frame, Image, initial note and progress visibility. |
|
ImageSplash(Image image)
Constructs an AWT based splash for the given image using a
default Frame. |
|
ImageSplash(Image image,
boolean progressVisible)
Constructs an AWT based splash for the given image
using a default Frame that has an optional progress bar. |
Method Summary | |
---|---|
void |
closeSplash()
Closes and disposes the splash window. |
Color |
getTextColor()
Returns the note color. |
boolean |
isNoteEnabled()
Returns whether this splash honors or ignores note changes. |
boolean |
isProgressVisible()
Returns whether this splash shows a progress bar or not. |
void |
openSplash()
Opens the splash window. |
void |
paint(Graphics g)
Renders the image and optionally a progress bar with a note. |
void |
setNote(String newNote)
Sets a new note if and only if isNoteEnabled() returns true. |
void |
setNoteEnabled(boolean noteEnabled)
Sets whether this splash shall honor or ignore note changes. |
void |
setProgress(int percent)
Sets a new progress value. |
void |
setProgressBarBounds(int bottomPad)
Sets the bounds for the progress bar using a pad from the dialog's bottom. |
void |
setProgressBarBounds(Rectangle r)
Sets the bounds for the progress bar using the given Rectangle. |
void |
setProgressVisible(boolean progressVisible)
Shows or hides the progress bar. |
void |
setTextColor(Color newTextColor)
Sets a new note color. |
void |
update(Graphics g)
Updates the display area of the window. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ImageSplash(Image image)
image
using a
default Frame. Progress is invisible and note changes will be ignored.
image
- the splash image to displaypublic ImageSplash(Image image, boolean progressVisible)
image
using a default Frame that has an optional progress bar.
The initial note is 'Loading…'. Note changes will be ignored
by default, see setNoteEnabled(boolean)
.
image
- the splash image to displayprogressVisible
- true
to show progress, false
to hide itpublic ImageSplash(Frame owner, Image image, String initialNote, boolean progressVisible)
setNoteEnabled(boolean)
.
owner
- this window's parent frameimage
- the splash image to displayinitialNote
- the note that will be displayed firstprogressVisible
- true
to show progress, false
to hide itMethod Detail |
---|
public boolean isNoteEnabled()
true
if this splash changes the displayed note in
setNote(String)
, false
to ignore itpublic void setNoteEnabled(boolean noteEnabled)
noteEnabled
- true
if this splash changes the displayed
note in setNote(String)
, false
to ignore itpublic boolean isProgressVisible()
true
if this splash shows a progress, false
if notpublic void setProgressVisible(boolean progressVisible)
progressVisible
- true
to show the progress, false
to hide itpublic Color getTextColor()
public void setTextColor(Color newTextColor)
newTextColor
- the new note colorpublic void setProgressBarBounds(Rectangle r)
r
- the Rectangle that describes the progress bar boundspublic void setProgressBarBounds(int bottomPad)
bottomPad
- the distance in pixel from the splash's bottompublic void openSplash()
openSplash
in interface SplashProvider
public void closeSplash()
closeSplash
in interface SplashProvider
public void setProgress(int percent)
setProgress
in interface SplashProvider
percent
- the current progress in percentpublic void setNote(String newNote)
isNoteEnabled()
returns true.
setNote
in interface SplashProvider
newNote
- the note to setpublic void update(Graphics g)
paint
is called directly. This is possible, because
the splash fills its complete area.
update
in class Container
public void paint(Graphics g)
#paint0
that is used by
repaintImmediately()
too.
paint
in class Container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |