You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
230 lines
6.5 KiB
230 lines
6.5 KiB
package de.memtext.widgets; |
|
|
|
import java.awt.Font; |
|
|
|
import javax.swing.JLabel; |
|
import javax.swing.JPanel; |
|
import javax.swing.JProgressBar; |
|
import javax.swing.JWindow; |
|
|
|
import de.memtext.util.FontUtils; |
|
import de.memtext.util.PlafUtils; |
|
import de.memtext.util.WindowUtils; |
|
/** |
|
* This type was generated by a SmartGuide. |
|
* Thanks to IBM Visual Age for Java |
|
*/ |
|
public class SplashScreen extends JWindow { |
|
private String graphicFile; |
|
private JProgressBar progressBar; |
|
private JLabel lbl1; |
|
|
|
class IvjEventHandler implements java.awt.event.WindowListener { |
|
public void windowActivated(java.awt.event.WindowEvent e) { |
|
}; |
|
public void windowClosed(java.awt.event.WindowEvent e) { |
|
}; |
|
public void windowClosing(java.awt.event.WindowEvent e) { |
|
if (e.getSource() == SplashScreen.this) |
|
connEtoC1(e); |
|
}; |
|
public void windowDeactivated(java.awt.event.WindowEvent e) { |
|
}; |
|
public void windowDeiconified(java.awt.event.WindowEvent e) { |
|
}; |
|
public void windowIconified(java.awt.event.WindowEvent e) { |
|
}; |
|
public void windowOpened(java.awt.event.WindowEvent e) { |
|
}; |
|
}; |
|
IvjEventHandler ivjEventHandler = new IvjEventHandler(); |
|
private JLabel ivjJLabel1 = null; |
|
private JPanel ivjJWindowContentPane = null; |
|
/** |
|
* SplashScreen constructor comment. |
|
*/ |
|
public SplashScreen(String graphicFile) { |
|
super(); |
|
this.graphicFile = graphicFile; |
|
WindowUtils.setWaitCursor(this, true); |
|
PlafUtils.setWindowsLook(this); |
|
initialize(); |
|
} |
|
/** |
|
* SplashScreen constructor comment. |
|
* @param owner java.awt.Frame |
|
*/ |
|
/* SplashScreen(Frame owner) { |
|
super(owner); |
|
}*/ |
|
/** |
|
* SplashScreen constructor comment. |
|
* @param owner java.awt.Window |
|
*/ |
|
/* SplashScreen(Window owner) { |
|
super(owner); |
|
}*/ |
|
/** |
|
* connEtoC1: (SplashScreen.window.windowClosing(java.awt.event.WindowEvent) --> SplashScreen.dispose()V) |
|
* @param arg1 java.awt.event.WindowEvent |
|
*/ |
|
/* WARNING: THIS METHOD WILL BE REGENERATED. */ |
|
private void connEtoC1(java.awt.event.WindowEvent arg1) { |
|
try { |
|
// user code begin {1} |
|
// user code end |
|
this.dispose(); |
|
// user code begin {2} |
|
// user code end |
|
} catch (java.lang.Throwable ivjExc) { |
|
// user code begin {3} |
|
// user code end |
|
handleException(ivjExc); |
|
} |
|
} |
|
/** |
|
* Return the JLabel1 property value. |
|
* @return javax.swing.JLabel |
|
*/ |
|
/* WARNING: THIS METHOD WILL BE REGENERATED. */ |
|
private javax.swing.JLabel getJLabel1() { |
|
if (ivjJLabel1 == null) { |
|
try { |
|
ivjJLabel1 = new javax.swing.JLabel(); |
|
ivjJLabel1.setName("JLabel1"); |
|
ivjJLabel1.setIcon( |
|
new javax.swing.ImageIcon( |
|
getClass().getClassLoader().getResource(graphicFile))); |
|
ivjJLabel1.setText(""); |
|
// user code begin {1} |
|
// user code end |
|
} catch (java.lang.Throwable ivjExc) { |
|
// user code begin {2} |
|
// user code end |
|
handleException(ivjExc); |
|
} |
|
} |
|
return ivjJLabel1; |
|
} |
|
/** |
|
* Return the JWindowContentPane property value. |
|
* @return javax.swing.JPanel |
|
*/ |
|
/* WARNING: THIS METHOD WILL BE REGENERATED. */ |
|
private javax.swing.JPanel getJWindowContentPane() { |
|
if (ivjJWindowContentPane == null) { |
|
try { |
|
ivjJWindowContentPane = new javax.swing.JPanel(); |
|
ivjJWindowContentPane.setName("JWindowContentPane"); |
|
ivjJWindowContentPane.setBorder( |
|
new javax.swing.border.EtchedBorder()); |
|
ivjJWindowContentPane.setLayout(new java.awt.BorderLayout()); |
|
getJWindowContentPane().add(getJLabel1(), "Center"); |
|
// user code begin {1} |
|
VerticalBox vbox = new VerticalBox(); |
|
lbl1 = new JLabel(); |
|
lbl1.setVisible(false); |
|
|
|
vbox.addWithCenterAlignment(lbl1); |
|
progressBar = new JProgressBar(); |
|
progressBar.setIndeterminate(true); |
|
progressBar.setVisible(false); |
|
vbox.add(progressBar); |
|
getJWindowContentPane().add(vbox, "South"); |
|
// user code end |
|
} catch (java.lang.Throwable ivjExc) { |
|
// user code begin {2} |
|
// user code end |
|
handleException(ivjExc); |
|
} |
|
} |
|
return ivjJWindowContentPane; |
|
} |
|
/** |
|
* Called whenever the part throws an exception. |
|
* @param exception java.lang.Throwable |
|
*/ |
|
private void handleException(java.lang.Throwable exception) { |
|
|
|
/* Uncomment the following lines to print uncaught exceptions to stdout */ |
|
// System.out.println("--------- UNCAUGHT EXCEPTION ---------"); |
|
// exception.printStackTrace(System.out); |
|
} |
|
/** |
|
* Initializes connections |
|
* @exception java.lang.Exception The exception description. |
|
*/ |
|
/* WARNING: THIS METHOD WILL BE REGENERATED. */ |
|
private void initConnections() throws java.lang.Exception { |
|
// user code begin {1} |
|
// user code end |
|
this.addWindowListener(ivjEventHandler); |
|
} |
|
/** |
|
* Initialize the class. |
|
*/ |
|
/* WARNING: THIS METHOD WILL BE REGENERATED. */ |
|
private void initialize() { |
|
try { |
|
// user code begin {1} |
|
|
|
// user code end |
|
setName("SplashScreen"); |
|
setContentPane(getJWindowContentPane()); |
|
initConnections(); |
|
} catch (java.lang.Throwable ivjExc) { |
|
handleException(ivjExc); |
|
} |
|
// user code begin {2} |
|
this.pack(); |
|
WindowUtils.center(this); |
|
// user code end |
|
} |
|
/** |
|
* main entrypoint - starts the part when it is run as an application |
|
* @param args java.lang.String[] |
|
*/ |
|
public static void main(java.lang.String[] args) { |
|
try { |
|
SplashScreen aSplashScreen; |
|
aSplashScreen = new SplashScreen(""); |
|
aSplashScreen |
|
.addWindowListener(new java.awt.event.WindowAdapter() { |
|
public void windowClosing(java.awt.event.WindowEvent e) { |
|
System.exit(0); |
|
}; |
|
}); |
|
aSplashScreen.show(); |
|
java.awt.Insets insets = aSplashScreen.getInsets(); |
|
aSplashScreen.setSize( |
|
aSplashScreen.getWidth() + insets.left + insets.right, |
|
aSplashScreen.getHeight() + insets.top + insets.bottom); |
|
aSplashScreen.setVisible(true); |
|
} catch (Throwable exception) { |
|
System.err.println( |
|
"Exception occurred in main() of javax.swing.JWindow"); |
|
exception.printStackTrace(System.out); |
|
} |
|
} |
|
|
|
public void setLblText(String txt) { |
|
lbl1.setVisible(true); |
|
lbl1.setFont(new Font("SansSerif",Font.BOLD,13)); |
|
lbl1.setText(txt); |
|
} |
|
public void setProgressBarVisible(boolean visible) |
|
{ |
|
progressBar.setVisible(visible); |
|
} |
|
public void setProgressBarIndeterminate(boolean indeterminate) |
|
{ |
|
progressBar.setIndeterminate(indeterminate); |
|
} |
|
public void setProgressBarText(String txt) { |
|
progressBar.setStringPainted(true); |
|
progressBar.setString(txt); |
|
|
|
} |
|
} |
|
|
|
//Created on 27.02.2004 at 21:30:27
|