KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > gui > SplashDialog


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * SplashDialog.java
28  *
29  * Created on 9 ottobre 2004, 11.19
30  *
31  */

32
33 package it.businesslogic.ireport.gui;
34 import javax.swing.SwingUtilities JavaDoc;
35
36 /**
37  *
38  * @author Administrator
39  */

40 public class SplashDialog extends javax.swing.JDialog JavaDoc {
41     
42     /** Creates new form SplashDialog */
43     public SplashDialog(java.awt.Frame JavaDoc parent, boolean modal) {
44         super(parent, modal);
45         initComponents();
46         if (new java.util.Date JavaDoc().getTime() %2 == 0)
47         {
48             jLabel1.setIcon(new javax.swing.ImageIcon JavaDoc(getClass().getResource("/it/businesslogic/ireport/icons/logo13b.png")));
49             jLabel1.setIconTextGap(0);
50         }
51         applyI18n();
52         //this.setSize(320,261);
53
this.pack();
54         it.businesslogic.ireport.util.Misc.centerFrame(this);
55     }
56     
57     public void updateLoadingStatus(int status, String JavaDoc label)
58     {
59         try {
60             
61             final int f_status = status;
62             final String JavaDoc f_label = label;
63             final Runnable JavaDoc r = new Runnable JavaDoc() {
64                     public void run() {
65                         jProgressBar1.setValue(f_status);
66                         if (f_label != null)
67                             jProgressBar1.setString(f_label);
68                         }
69             };
70       
71             if (SwingUtilities.isEventDispatchThread())
72             {
73                 SwingUtilities.invokeLater(r);
74             }
75             else
76             {
77                 SwingUtilities.invokeAndWait(r);
78             }
79             
80         } catch (Exception JavaDoc ex)
81         {
82             ex.printStackTrace();
83         }
84     }
85     
86   
87     
88     /** This method is called from within the constructor to
89      * initialize the form.
90      * WARNING: Do NOT modify this code. The content of this method is
91      * always regenerated by the Form Editor.
92      */

93     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
94
private void initComponents() {
95         jPanel1 = new javax.swing.JPanel JavaDoc();
96         jLabel1 = new javax.swing.JLabel JavaDoc();
97         jProgressBar1 = new javax.swing.JProgressBar JavaDoc();
98
99         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
100         setResizable(false);
101         setUndecorated(true);
102         jPanel1.setLayout(new java.awt.BorderLayout JavaDoc());
103
104         jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color JavaDoc(0, 0, 0)));
105         jLabel1.setIcon(new javax.swing.ImageIcon JavaDoc(getClass().getResource("/it/businesslogic/ireport/icons/logo13a.png")));
106         jLabel1.setIconTextGap(0);
107         jPanel1.add(jLabel1, java.awt.BorderLayout.CENTER);
108
109         jProgressBar1.setMinimumSize(new java.awt.Dimension JavaDoc(10, 21));
110         jProgressBar1.setPreferredSize(new java.awt.Dimension JavaDoc(148, 21));
111         jProgressBar1.setString("Loading");
112         jProgressBar1.setStringPainted(true);
113         jPanel1.add(jProgressBar1, java.awt.BorderLayout.SOUTH);
114
115         getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
116
117         pack();
118     }// </editor-fold>//GEN-END:initComponents
119

120     // Variables declaration - do not modify//GEN-BEGIN:variables
121
private javax.swing.JLabel JavaDoc jLabel1;
122     private javax.swing.JPanel JavaDoc jPanel1;
123     private javax.swing.JProgressBar JavaDoc jProgressBar1;
124     // End of variables declaration//GEN-END:variables
125

126     public void applyI18n(){
127                 // Start autogenerated code ----------------------
128
// End autogenerated code ----------------------
129
}
130 }
131
Popular Tags