/* *Copyright 2007, 2011 CCLS Columbia University (USA), LIFO University of Orl��ans (France), BRGM (France) * *Authors: Cyril Nortet, Xiangrong Kong, Ansaf Salleb-Aouissi, Christel Vrain, Daniel Cassard * *This file is part of QuantMiner. * *QuantMiner is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. * *QuantMiner is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * *You should have received a copy of the GNU General Public License along with QuantMiner. If not, see <http://www.gnu.org/licenses/>. */ package src.graphicalInterface; import java.awt.*; import java.awt.event.*; import javax.swing.*; import src.tools.*; public class DialogEndComputeRules extends javax.swing.JDialog { //the dialog of computation is done private Timer m_timerSonnerie = null; /** Creates new form DialogFinCalculRegles */ public DialogEndComputeRules(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); // Cr�ation d'un timer pour r�it�rer r�guli�rement l'effet sonore : ActionListener tacheProgrammee = new ActionListener() { public void actionPerformed(ActionEvent evt) { ToolsInterface.JouerSon(ENV.CHEMIN_FICHIER_SON_FIN_CALCUL); } }; ToolsInterface.JouerSon(ENV.CHEMIN_FICHIER_SON_FIN_CALCUL); m_timerSonnerie = new Timer(2500, tacheProgrammee); //play sound for 2500 micro-seconds m_timerSonnerie.start(); m_timerSonnerie.stop(); jButtonFermer.requestFocus(); setLocationRelativeTo(null); } /** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jPanelPrincipal = new javax.swing.JPanel(); jLabelCalculEffectue = new javax.swing.JLabel(); jButtonFermer = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(""); setModal(true); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); jPanelPrincipal.setLayout(null); jPanelPrincipal.setPreferredSize(new java.awt.Dimension(270, 110)); jLabelCalculEffectue.setFont(new java.awt.Font("Dialog", 3, 15)); jLabelCalculEffectue.setText("Computation of Rules done!"); jPanelPrincipal.add(jLabelCalculEffectue); jLabelCalculEffectue.setBounds(30, 20, 320, 30); jButtonFermer.setText("Close"); jButtonFermer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonFermerActionPerformed(evt); } }); jPanelPrincipal.add(jButtonFermer); jButtonFermer.setBounds(90, 70, 100, 25); getContentPane().add(jPanelPrincipal, java.awt.BorderLayout.CENTER); pack(); }// </editor-fold>//GEN-END:initComponents private void jButtonFermerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFermerActionPerformed FermerDialog(); }//GEN-LAST:event_jButtonFermerActionPerformed /** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog FermerDialog(); }//GEN-LAST:event_closeDialog private void FermerDialog() { m_timerSonnerie.stop(); m_timerSonnerie = null; setVisible(false); dispose(); } /** * @param args the command line arguments */ @SuppressWarnings("deprecation") public static void main(String args[]) { new DialogEndComputeRules(new javax.swing.JFrame(), true).show(); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonFermer; private javax.swing.JLabel jLabelCalculEffectue; private javax.swing.JPanel jPanelPrincipal; // End of variables declaration//GEN-END:variables }