summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/transition/TransitionCallbackThread.java
blob: 50eacc2015d63abea1ca95726c80fd9804fd87d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fourisland.fourpuzzle.transition;

import com.fourisland.fourpuzzle.Display;

/**
 *
 * @author hatkirby
 */
public class TransitionCallbackThread implements Runnable {
    
    private Runnable callback;
    public TransitionCallbackThread(Runnable callback)
    {
        this.callback = callback;
    }

    public void run()
    {
        while (Display.getTransition().isRunning())
        {
            try {
                Thread.sleep(300);
            } catch (InterruptedException ex) {
                Thread.currentThread().interrupt();
            }
        }
        
        //Display.setEnabled(false);

        callback.run();
    }

}