info.jonclark.gui
Class SplashImage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by javax.swing.JWindow
                  extended by info.jonclark.gui.SplashImage
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class SplashImage
extends JWindow

A class to make a very nice splash screen, very quickly. Note: Don't use transparency and shadow together and expect it to look good.

See Also:
Serialized Form

Field Summary
 
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
SplashImage(BufferedImage image, boolean addShadow, boolean honorTransparency)
          Constructs a new SplashImage object
 
Method Summary
static void main(String[] args)
          A main method, for demonstration purposes.
 void paint(Graphics g)
          Paints the image on the screen.
static void showSplashImage(BufferedImage image, boolean addShadow, boolean honorTransparency, int msToDisplay)
          Show an image on the screen in the style of a splash screen(with no border or decorations) for a given amount of time.
static void showSplashImage(InputStream imageStream, boolean addShadow, boolean honorTransparency, int msToDisplay)
          Show an image on the screen in the style of a splash screen(with no border or decorations) for a given amount of time.
 
Methods inherited from class javax.swing.JWindow
getAccessibleContext, getContentPane, getGlassPane, getLayeredPane, getRootPane, remove, setContentPane, setGlassPane, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplashImage

public SplashImage(BufferedImage image,
                   boolean addShadow,
                   boolean honorTransparency)
Constructs a new SplashImage object

Parameters:
image -
addShadow -
Method Detail

showSplashImage

public static void showSplashImage(InputStream imageStream,
                                   boolean addShadow,
                                   boolean honorTransparency,
                                   int msToDisplay)
                            throws IOException
Show an image on the screen in the style of a splash screen(with no border or decorations) for a given amount of time.

Parameters:
imageStream - The image input stream (such as a FileInputStream)
addShadow - Should we add a shadow to the splash screen?
honorTransparency - Leave transparency from GIF or PNG file in-tact?
msToDisplay - The number of milliseconds this image will display before disappearing
Throws:
IOException

showSplashImage

public static void showSplashImage(BufferedImage image,
                                   boolean addShadow,
                                   boolean honorTransparency,
                                   int msToDisplay)
                            throws IOException
Show an image on the screen in the style of a splash screen(with no border or decorations) for a given amount of time.

Parameters:
image - The buffered image that will be displayed
addShadow - Should we add a shadow to the splash screen?
honorTransparency - Leave transparency from GIF or PNG file in-tact?
msToDisplay - The number of milliseconds this image will display before disappearing
Throws:
IOException

paint

public void paint(Graphics g)
Paints the image on the screen. This is called internally by the Java framework.

Overrides:
paint in class Container

main

public static void main(String[] args)
                 throws Exception
A main method, for demonstration purposes.

Parameters:
args -
Throws:
Exception