[Ejtools-cvs] CVS: applications/deployment/src/main/net/sourceforge/ejtools/deploy SplashWindow.java
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-21 18:50:03
|
Update of /cvsroot/ejtools/applications/deployment/src/main/net/sourceforge/ejtools/deploy In directory usw-pr-cvs1:/tmp/cvs-serv19537/src/main/net/sourceforge/ejtools/deploy Added Files: SplashWindow.java Log Message: Initial Import --- NEW FILE: SplashWindow.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.deploy; // Standard Imports import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.JWindow; import javax.swing.SwingUtilities; /** * Description of the Class * * @author letiembl * @created 2 novembre 2001 * @todo Javadoc to complete */ public class SplashWindow extends JWindow { /** Description of the Field */ protected JPanel panel = null; /** Description of the Field */ protected JLabel message = null; /** Description of the Field */ protected JProgressBar progressBar = null; /** Description of the Field */ protected int length = 0; /** *Constructor for the SplashWindow object * * @param message Description of Parameter * @param length Description of Parameter */ public SplashWindow(String message, int length) { this.length = length; this.message = new JLabel(message); this.createPanel(); this.setContentPane(panel); this.pack(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation(screen.width / 2 - this.getSize().width / 2, screen.height / 2 - this.getSize().height / 2); } /** * Description of the Method * * @param message Description of Parameter */ public void progress(String message) { this.message.setText(message); int value = this.progressBar.getValue(); value++; this.progressBar.setValue(value); SwingUtilities.invokeLater( new Runnable() { public void run() { repaint(); } }); } /** Description of the Method */ protected void createPanel() { panel = new JPanel(new BorderLayout()); // North part panel.add("North", new JLabel(new ImageIcon(getClass().getResource("/images/logo.png")))); // Center part panel.add("Center", message); // South part progressBar = new JProgressBar(0, this.length); progressBar.setValue(0); progressBar.setStringPainted(false); progressBar.setBorderPainted(false); panel.add("South", progressBar); } } |