public class GuiUtils extends Object
Constructor and Description |
---|
GuiUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addOnClosingEvent(JComponent component,
Runnable runnable) |
static double |
colorDistance(Color a,
Color b)
Distance between two colors.
|
static Color |
invert(Color color) |
static void |
positionWindow(Window gui,
Component component)
Positions a JFrame more or less cleverly next a
Component . |
static void |
selectAllOnFocus(JTextField tf) |
static void |
setSystemLookAndFeel() |
static Color |
textColorForBackground(Color backgroundColor)
Returns the black color or white color depending on the specified
background color, to ensure proper readability of the text on said
background.
|
static float[] |
toCIELab(Color color) |
static void |
userCheckImpDimensions(ij.ImagePlus imp) |
public static final void selectAllOnFocus(JTextField tf)
public static Color textColorForBackground(Color backgroundColor)
backgroundColor
- the background color.public static double colorDistance(Color a, Color b)
Adapted from https://stackoverflow.com/questions/9018016/how-to-compare-two-colors-for-similarity-difference and https://stackoverflow.com/questions/4593469/java-how-to-convert-rgb-color-to-cie-lab
a
- b
- public static final float[] toCIELab(Color color)
public static void positionWindow(Window gui, Component component)
Component
.public static final void userCheckImpDimensions(ij.ImagePlus imp)
public static void setSystemLookAndFeel()
public static void addOnClosingEvent(JComponent component, Runnable runnable)
Copyright © 2015–2021 Fiji. All rights reserved.