Class ScalingUtil
java.lang.Object
org.eclipse.nebula.widgets.nattable.ui.scaling.ScalingUtil
Helper class for scaling calculations.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetNewZoomInDPI(int currentDPI) Get the new DPI value for zoom in based on the given DPI value.static intgetNewZoomInDPI(int currentDPI, boolean percentageIncrease) Get the new DPI value for zoom in based on the given DPI value.static intgetNewZoomOutDPI(int currentDPI) Get the new DPI value for zoom out based on the given DPI value.static intgetNewZoomOutDPI(int currentDPI, boolean percentageDecrease) Get the new DPI value for zoom out based on the given DPI value.static voidzoomIn(NatTable natTable, boolean percentageIncrease, Consumer<IConfigRegistry> registryUpdater) Performs aConfigureScalingCommandto increase the scaling to "zoom in" a NatTable.static voidzoomIn(NatTable natTable, Consumer<IConfigRegistry> registryUpdater) Performs aConfigureScalingCommandto increase the scaling to "zoom in" a NatTable.static voidzoomOut(NatTable natTable, boolean percentageDecrease, Consumer<IConfigRegistry> registryUpdater) Performs aConfigureScalingCommandto decrease the scaling to "zoom out" a NatTable.static voidzoomOut(NatTable natTable, Consumer<IConfigRegistry> registryUpdater) Performs aConfigureScalingCommandto decrease the scaling to "zoom out" a NatTable.
-
Method Details
-
zoomIn
Performs aConfigureScalingCommandto increase the scaling to "zoom in" a NatTable.- Parameters:
natTable- TheNatTableinstance 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
Performs aConfigureScalingCommandto decrease the scaling to "zoom out" a NatTable.- Parameters:
natTable- TheNatTableinstance on which the zoom in operation should be performed.registryUpdater- Callback to trigger registry updates. Needed to re-register image cell painters for example.
-
zoomIn
public static void zoomIn(NatTable natTable, boolean percentageIncrease, Consumer<IConfigRegistry> registryUpdater) Performs aConfigureScalingCommandto increase the scaling to "zoom in" a NatTable.- Parameters:
natTable- TheNatTableinstance on which the zoom in operation should be performed.percentageIncrease-trueif the zoom in should be done by 10%,falseif the next OS scaling factor should be used.registryUpdater- Callback to trigger registry updates. Needed to re-register image cell painters for example.- Since:
- 2.6
-
zoomOut
public static void zoomOut(NatTable natTable, boolean percentageDecrease, Consumer<IConfigRegistry> registryUpdater) Performs aConfigureScalingCommandto decrease the scaling to "zoom out" a NatTable.- Parameters:
natTable- TheNatTableinstance on which the zoom in operation should be performed.percentageDecrease-trueif the zoom out should be done by 10%,falseif the next OS scaling factor should be used.registryUpdater- Callback to trigger registry updates. Needed to re-register image cell painters for example.- Since:
- 2.6
-
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.
-
getNewZoomOutDPI
public static int getNewZoomOutDPI(int currentDPI, boolean percentageDecrease) 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.percentageDecrease-trueif the zoom out should be done by 10%,falseif the next OS scaling factor should be used.- Returns:
- The new DPI value for zooming out.
- Since:
- 2.6
-
getNewZoomInDPI
public static int getNewZoomInDPI(int currentDPI, boolean percentageIncrease) 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.percentageIncrease-trueif the zoom in should be done by 10%,falseif the next OS scaling factor should be used.- Returns:
- The new DPI value for zooming in.
- Since:
- 2.6
-