// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov  Date: 08/10/2012 8:47:28
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   CerrandoAplicacion.java

package project;

import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.*;
import javax.swing.text.JTextComponent;
import repeat.PanelOpciones;
import traduccion.Traducir;

// Referenced classes of package project:
//            BarraDeProgresoCerrando, ThreadBarraDeProgreso, AccederADatos

public class CerrandoAplicacion extends JOptionPane
{

    public CerrandoAplicacion()
        throws HeadlessException
    {
        fuenteMensaje = new Font("Arial", 1, 10);
        areaDeTexto = new JTextArea();
        panelBarraDeProgreso = new JPanel();
        bdp = new BarraDeProgresoCerrando();
        super.message = null;
        setLayout(new BorderLayout());
        setBackground(Color.white);
        panelBarraDeProgreso.setLayout(new FlowLayout());
        panelBarraDeProgreso.add(bdp);
        panelBarraDeProgreso.setOpaque(false);
        areaDeTexto.setOpaque(true);
        areaDeTexto.setEditable(false);
        areaDeTexto.setLineWrap(true);
        areaDeTexto.setWrapStyleWord(true);
        areaDeTexto.setFont(fuenteMensaje);
        areaDeTexto.setForeground(new Color(66, 82, 148));
        areaDeTexto.setBackground(Color.white);
        scroll = new JScrollPane(areaDeTexto);
        scroll.setHorizontalScrollBarPolicy(31);
        scroll.setVerticalScrollBarPolicy(20);
        add(scroll, "Center");
    }

    public void mensaje(boolean salir2, String mensaje)
    {
        areaDeTexto.setText(mensaje);
        dialog = createDialog(AccederADatos.frameActivo, Traducir.getTraduccion(AccederADatos.leer("h.proyecto"), "project.CerrandoAplicacion", "200411171447", AccederADatos.idioma));
        dialog.setDefaultCloseOperation(0);
        dialog.getContentPane().setBackground(Color.white);
        dialog.getContentPane().setLayout(new BorderLayout());
        dialog.getContentPane().add(panelBarraDeProgreso, "South");
        dialog.setSize(new Dimension(dialog.getSize().width, dialog.getSize().height + 35));
        dialog.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width - dialog.getSize().width) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - dialog.getSize().height) / 2);
        bdp.longitud(15);
        ThreadBarraDeProgreso tbdp = new ThreadBarraDeProgreso();
        tbdp.empezar(bdp);
        dialog.show();
        dialog.dispose();
    }

    public JDialog createDialog(Component parentComponent, String title)
        throws HeadlessException
    {
        int style = 64;
        JDialog dialog = new JDialog(AccederADatos.frameActivo, title, true);
        Container contentPane = dialog.getContentPane();
        contentPane.setLayout(new BorderLayout());
        contentPane.add(this, "Center");
        dialog.setResizable(false);
        if(JDialog.isDefaultLookAndFeelDecorated())
        {
            boolean supportsWindowDecorations = UIManager.getLookAndFeel().getSupportsWindowDecorations();
            if(supportsWindowDecorations)
            {
                dialog.setUndecorated(true);
                getRootPane().setWindowDecorationStyle(style);
            }
        }
        dialog.pack();
        dialog.setLocationRelativeTo(parentComponent);
        dialog.addComponentListener(new ComponentAdapter() {

            public void componentShown(ComponentEvent ce)
            {
                setValue(JOptionPane.UNINITIALIZED_VALUE);
            }

        }
);
        return dialog;
    }

    PanelOpciones panelOpciones;
    private Font fuenteMensaje;
    private JTextArea areaDeTexto;
    private JScrollPane scroll;
    private JPanel panelBarraDeProgreso;
    public BarraDeProgresoCerrando bdp;
    private JDialog dialog;
}