Class ScalingHelper
- java.lang.Object
-
- org.eclipse.nebula.widgets.richtext.ScalingHelper
-
public final class ScalingHelper extends java.lang.ObjectHelper class to handle display scaling.- Since:
- 1.4
-
-
Constructor Summary
Constructors Modifier Constructor Description privateScalingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intconvertHorizontalDpiToPixel(int dpi)Converts the given DPI scaled value to a pixel value using the factor for the horizontal DPI.static intconvertHorizontalPixelToDpi(int pixel)Converts the given amount of pixels to a DPI scaled value using the factor for the horizontal DPI value.static intconvertVerticalDpiToPixel(int dpi)Converts the given DPI scaled value to a pixel value using the factor for the vertical DPI.static intconvertVerticalPixelToDpi(int pixel)Converts the given amount of pixels to a DPI scaled value using the factor for the vertical DPI.static floatgetDpiFactor(int dpi)Returns the factor for scaling calculations of pixels regarding the DPI.
-
-
-
Method Detail
-
getDpiFactor
public static float getDpiFactor(int dpi)
Returns the factor for scaling calculations of pixels regarding the DPI.- Parameters:
dpi- The DPI for which the factor is requested.- Returns:
- The factor for dpi scaling calculations.
-
convertHorizontalPixelToDpi
public static int convertHorizontalPixelToDpi(int pixel)
Converts the given amount of pixels to a DPI scaled value using the factor for the horizontal DPI value.- Parameters:
pixel- the amount of pixels to convert.- Returns:
- The converted pixels.
-
convertHorizontalDpiToPixel
public static int convertHorizontalDpiToPixel(int dpi)
Converts the given DPI scaled value to a pixel value using the factor for the horizontal DPI.- Parameters:
dpi- the DPI value to convert.- Returns:
- The pixel value related to the given DPI
-
convertVerticalPixelToDpi
public static int convertVerticalPixelToDpi(int pixel)
Converts the given amount of pixels to a DPI scaled value using the factor for the vertical DPI.- Parameters:
pixel- the amount of pixels to convert.- Returns:
- The converted pixels.
-
convertVerticalDpiToPixel
public static int convertVerticalDpiToPixel(int dpi)
Converts the given DPI scaled value to a pixel value using the factor for the vertical DPI.- Parameters:
dpi- the DPI value to convert.- Returns:
- The pixel value related to the given DPI
-
-