Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/splash
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293/src/net/sourceforge/bprocessor/gui/splash
Added Files:
package.html SplashWindow.java
Log Message:
Delays showing the GUI window until the GLView is done with initialisation.
Displays a SplashWindow on startup, that are removed when the GUI window is displayed.
--- NEW FILE: SplashWindow.java ---
//---------------------------------------------------------------------------------
// $Id: SplashWindow.java,v 1.1 2005/10/21 08:42:47 henryml Exp $
//
// Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net)
// Released under the Lesser GNU Public License v2.1
//---------------------------------------------------------------------------------
package net.sourceforge.bprocessor.gui.splash;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Toolkit;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JWindow;
/**
* The SplashWindow
*/
public class SplashWindow extends JWindow {
/**
* Constructor for the SplashWindow
* Display a splash window
* @param iconname The image to show
* @param f The owning frame (null is accepted)
*/
public SplashWindow(String iconname, Frame f) {
super(f);
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource(iconname);
JLabel l = new JLabel(new ImageIcon(url));
getContentPane().add(l, BorderLayout.CENTER);
pack();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension labelSize = l.getPreferredSize();
setLocation(screenSize.width / 2 - (labelSize.width / 2), screenSize.height
/ 2 - (labelSize.height / 2));
setVisible(true);
screenSize = null;
labelSize = null;
}
}
--- NEW FILE: package.html ---
<body>
Define the package which creates the Splash Window.
</body>
|