Class ScalingUtil
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.ui.scaling.ScalingUtil
-
public final class ScalingUtil extends Object
Helper class for scaling calculations.- Since:
- 2.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getNewZoomInDPI(int currentDPI)
Get the new DPI value for zoom in based on the given DPI value.static int
getNewZoomOutDPI(int currentDPI)
Get the new DPI value for zoom out based on the given DPI value.static void
zoomIn(NatTable natTable, Consumer<IConfigRegistry> registryUpdater)
Performs aConfigureScalingCommand
to increase the scaling to "zoom in" a NatTable.static void
zoomOut(NatTable natTable, Consumer<IConfigRegistry> registryUpdater)
Performs aConfigureScalingCommand
to decrease the scaling to "zoom out" a NatTable.
-
-
-
Method Detail
-
zoomIn
public static void zoomIn(NatTable natTable, Consumer<IConfigRegistry> registryUpdater)
Performs aConfigureScalingCommand
to increase the scaling to "zoom in" a NatTable.- Parameters:
natTable
- TheNatTable
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 aConfigureScalingCommand
to decrease the scaling to "zoom out" a NatTable.- Parameters:
natTable
- TheNatTable
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.
-
-