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 MouseListener |
createURLMouseListener(JLabel label,
String url,
String text) |
static URL |
getResource(String name,
Class<?> clazz) |
static JEditorPane |
infoDisplay()
Returns an editor pane suitable to display information about a TrackMate
module.
|
static JEditorPane |
infoDisplay(String html) |
static JEditorPane |
infoDisplay(String html,
boolean justify)
Returns an editor pane suitable to display information about a TrackMate
module.
|
static Color |
invert(Color color) |
static void |
positionWindow(Window gui,
Component component)
Positions a JFrame more or less cleverly next a
Component. |
static ImageIcon |
scaleImage(ImageIcon icon,
int w,
int h) |
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 JScrollPane |
textInScrollPanel(JComponent component) |
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)
public static JEditorPane infoDisplay()
JEditorPane.public static JEditorPane infoDisplay(String html)
public static JEditorPane infoDisplay(String html, boolean justify)
html - the text to display.justify - if true the text will be justified.JEditorPane.public static JScrollPane textInScrollPanel(JComponent component)
public static MouseListener createURLMouseListener(JLabel label, String url, String text)
Copyright © 2010–2024 TrackMate. All rights reserved.