de.fhg.igd.ui
Class SplashScreen

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjavax.swing.JWindow
                  extended byde.fhg.igd.ui.SplashScreen
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Runnable, Serializable
Direct Known Subclasses:
SemoaSplashScreen

public class SplashScreen
extends JWindow
implements Runnable

Provides an introduction window as "splash screen" Derived from a regular JWindow (Java-Swing), this class provides an image window surrounded by a thin border, which can be used to display introducing information like program logo or copyright. After the window has been activated through the run method it will be shown for a specified timeout period. Furthermore it is possible to directly hide the window by clicking on it or calling the stop method.

Version:
"$Id: SplashScreen.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Alberto Sierra, Jan Peters
See Also:
Serialized Form

Nested Class Summary
(package private)  class SplashScreen.HideIntroAction
          Internal class to react on mouse events.
 
Nested classes inherited from class javax.swing.JWindow
JWindow.AccessibleJWindow
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String OPT_DESCR
          The ArgsParser option descriptor for the case that this class is initiated from command line.
static int TIMEOUT
          The default timeout for the splash screen.
private  int timeout_
          Stores the current timeout for the splash screen.
private  Object waitLock_
          Lock object for synchronization purpose.
 
Fields inherited from class javax.swing.JWindow
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
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
private SplashScreen()
          Default constructor is private.
  SplashScreen(Image image)
          Constructor, which initializes the splash screen with the given image.
  SplashScreen(ImageIcon imageIcon)
          Constructor, which initializes the splash screen with the given image icon.
  SplashScreen(URL imageUrl)
          Constructor, which initializes the splash screen with the image (GIF or JPG) from the given URL.
 
Method Summary
 int getTimeout()
          Get the current timeout for the splash screen.
static void main(String[] argv)
          Main method provides following command line options: help, url and timeout.
 void run()
          Shows the splash screen window.
 void setTimeout(int timeout)
          Sets the timeout for the splash screen.
 void stop()
          Hides the splash screen window again.
 
Methods inherited from class javax.swing.JWindow
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update, windowInit
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPT_DESCR

public static final String OPT_DESCR
The ArgsParser option descriptor for the case that this class is initiated from command line.

See Also:
Constant Field Values

TIMEOUT

public static final int TIMEOUT
The default timeout for the splash screen.

See Also:
Constant Field Values

timeout_

private int timeout_
Stores the current timeout for the splash screen.


waitLock_

private Object waitLock_
Lock object for synchronization purpose.

Constructor Detail

SplashScreen

private SplashScreen()
Default constructor is private.


SplashScreen

public SplashScreen(URL imageUrl)
Constructor, which initializes the splash screen with the image (GIF or JPG) from the given URL.

Parameters:
imageUrl - locates the image to be displayed.

SplashScreen

public SplashScreen(Image image)
Constructor, which initializes the splash screen with the given image.

Parameters:
image - image to be displayed.

SplashScreen

public SplashScreen(ImageIcon imageIcon)
Constructor, which initializes the splash screen with the given image icon.

Method Detail

setTimeout

public void setTimeout(int timeout)
Sets the timeout for the splash screen. If the given timeout is 0, the splash screen window will only be closed by clicking on it.

Parameters:
timeout - The timeout to set.

getTimeout

public int getTimeout()
Get the current timeout for the splash screen.

Returns:
The current timeout.

run

public void run()
Shows the splash screen window. The window hides either after the specified timeout, or by clicking on it respectively calling the stop method.

Specified by:
run in interface Runnable

stop

public void stop()
Hides the splash screen window again.


main

public static void main(String[] argv)
Main method provides following command line options: help, url and timeout.



Copyright © Fraunhofer Gesellschaft. All Rights Reserved.