Class ScalingUtil


  • public final class ScalingUtil
    extends Object
    Helper class for scaling calculations.
    Since:
    2.0
    • Method Detail

      • zoomIn

        public static void zoomIn​(NatTable natTable,
                                  Consumer<IConfigRegistry> registryUpdater)
        Performs a ConfigureScalingCommand to increase the scaling to "zoom in" a NatTable.
        Parameters:
        natTable - The NatTable instance on which the zoom in operation should be performed.
        registryUpdater - Callback to trigger registry updates. Needed to re-register image cell painters for example.
      • zoomOut

        public static void zoomOut​(NatTable natTable,
                                   Consumer<IConfigRegistry> registryUpdater)
        Performs a ConfigureScalingCommand to decrease the scaling to "zoom out" a NatTable.
        Parameters:
        natTable - The NatTable instance on which the zoom in operation should be performed.
        registryUpdater - Callback to trigger registry updates. Needed to re-register image cell painters for example.
      • getNewZoomOutDPI

        public static int getNewZoomOutDPI​(int currentDPI)
        Get the new DPI value for zoom out based on the given DPI value. The minimum value is 12.
        Parameters:
        currentDPI - The current active DPI value.
        Returns:
        The new DPI value for zooming out.
      • getNewZoomInDPI

        public static int getNewZoomInDPI​(int currentDPI)
        Get the new DPI value for zoom in based on the given DPI value. The maximum value is 288.
        Parameters:
        currentDPI - The current active DPI value.
        Returns:
        The new DPI value for zooming in.