org.springframework.richclient.application.splash
Class AbstractSplashScreen

java.lang.Object
  extended by org.springframework.richclient.application.splash.AbstractSplashScreen
All Implemented Interfaces:
SplashScreen
Direct Known Subclasses:
MacOSXSplashScreen, SimpleSplashScreen

public abstract class AbstractSplashScreen
extends Object
implements SplashScreen

An abstract helper implementation of the SplashScreen interface.

The splash screen produced by this class will be an undecorated, centered frame containing the component provided by createContentPane(), which is the only method that subclasses need to implement.

Author:
Peter De Bruycker

Field Summary
protected  org.apache.commons.logging.Log logger
           
static String SPLASH_TITLE_KEY
          The message resource key used to look up the splash screen's frame title.
 
Constructor Summary
AbstractSplashScreen()
           
 
Method Summary
protected abstract  Component createContentPane()
          Returns the component to be displayed in the splash screen's main frame.
 void dispose()
          Disposes this SplashScreen, freeing any system resources that it may be using.
 String getIconResourcePath()
          Returns the location of the image to be used as the icon for the splash screen's frame.
 MessageSource getMessageSource()
          Returns the message source used to resolve localized messages.
 boolean isRootFrame()
           
 boolean isShadowBorder()
          Returns whether the splash screen will be rendered with a shadow border.
 void setIconResourcePath(String iconResourcePath)
          Sets the location of the image to be used as the icon for the splash screen's frame.
 void setMessageSource(MessageSource messageSource)
          Sets the message source used to resolve localized messages.
 void setRootFrame(boolean rootFrame)
          The frame that is used to display this splashscreen can be used as rootFrame for other dialogs/windows that need a Frame before the applicationFrame is created.
 void setShadowBorder(boolean shadowBorder)
          Sets whether the splash screen will be rendered with a shadow border.
 void splash()
          Creates and displays an undecorated, centered splash screen containing the component provided by createContentPane().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPLASH_TITLE_KEY

public static final String SPLASH_TITLE_KEY
The message resource key used to look up the splash screen's frame title.

See Also:
Constant Field Values

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AbstractSplashScreen

public AbstractSplashScreen()
Method Detail

getIconResourcePath

public String getIconResourcePath()
Returns the location of the image to be used as the icon for the splash screen's frame. The splash screen produced by this class is undecorated, so the icon will only be visible in the frame's taskbar icon. If the given path starts with a '/', it is interpreted to be relative to the root of the runtime classpath. Otherwise it is interpreted to be relative to the subdirectory of the classpath root that corresponds to the package of this class.

Returns:
The location of the icon resource.

setIconResourcePath

public void setIconResourcePath(String iconResourcePath)
Sets the location of the image to be used as the icon for the splash screen's frame. The splash screen produced by this class is undecorated, so the icon will only be visible in the frame's taskbar icon. If the given path starts with a '/', it is interpreted to be relative to the root of the runtime classpath. Otherwise it is interpreted to be relative to the subdirectory of the classpath root that corresponds to the package of this class.

Parameters:
iconResourcePath - The location of the icon resource.

getMessageSource

public MessageSource getMessageSource()
Returns the message source used to resolve localized messages.

Returns:
The message source, or null.

setMessageSource

public void setMessageSource(MessageSource messageSource)
Sets the message source used to resolve localized messages.

Parameters:
messageSource - The message source.

dispose

public final void dispose()
Description copied from interface: SplashScreen
Disposes this SplashScreen, freeing any system resources that it may be using.

Specified by:
dispose in interface SplashScreen

splash

public final void splash()
Creates and displays an undecorated, centered splash screen containing the component provided by createContentPane(). If this instance has been provided with a MessageSource, it will be used to retrieve the splash screen's frame title under the key "splash.title".

Specified by:
splash in interface SplashScreen

createContentPane

protected abstract Component createContentPane()
Returns the component to be displayed in the splash screen's main frame. If the returned value is null the frame for the splash screen will still be created but will not have any content

Returns:
The content pane component. Can be null.

isShadowBorder

public boolean isShadowBorder()
Returns whether the splash screen will be rendered with a shadow border. The shadow border will let the background show through.

Returns:
whether to show a shadow border or not

setShadowBorder

public void setShadowBorder(boolean shadowBorder)
Sets whether the splash screen will be rendered with a shadow border. If true a border will be shown.

Parameters:
shadowBorder - Show the shadow border or not

setRootFrame

public void setRootFrame(boolean rootFrame)
The frame that is used to display this splashscreen can be used as rootFrame for other dialogs/windows that need a Frame before the applicationFrame is created. (eg login).

Parameters:
rootFrame - true if the created frame must be set as rootFrame. Defaults to true.
See Also:
JOptionPane.setRootFrame(java.awt.Frame)

isRootFrame

public boolean isRootFrame()
Returns:
true if the created frame must be set as rootFrame.


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.