org.eclipse.nebula.widgets.nattable.layer
Interface IDpiConverter

All Known Implementing Classes:
AbstractDpiConverter

public interface IDpiConverter

Interface to add support for scaling.

This interface is inspired by Riena and the corresponding talk at EclipseCon 2014 Scaling SWT on high-resolution screens


Method Summary
 int convertDpiToPixel(int dpi)
          Converts the given DPI scaled value to a pixel value.
 int convertPixelToDpi(int pixel)
          Converts the given amount of pixels to a DPI scaled value.
 float getCurrentDpiFactor()
           
 int getDpi()
          Returns the dots per inch of the display.
 

Method Detail

getDpi

int getDpi()
Returns the dots per inch of the display.

Returns:
the horizontal and vertical DPI

getCurrentDpiFactor

float getCurrentDpiFactor()
Returns:
The factor that will be used for the current DPI.

convertPixelToDpi

int convertPixelToDpi(int pixel)
Converts the given amount of pixels to a DPI scaled value.

Parameters:
pixel - the amount of pixels to convert.
Returns:
The converted pixels.

convertDpiToPixel

int convertDpiToPixel(int dpi)
Converts the given DPI scaled value to a pixel value.

Parameters:
dpi - the DPI value to convert.
Returns:
The pixel value related to the given DPI


Copyright © 2015. All rights reserved.