forked from External/mage
* Some minor changes to sleep command (fixes #2992).
This commit is contained in:
parent
4c35650b2b
commit
5a072ea760
12 changed files with 133 additions and 140 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue