* Some minor changes to sleep command (fixes #2992).

This commit is contained in:
LevelX2 2017-04-02 11:32:25 +02:00
parent 4c35650b2b
commit 5a072ea760
12 changed files with 133 additions and 140 deletions

View file

@ -3,6 +3,7 @@ package mage.client.util.gui;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.util.concurrent.TimeUnit;
/**
* Utility class for creating BufferedImage object from Image instance.
@ -65,7 +66,7 @@ public class BufferedImageBuilder {
});
while (!imageLoadStatus.widthDone && !imageLoadStatus.heightDone) {
try {
Thread.sleep(300);
TimeUnit.MILLISECONDS.sleep(300);
} catch (InterruptedException e) {
}
@ -73,8 +74,9 @@ public class BufferedImageBuilder {
}
static class ImageLoadStatus {
public boolean widthDone = false;
public boolean heightDone = false;
}
}
}