@OpenApiAll
public class HiDPIScaleUtilities
extends java.lang.Object
RetinaUtilities
should be used.
Scaling factor is calculated using Toolkit.getScreenResolution()
value.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HI_DPI_SCALED |
Constructor and Description |
---|
HiDPIScaleUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
addHiDPIScaledProperty(java.awt.Component component)
Mark this component as HiDPI scaled
|
static ResizableIcon |
getNonScaledIcon(ResizableIcon icon,
int size,
double maxScale)
Return icon scaled down to a given size.
|
static ResizableIcon |
getScaled16x16Icon(ResizableIcon icon)
Return scaled to 16x16 icon for a given icon.
|
static double |
getScalingFactor()
Scaling factor of the system.
|
static boolean |
isScalingFactorDefined() |
static void |
scaleComponent(com.nomagic.ui.HiDPIScalableComponent component)
Scale components and its children preferred size and similar.
|
static float |
scaleFont(float size)
Scale font size.
|
static int |
scaleIcon(int size)
Scale Icon size.
|
static void |
scaleLookAndFeel()
Scale various java Look&Feel settings like fonts, icons sizes, insets and etc.
|
static double |
scaleUI(double size)
Scale User Interface item size.
|
static int |
scaleUI(int size)
Scale User Interface item size.
|
static void |
scaleUIRecursively(java.awt.Component component)
Scale components and its children preferred size and similar.
|
public static final java.lang.String HI_DPI_SCALED
@CheckForNull public static ResizableIcon getScaled16x16Icon(@CheckForNull ResizableIcon icon)
icon
- icon@CheckForNull public static ResizableIcon getNonScaledIcon(@CheckForNull ResizableIcon icon, int size, double maxScale)
icon
- iconSquareIcon.create(ResizableIcon, int, double)
public static int scaleIcon(int size)
size
- sizepublic static double scaleUI(double size)
size
- sizepublic static int scaleUI(int size)
size
- sizepublic static float scaleFont(float size)
size
- sizepublic static double getScalingFactor()
Toolkit.getScreenResolution()
value.public static boolean isScalingFactorDefined()
public static void addHiDPIScaledProperty(java.awt.Component component)
component
- public static void scaleComponent(com.nomagic.ui.HiDPIScalableComponent component)
component
- componentpublic static void scaleUIRecursively(java.awt.Component component)
component
- componentpublic static void scaleLookAndFeel()