|
|||||||||
| 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
javax.swing.JWindow
org.geworkbench.util.SplashBitmap
public class SplashBitmap
Displays a splash screen containing one bitmap file and an optional progress bar.
The splash screen can be selected to be hidden after a certain amount of time, when
the user clicks it or by calling a method.
The bitmap used is loaded from a file. Valid file formats are GIF, JPEG and PNG.
The progress bar can be determinate or indeterminate. When determinate, it completes
when the set timeout has passed.
Everything including showing, configuration, updating and hiding the splash screen
can also be done manually.
Example #1:
// specify a bitmap file
SplashBitmap splash = new SplashBitmap(pathToFileOnFilesystem);
// make it close when clicked
splash.hideOnClick();
// show the whole thing
splash.showSplash();
Example #2:
// specify a bitmap file
SplashBitmap splash = new SplashBitmap(new URL("http://some.host.and/file.png"));
// close after 2 seconds
splash.hideOnTimeout(2000);
// interrupt the timeout and close when the splash screen is clicked
splash.hideOnClick();
// add a progress bar that completes within these 2 seconds
splash.addAutoProgressBar();
// display a string in the progress bar
splash.setProgressBarString("loading...");
// show the whole thing
splash.showSplash();
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JWindow |
|---|
javax.swing.JWindow.AccessibleJWindow |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected javax.swing.JProgressBar |
bar
|
| Fields inherited from class javax.swing.JWindow |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| 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 | |
|---|---|
SplashBitmap(java.lang.String filename)
Constructs a new splash screen with the bitmap from the given file name. |
|
SplashBitmap(java.net.URL filename)
Constructs a new splash screen with the bitmap from the given URL. |
|
| Method Summary | |
|---|---|
void |
addAutoProgressBar()
Adds a JProgressBar to the splash screen that is automatically updated. |
void |
addAutoProgressBarIndeterminate()
Adds a indeterminate JProgressBar to the splash screen that will be updated while the splash screen is displayed. Only one progress bar can be added to the splash screen at a time. |
void |
addManualProgressBar(int min,
int max)
Adds a JProgressBar to the splash screen that can be updated manually. Only one progress bar can be added to the splash screen at a time. |
void |
addProgressBarPercent()
Displays the percentage of progress in the progress bar. |
int |
getProgressBarValue()
Gets the current value of the progress bar in this splash screen. |
void |
hideOnClick()
Tells this splash screen to close when being clicked. |
void |
hideOnTimeout(int timeout)
Tells this splash screen to close after a certain time has passed. |
void |
hideSplash()
Hides this splash screen and stops all running timers. |
void |
setProgressBarString(java.lang.String text)
Sets the string that is displayed in the progress bar. |
void |
setProgressBarValue(int value)
Sets the value of the progress bar in this splash screen to a new value. |
void |
showSplash()
Shows this splash screen. |
| Methods inherited from class javax.swing.JWindow |
|---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update, windowInit |
| Methods inherited from class java.awt.Window |
|---|
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.JProgressBar bar
| Constructor Detail |
|---|
public SplashBitmap(java.net.URL filename)
showSplash().
filename - the URL of the image file to displaypublic SplashBitmap(java.lang.String filename)
showSplash().
filename - the name of the image file to display| Method Detail |
|---|
public void showSplash()
public void hideSplash()
public void hideOnTimeout(int timeout)
timeout - the time this splash screen is to be displayed in millisecondspublic void hideOnClick()
public void addAutoProgressBar()
hideOnTimeout(int) has expired. Not specifying this timeout
will let the progress bar complete as fast as possible.
hideOnTimeout(int)public void addAutoProgressBarIndeterminate()
public void addManualProgressBar(int min,
int max)
min - the JProgressBar's minimum valuemax - the JProgressBar's maximum valuesetProgressBarValue(int),
getProgressBarValue()public void setProgressBarValue(int value)
value - the new value of the progress barpublic int getProgressBarValue()
public void setProgressBarString(java.lang.String text)
text - the string to be displayed in the progress barpublic void addProgressBarPercent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||