public final class UIUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static javax.swing.Icon |
createColorIcon(int width,
int height,
java.awt.Color color)
Create icon of given size and color.
|
static java.awt.image.IndexColorModel |
createIndexColorModel(java.util.List<java.awt.Color> colors)
Create index color model from a list of colors.
|
static void |
error(java.lang.String msg)
Show error message and abort macro execution.
|
static ij.ImagePlus |
getImage()
Return image in currently selected ImageJ window, or
null is no image window is selected. |
static java.awt.Image |
getImageJIconImage()
Returns icon used by ImageJ main frame.
|
public static javax.swing.Icon createColorIcon(int width, int height, java.awt.Color color)
width
- width.height
- height.color
- color.public static ij.ImagePlus getImage()
null
is no image window is selected.null
.public static java.awt.Image getImageJIconImage()
null
if main frame is not instantiated or has no icon.null
.public static void error(java.lang.String msg)
msg
- error message.public static java.awt.image.IndexColorModel createIndexColorModel(java.util.List<java.awt.Color> colors)
colors
- list of colors.