Package overit.geocall.util
Class XlsxUtils.ConvertImageUnits
java.lang.Object
overit.geocall.util.XlsxUtils.ConvertImageUnits
- Enclosing class:
XlsxUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe column width returned by HSSF and the width of a picture when positioned to exactly cover one cell are different by almost exactly 2mm - give or take rounding errors.static final shortstatic final intThe resoultion of an image can be expressed as a specific number of pixels per inch.static final doubleConstants that defines how many pixels and points there are in a millimetre.static final doublestatic final intEach cell contains a fixed number of coordinate points; this number does not vary with row height or column width or with font.static final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intmillimetres2WidthUnits(double millimetres) Convert into millimetres Excels width units.static shortpixel2WidthUnits(int pxs) Pixel units to excel width units(units of 1/256th of a character width)static doublepointsToMillimeters(double points) Convert points to millimetersstatic intpointsToPixels(double points) Convert points to pixelsstatic doublewidthUnits2Millimetres(short widthUnits) Convert Excels width units into millimetres.static intwidthUnits2Pixel(short widthUnits) Excel width units(units of 1/256th of a character width) to pixel units.
-
Field Details
-
TOTAL_COLUMN_COORDINATE_POSITIONS
public static final int TOTAL_COLUMN_COORDINATE_POSITIONSEach cell contains a fixed number of coordinate points; this number does not vary with row height or column width or with font. These two constants are defined below.- See Also:
-
TOTAL_ROW_COORDINATE_POSITIONS
public static final int TOTAL_ROW_COORDINATE_POSITIONS- See Also:
-
PIXELS_PER_INCH
public static final int PIXELS_PER_INCHThe resoultion of an image can be expressed as a specific number of pixels per inch. Displays and printers differ but 96 pixels per inch is an acceptable standard to beging with.- See Also:
-
PIXELS_PER_MILLIMETRES
public static final double PIXELS_PER_MILLIMETRESConstants that defines how many pixels and points there are in a millimetre. These values are required for the conversion algorithm.- See Also:
-
POINTS_PER_MILLIMETRE
public static final double POINTS_PER_MILLIMETRE- See Also:
-
CELL_BORDER_WIDTH_MILLIMETRES
public static final double CELL_BORDER_WIDTH_MILLIMETRESThe column width returned by HSSF and the width of a picture when positioned to exactly cover one cell are different by almost exactly 2mm - give or take rounding errors. This constant allows that additional amount to be accounted for when calculating how many celles the image ought to overlie.- See Also:
-
EXCEL_COLUMN_WIDTH_FACTOR
public static final short EXCEL_COLUMN_WIDTH_FACTOR- See Also:
-
UNIT_OFFSET_LENGTH
public static final int UNIT_OFFSET_LENGTH- See Also:
-
-
Constructor Details
-
ConvertImageUnits
protected ConvertImageUnits()
-
-
Method Details
-
pixel2WidthUnits
public static short pixel2WidthUnits(int pxs) Pixel units to excel width units(units of 1/256th of a character width)- Parameters:
pxs- Number of pixel units to excel width units (units of 1/256th of a character width)- Returns:
- The width units
-
widthUnits2Pixel
public static int widthUnits2Pixel(short widthUnits) Excel width units(units of 1/256th of a character width) to pixel units.- Parameters:
widthUnits- Number of excel width units(units of 1/256th of a character width) to pixel units- Returns:
- The pixel units
-
widthUnits2Millimetres
public static double widthUnits2Millimetres(short widthUnits) Convert Excels width units into millimetres.- Parameters:
widthUnits- The width of the column or the height of the row in Excels units.- Returns:
- A primitive double that contains the columns width or rows height in millimetres.
-
millimetres2WidthUnits
public static int millimetres2WidthUnits(double millimetres) Convert into millimetres Excels width units.- Parameters:
millimetres- A primitive double that contains the columns width or rows height in millimetres.- Returns:
- A primitive int that contains the columns width or rows height in Excels units.
-
pointsToPixels
public static int pointsToPixels(double points) Convert points to pixels- Parameters:
points- A primitive double that contains the points- Returns:
- A primitive int that contains the value in pixel
-
pointsToMillimeters
public static double pointsToMillimeters(double points) Convert points to millimeters- Parameters:
points- A primitive double that contains the points- Returns:
- A primitive double that contains the value in millimeters
-