public final class JBUIScale
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static LazyInitializer.NullableValue<java.lang.Float> |
DEBUG_USER_SCALE_FACTOR |
static float |
DEF_SYSTEM_FONT_SIZE |
static boolean |
SCALE_VERBOSE |
static java.lang.String |
USER_SCALE_FACTOR_PROPERTY |
Modifier and Type | Method and Description |
---|---|
static void |
addUserScaleChangeListener(java.beans.PropertyChangeListener listener) |
static float |
getFontScale(float fontSize) |
static Pair<java.lang.String,java.lang.Integer> |
getSystemFontData() |
static boolean |
isHiDPI(double scale)
Returns whether the provided scale assumes HiDPI-awareness.
|
static boolean |
isUsrHiDPI()
Returns whether the
ScaleType.USR_SCALE scale factor assumes HiDPI-awareness. |
static void |
removeUserScaleChangeListener(java.beans.PropertyChangeListener listener) |
static float |
scale(float f) |
static int |
scale(int i) |
static int |
scaleFontSize(float fontSize) |
static <T extends JBScalableIcon> |
scaleIcon(T icon)
Scales the passed
icon according to the user scale factor. |
static void |
setSystemScaleFactor(float sysScale) |
static float |
setUserScaleFactor(float scale)
Sets the user scale factor.
|
static void |
setUserScaleFactorForTest(float value) |
static float |
sysScale()
Returns the system scale factor, corresponding to the default monitor device.
|
static float |
sysScale(java.awt.Component comp)
Returns the system scale factor, corresponding to the device the component is tied to.
|
static float |
sysScale(java.awt.Graphics2D g)
Returns the system scale factor, corresponding to the graphics.
|
static float |
sysScale(java.awt.GraphicsConfiguration gc)
Returns the system scale factor, corresponding to the graphics configuration.
|
static double |
sysScale(ScaleContext context) |
public static final boolean SCALE_VERBOSE
public static final java.lang.String USER_SCALE_FACTOR_PROPERTY
public static float DEF_SYSTEM_FONT_SIZE
public static final LazyInitializer.NullableValue<java.lang.Float> DEBUG_USER_SCALE_FACTOR
public static void addUserScaleChangeListener(java.beans.PropertyChangeListener listener)
public static void removeUserScaleChangeListener(java.beans.PropertyChangeListener listener)
public static void setSystemScaleFactor(float sysScale)
public static void setUserScaleFactorForTest(float value)
public static float getFontScale(float fontSize)
fontSize
relative to the standard font size (currently 12pt)public static float setUserScaleFactor(float scale)
public static float sysScale()
public static float sysScale(java.awt.Component comp)
sysScale()
public static float sysScale(java.awt.GraphicsConfiguration gc)
sysScale()
public static float scale(float f)
public static int scale(int i)
public static <T extends JBScalableIcon> T scaleIcon(T icon)
icon
according to the user scale factor.ScaleType.USR_SCALE
public static int scaleFontSize(float fontSize)
public static Pair<java.lang.String,java.lang.Integer> getSystemFontData()
public static float sysScale(java.awt.Graphics2D g)
sysScale()
public static double sysScale(ScaleContext context)
public static boolean isHiDPI(double scale)
public static boolean isUsrHiDPI()
ScaleType.USR_SCALE
scale factor assumes HiDPI-awareness.
An equivalent of isHiDPI(scale(1f))