Visual Color Imbalance Detector: Reconstructed project directories and files
[VistaCID.git] / org / tjworld / vista / CID / splash.java
1 /*
2         * splash.java
3  *
4         * Created on 08 November 2001, 18:23
5         * $header: $
6         *
7         * $history: $
8  */
9
10 package org.tjworld.vista.cid;
11
12 import java.awt.Dimension;
13 import java.awt.Point;
14 import java.awt.Color;
15 import java.awt.Toolkit;
16 import javax.swing.UIManager;
17 /**
18  *
19         * @author  TJ
20  */
21 public class splash extends javax.swing.JFrame {
22         /** Locale-specific data container */
23         private java.util.ResourceBundle cIDresources;
24
25  public splash() {
26          this(null, null);
27         }
28         
29         /** Creates new form splash */
30  public splash(javax.swing.JFrame owner, java.util.ResourceBundle res) {
31                 if(UIManager.getLookAndFeel().getSupportsWindowDecorations())
32          setUndecorated(true);
33                 if(res == null)
34                  cIDresources = java.util.ResourceBundle.getBundle("org.tjworld.vista.cid.CIDresources", java.util.Locale.getDefault());
35                 else
36                         cIDresources = res;
37
38   initComponents();
39                 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
40                 Dimension childSize = getSize();
41                 setLocation(new Point(screenSize.width/2 - childSize.width/2, screenSize.height/2 - childSize.height/2));
42                 getContentPane().setBackground(Color.white);
43  }
44
45     /** This method is called from within the constructor to
46      * initialize the form.
47      * WARNING: Do NOT modify this code. The content of this method is
48      * always regenerated by the Form Editor.
49      */
50         private void initComponents() {//GEN-BEGIN:initComponents
51                 message = new javax.swing.JLabel();
52                 progress = new javax.swing.JProgressBar();
53                 
54                 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
55                 setTitle("VisTA.CID");
56                 setBackground(java.awt.Color.white);
57                 setName("splash");
58                 setResizable(false);
59                 addWindowListener(new java.awt.event.WindowAdapter() {
60                         public void windowClosing(java.awt.event.WindowEvent evt) {
61                                 exitForm(evt);
62                         }
63                 });
64                 
65                 message.setForeground(java.awt.Color.red);
66                 message.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/tjworld/vista/cid/media/vistaAnimation.gif")));
67                 message.setText(cIDresources.getString("tLoading"));
68                 getContentPane().add(message, java.awt.BorderLayout.CENTER);
69                 
70                 progress.setBorderPainted(false);
71                 progress.setIndeterminate(true);
72                 progress.setOpaque(false);
73                 getContentPane().add(progress, java.awt.BorderLayout.SOUTH);
74                 
75                 pack();
76         }//GEN-END:initComponents
77
78  /** Exit the Application */
79     private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
80      System.exit(0);
81     }//GEN-LAST:event_exitForm
82
83  /**
84   * @param args the command line arguments
85   */
86  public static void main(String args[]) {
87                 new splash().show();
88  }
89
90         // Variables declaration - do not modify//GEN-BEGIN:variables
91         private javax.swing.JLabel message;
92         private javax.swing.JProgressBar progress;
93         // End of variables declaration//GEN-END:variables
94 }