Class DpiUtil


  • public class DpiUtil
    extends Object
    Represents a display scaling methods.
    • Field Detail

      • DPI_DEFAULT

        public static final int DPI_DEFAULT
        The default DPI for current OS.
      • DPI_CURRENT

        public static final int DPI_CURRENT
        The current DPI.
      • DPI_SCALE

        public static final float DPI_SCALE
        The scale value.
    • Method Detail

      • adapt

        public static int adapt​(int size)
        Adapts the specified size on display scale.
        Parameters:
        size - the size.
        Returns:
        new size.
      • adapt

        public static org.eclipse.swt.graphics.Point adapt​(org.eclipse.swt.graphics.Point point)
        Adapts the point on display scale.
        Parameters:
        size - the point, can not be null.
        Returns:
        new point.