|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.smardec.asc.util.JSplashScreen
JSplashScreen
is highly configurable splash screen component. It can display image or user defined panel.
JSplashScreen
allows to set whether it should be closed on mouse click, minimum display time, display time and border.
Image can be set as javax.swing.ImageIcon
, java.awt.Image
, path to the image or java.net.URL
location
of the image file. JSplashScreen
autoresizes to fit image dimensions.
To show user defined custom panel it should be set by setCustomPanel(javax.swing.JPanel)
.
Sample usage:
JSplashScreen splash = new JSplashScreen(parentFrame);
splash.setImage("path/to/image");
splash.setBorder(BorderFactory.createLineBorder(Color.black, 1));
splash.setCloseOnClick(true);
splash.setMinimumDisplayTime(1000);
splash.setDisplayTime(3000);
splash.showSplash();
Field Summary | |
static int |
INFINITE
If minimumDisplayTime or displayTime is set to INFINITE than it is not used. |
Constructor Summary | |
JSplashScreen()
Creates initially invisible, non-modal splash screen. |
|
JSplashScreen(java.awt.Window owner)
Creates initially invisible, modal splash screen. |
Method Summary | |
javax.swing.border.Border |
getBorder()
Returns the border shown around the image or custom panel. |
javax.swing.JPanel |
getCustomPanel()
Returns user defined panel shown in splash screen instead of image. |
int |
getDisplayTime()
Returns display time in milliseconds. |
java.awt.Rectangle |
getHyperlinkRectangle()
Returns Rectangle with hyperlink area. |
int |
getMinimumDisplayTime()
Returns minimum display time in milliseconds. |
java.lang.String |
getUrl()
Returns url string. |
void |
hideSplash()
Hides splash screen. |
void |
hideSplash(boolean force)
Hides splash screen. |
boolean |
isCloseOnClick()
Indicates whether splash screen should be closed on a mouse click. |
void |
setBorder(javax.swing.border.Border border)
Sets the border shown around the image or custom panel. |
void |
setCloseOnClick(boolean closeOnClick)
Specifies whether splash screen should be closed on a mouse click. |
void |
setCustomPanel(javax.swing.JPanel customPanel)
Sets user defined panel shown in splash screen instead of image. |
void |
setDisplayTime(int displayTime)
Sets display time in milliseconds. |
void |
setHyperlinkRectangle(java.awt.Rectangle hyperlinkRectangle)
Sets Rectangle with hyperlink area. |
void |
setImage(java.awt.Image image)
Sets image shown in splash screen. |
void |
setImage(javax.swing.ImageIcon image)
Sets image shown in splash screen. |
void |
setImage(java.lang.String filename)
Sets image shown in splash screen. |
void |
setImage(java.net.URL location)
Sets image shown in splash screen. |
void |
setMinimumDisplayTime(int minimumDisplayTime)
Sets minimum display time in milliseconds. |
void |
setUrl(java.lang.String url)
Sets url string. |
void |
showSplash()
Shows splash screen. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INFINITE
minimumDisplayTime
or displayTime
is set to INFINITE
than it is not used.
Constructor Detail |
public JSplashScreen()
JSplashScreen(Window)
.
public JSplashScreen(java.awt.Window owner)
JSplashScreen()
.
owner
- owner window, splash screen will be modal relative to the owner
Method Detail |
public void setImage(javax.swing.ImageIcon image)
image
- image to showpublic void setImage(java.awt.Image image)
image
- image to showpublic void setImage(java.lang.String filename)
filename
- path to the imagepublic void setImage(java.net.URL location)
location
- location of the imagepublic javax.swing.JPanel getCustomPanel()
null
.public void setCustomPanel(javax.swing.JPanel customPanel)
customPanel
- user defined panelpublic javax.swing.border.Border getBorder()
public void setBorder(javax.swing.border.Border border)
border
- user defined borderpublic boolean isCloseOnClick()
true
if splash screen should be closed on a mouse click; false
otherwise.public void setCloseOnClick(boolean closeOnClick)
closeOnClick
- true
if splash screen should be closed on a mouse click; false
otherwisepublic int getMinimumDisplayTime()
hideSplash(boolean)
and pass true
.
public void setMinimumDisplayTime(int minimumDisplayTime)
hideSplash(boolean)
and pass true
.
minimumDisplayTime
- minimum display time in millisecondspublic int getDisplayTime()
public void setDisplayTime(int displayTime)
displayTime
- display time in millisecondspublic void showSplash()
public void hideSplash()
hideSplash(boolean)
with false
parameter.
public void hideSplash(boolean force)
force
- true
if splash screen should be closed even if minimum time is set and not elapsed;
false
if splash screen should be closed if minimum time is set and not elapsed. If minimum time is not set
than splash screen will be closedpublic java.awt.Rectangle getHyperlinkRectangle()
Rectangle
with hyperlink area.
Rectangle
with hyperlink area.public void setHyperlinkRectangle(java.awt.Rectangle hyperlinkRectangle)
Rectangle
with hyperlink area.
hyperlinkRectangle
- Rectangle
with hyperlink areapublic java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- url string
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |