net.xoetrope.swt.splash
Class XSplashWindow

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by org.eclipse.swt.widgets.Decorations
                          extended by org.eclipse.swt.widgets.Shell
                              extended by net.xoetrope.swt.splash.XSplashWindow
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class XSplashWindow
extends org.eclipse.swt.widgets.Shell

A Splash window.

Usage: MyApplication is your application class. Create a Splasher class which opens the splash window, invokes the main method of your Application class, and disposes the splash window afterwards. Please note that we want to keep the Splasher class and the XSplashWindow class as small as possible. The less code and the less classes must be loaded into the JVM to open the splash screen, the faster it will appear.

 class Splasher
 {
   public static void main( String[] args )
   {
     XSplashWindow.splash( Splasher.class.getResource( "splash.gif" ) );
     String[] appArgs = new String[args.length - 1];
     for ( int i = 1; i < args.length; i++ )
       appArgs[ i - 1 ] = args[ i ];
     XSplashWindow.disposeSplash( 8000 );
     XSplashWindow.invokeMain( args[ 0 ], appArgs );
   }
 }
 

See Also:
http://www.randelshofer.ch/oop/javasplash/javasplash.html

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Method Summary
protected  void checkSubclass()
          Suppress the subclassing exception.
static void disposeSplash(int delay)
          Closes the splash window.
static void invokeMain(java.lang.String className, java.lang.String[] args)
          Invokes the main method of the provided class name.
static void splash(org.eclipse.swt.graphics.Image image)
          Open's a splash window using the specified image.
static void splash(java.net.URL imageURL)
          Open's a splash window using the specified image.
 void update(org.eclipse.swt.graphics.GC g)
          Updates the display area of the window.
 
Methods inherited from class org.eclipse.swt.widgets.Shell
addShellListener, close, dispose, forceActive, getBounds, getEnabled, getImeInputMode, getLocation, getMinimumSize, getRegion, getShell, getShells, getSize, isEnabled, isVisible, open, removeShellListener, setActive, setEnabled, setImeInputMode, setMinimumSize, setMinimumSize, setRegion, setVisible, win32_new
 
Methods inherited from class org.eclipse.swt.widgets.Decorations
computeTrim, getClientArea, getDefaultButton, getImage, getImages, getMaximized, getMenuBar, getMinimized, getText, isReparentable, setDefaultButton, setImage, setImages, setMaximized, setMenuBar, setMinimized, setText
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getFont, getForeground, getLayoutData, getMenu, getMonitor, getParent, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isFocusControl, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception.

Overrides:
checkSubclass in class org.eclipse.swt.widgets.Decorations

update

public void update(org.eclipse.swt.graphics.GC g)
Updates the display area of the window.

Parameters:
g - The graphic component.

splash

public static void splash(org.eclipse.swt.graphics.Image image)
Open's a splash window using the specified image.

Parameters:
image - The splash image.

splash

public static void splash(java.net.URL imageURL)
Open's a splash window using the specified image.

Parameters:
imageURL - The url of the splash image.

disposeSplash

public static void disposeSplash(int delay)
Closes the splash window.

Parameters:
delay - The dealy in milliseconds.

invokeMain

public static void invokeMain(java.lang.String className,
                              java.lang.String[] args)
Invokes the main method of the provided class name.

Parameters:
className - The name of the class to be invoked.
args - The command line arguments.