// 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:   cargandoTest.java

package project;

import java.awt.Dimension;
import java.awt.Frame;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.util.Locale;
import javax.swing.AbstractButton;
import traduccion.Traducir;

// Referenced classes of package project:
//            VentanaDelTest, AccederADatos

public class cargandoTest
    implements Runnable
{

    public cargandoTest(VentanaDelTest ventanaDelTest2)
    {
        finalizado = 0;
        secs2 = 0L;
        clockThread = null;
        zero = 0L;
        contador = 0;
        dateFormatter = DateFormat.getTimeInstance();
        formatter = new DecimalFormat("00");
        isTimer = false;
        ventanaDelTest = ventanaDelTest2;
        dim = ventanaDelTest.dim;
        if(clockThread == null)
        {
            clockThread = new Thread(this, "Crono");
            clockThread.start();
        }
    }

    public void setZeroNow()
    {
        zero = System.currentTimeMillis();
        dateFormatter = DateFormat.getTimeInstance(2, Locale.UK);
        isTimer = true;
    }

    public void run()
    {
        for(Thread myThread = Thread.currentThread(); clockThread == myThread && finalizado == 0;)
        {
            time = System.currentTimeMillis() - zero;
            secs = (time / 1000L) % 60L;
            if(contador < dim.height)
            {
                ventanaDelTest.mover(contador);
                contador = contador + 40;
            } else
            {
                finalizado = 1;
                ventanaDelTest.alPrincipio();
                ventanaDelTest.setTitle(Traducir.getTraduccion(AccederADatos.leer("h.proyecto"), "project.cargandoTest", "200411161820", AccederADatos.idioma));
                ventanaDelTest.enviar.setEnabled(true);
            }
            try
            {
                Thread.sleep(10L);
            }
            catch(InterruptedException e)
            {
                e.printStackTrace();
            }
        }

    }

    protected void finalize()
        throws Throwable
    {
        clockThread = null;
        super.finalize();
    }

    int finalizado;
    long secs2;
    long time;
    long secs;
    private Thread clockThread;
    private long zero;
    Dimension dim;
    VentanaDelTest ventanaDelTest;
    int contador;
    DateFormat dateFormatter;
    DecimalFormat formatter;
    private boolean isTimer;
}