public final class UIUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UIUtils.TextPosition |
| Constructor and Description |
|---|
UIUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
drawString(Graphics g,
UIUtils.TextPosition textPosition,
int line,
String text) |
static Font |
getFont(String key) |
static boolean |
getUIBoolean(String key,
boolean defaultValue)
Get boolean property with the specified
key from the swing UIManager. |
static double |
getUIScaleFactor(Object key)
Get an approximate UI scaling factor.
|
static void |
installFlatLafInfos() |
static boolean |
isDark(String key)
Tell if the LAF color specified for the provided key is darker than 50%
gray.
|
static Color |
mix(Color c1,
Color c2,
double c1Weight)
Mix colors
c1 and c2 by ratios c1Weight and (1-c1Weight), respectively. |
static void |
resetPropertyCaches()
Resets the caches for
getUIScaleFactor(java.lang.Object). |
static void |
setMinimumHeight(Component component,
int minimumHeight)
Set the minimum height of a component (leaving the minimum width untouched).
|
static void |
setMinimumWidth(Component component,
int minimumWidth)
Set the minimum width of a component (leaving the minimum height untouched).
|
static void |
setPreferredHeight(Component component,
int preferredHeight)
Set the preferred height of a component (leaving the preferred width untouched).
|
static void |
setPreferredWidth(Component component,
int preferredWidth)
Set the preferred width of a component (leaving the preferred height untouched).
|
public static Color mix(Color c1, Color c2, double c1Weight)
c1 and c2 by ratios c1Weight and (1-c1Weight), respectively.public static void setPreferredWidth(Component component, int preferredWidth)
public static void setPreferredHeight(Component component, int preferredHeight)
public static void setMinimumWidth(Component component, int minimumWidth)
public static void setMinimumHeight(Component component, int minimumHeight)
public static void drawString(Graphics g, UIUtils.TextPosition textPosition, int line, String text)
public static double getUIScaleFactor(Object key)
public static void resetPropertyCaches()
getUIScaleFactor(java.lang.Object).public static boolean isDark(String key)
public static boolean getUIBoolean(String key, boolean defaultValue)
key from the swing UIManager.
If the property is not set, return defaultValue instead.public static void installFlatLafInfos()
Copyright © 2012–2024 BigDataViewer. All rights reserved.