/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* NeembuuUploaderSplashScreen.java
*
* Created on Aug 24, 2011, 6:21:49 PM
*/
package deprecated;
import neembuu.uploader.translation.Translation;
import neembuu.uploader.utils.NULogger;
/** This class can be used to display a splash screen at startup and exit
*
* @author vigneshwaran
*/
public class NeembuuUploaderSplashScreen extends javax.swing.JFrame {
//Singleton instance
private static NeembuuUploaderSplashScreen INSTANCE = new NeembuuUploaderSplashScreen();
/** Creates new form NeembuuUploaderSplashScreen */
private NeembuuUploaderSplashScreen() {
//First initialize all the components..
initComponents();
//Log the user selected language
NULogger.getLogger().info(Translation.T().languageDisplayName());
//set the message in local language
message.setText(Translation.T().message());
//Display the splash screen at the center of screen. :)
setLocationRelativeTo(null);
}
/**
* Use this method to get singleton instance of the splash screen. Call setVisible(true) after this.
* @return
*/
public static NeembuuUploaderSplashScreen getInstance() {
NULogger.getLogger().info("Displaying SplashScreen..");
return INSTANCE;
}
/**
* Set the locale specific message to replace the startup message.
* @param text
* @return
*/
public static NeembuuUploaderSplashScreen setMessage(String text) {
//set the text..
message.setText(text);
//.. and pack for the new size
INSTANCE.pack();
return INSTANCE;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
message = new javax.swing.JLabel();
jProgressBar1 = new javax.swing.JProgressBar();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setAlwaysOnTop(true);
setResizable(false);
setUndecorated(true);
message.setText("NeembuuUploader Loading...");
jProgressBar1.setIndeterminate(true);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(message, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE)
.addComponent(jProgressBar1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(message)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JProgressBar jProgressBar1;
private static javax.swing.JLabel message;
// End of variables declaration//GEN-END:variables
}