games.strategy.ui
Class Util
java.lang.Object
games.strategy.ui.Util
public class Util
- extends java.lang.Object
- Version:
- 1.0
- Author:
- Sean Bridges
|
Nested Class Summary |
static interface |
Util.Task<T>
|
|
Method Summary |
static void |
center(java.awt.Window w)
|
static java.awt.Image |
copyImage(java.awt.image.BufferedImage img,
boolean needAlpha)
|
static java.awt.image.BufferedImage |
createImage(int width,
int height,
boolean needAlpha)
Previously used to use TYPE_INT_BGR and TYPE_INT_ABGR but caused memory
problems. |
static void |
ensureImageLoaded(java.awt.Image anImage)
|
static java.awt.Image |
getBanner(java.lang.String text)
|
static java.awt.Dimension |
getDimension(java.awt.Image anImage,
java.awt.image.ImageObserver obs)
|
static void |
notifyError(java.awt.Component parent,
java.lang.String message)
|
static void |
runInSwingEventThread(java.lang.Runnable r)
|
static
|
runInSwingEventThread(Util.Task<T> task)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
runInSwingEventThread
public static void runInSwingEventThread(java.lang.Runnable r)
runInSwingEventThread
public static <T> T runInSwingEventThread(Util.Task<T> task)
ensureImageLoaded
public static void ensureImageLoaded(java.awt.Image anImage)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
copyImage
public static java.awt.Image copyImage(java.awt.image.BufferedImage img,
boolean needAlpha)
notifyError
public static void notifyError(java.awt.Component parent,
java.lang.String message)
createImage
public static java.awt.image.BufferedImage createImage(int width,
int height,
boolean needAlpha)
- Previously used to use TYPE_INT_BGR and TYPE_INT_ABGR but caused memory
problems. Fix is to use 3Byte rather than INT.
getDimension
public static java.awt.Dimension getDimension(java.awt.Image anImage,
java.awt.image.ImageObserver obs)
center
public static void center(java.awt.Window w)
getBanner
public static java.awt.Image getBanner(java.lang.String text)