Class LengthUtil


  • public final class LengthUtil
    extends java.lang.Object
    Author:
    Teodor Danciu (teodord@users.sourceforge.net)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int emu​(float points)
      Convert an int value from points to EMU (multiply with 12700)
      static int halfPoint​(float pixels)  
      static double inch​(double pixels)
      Converts pixels to inches without decimal truncation.
      static double inchFloor2Dec​(double pixels)  
      static double inchFloor4Dec​(double pixels)  
      static double inchRound2Dec​(double pixels)  
      static double inchRound4Dec​(double pixels)  
      static int twip​(float points)
      Convert a float value to twips (multiply with 20)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • inch

        public static double inch​(double pixels)
        Converts pixels to inches without decimal truncation.
      • inchFloor2Dec

        public static double inchFloor2Dec​(double pixels)
      • inchFloor4Dec

        public static double inchFloor4Dec​(double pixels)
      • inchRound2Dec

        public static double inchRound2Dec​(double pixels)
      • inchRound4Dec

        public static double inchRound4Dec​(double pixels)
      • twip

        public static int twip​(float points)
        Convert a float value to twips (multiply with 20)
        Parameters:
        points - value that need to be converted
        Returns:
        converted value in twips
      • emu

        public static int emu​(float points)
        Convert an int value from points to EMU (multiply with 12700)
        Parameters:
        points - value that needs to be converted
        Returns:
        converted value in EMU
      • halfPoint

        public static int halfPoint​(float pixels)