Interface UnitConverter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int centimeterAsPixel​(double cm, java.awt.Component component)
      Converts Centimeters and returns pixels using the resolution of the given component's graphics object.
      int dialogUnitXAsPixel​(int dluX, java.awt.Component component)
      Converts horizontal dialog units and returns pixels.
      int dialogUnitYAsPixel​(int dluY, java.awt.Component component)
      Converts vertical dialog units and returns pixels.
      int inchAsPixel​(double in, java.awt.Component component)
      Converts Inches and returns pixels using the specified resolution.
      int millimeterAsPixel​(double mm, java.awt.Component component)
      Converts Millimeters and returns pixels using the resolution of the given component's graphics object.
      int pointAsPixel​(int pt, java.awt.Component component)
      Converts DTP Points and returns pixels using the resolution of the given component's graphics object.
    • Method Detail

      • inchAsPixel

        int inchAsPixel​(double in,
                        java.awt.Component component)
        Converts Inches and returns pixels using the specified resolution.
        Parameters:
        in - the Inches
        component - the component that provides the graphics object
        Returns:
        the given Inches as pixels
      • millimeterAsPixel

        int millimeterAsPixel​(double mm,
                              java.awt.Component component)
        Converts Millimeters and returns pixels using the resolution of the given component's graphics object.
        Parameters:
        mm - Millimeters
        component - the component that provides the graphics object
        Returns:
        the given Millimeters as pixels
      • centimeterAsPixel

        int centimeterAsPixel​(double cm,
                              java.awt.Component component)
        Converts Centimeters and returns pixels using the resolution of the given component's graphics object.
        Parameters:
        cm - Centimeters
        component - the component that provides the graphics object
        Returns:
        the given Centimeters as pixels
      • pointAsPixel

        int pointAsPixel​(int pt,
                         java.awt.Component component)
        Converts DTP Points and returns pixels using the resolution of the given component's graphics object.
        Parameters:
        pt - DTP Points
        component - the component that provides the graphics object
        Returns:
        the given Points as pixels
      • dialogUnitXAsPixel

        int dialogUnitXAsPixel​(int dluX,
                               java.awt.Component component)
        Converts horizontal dialog units and returns pixels. Honors the resolution, dialog font size, platform and look&feel.
        Parameters:
        dluX - the horizontal dialog units
        component - a component that provides the font and graphics
        Returns:
        the given horizontal dialog units as pixels
      • dialogUnitYAsPixel

        int dialogUnitYAsPixel​(int dluY,
                               java.awt.Component component)
        Converts vertical dialog units and returns pixels. Honors the resolution, dialog font size, platform and look&feel.
        Parameters:
        dluY - the vertical dialog units
        component - a component that provides the font and graphics
        Returns:
        the given vertical dialog units as pixels