Class FxGraphicalUtility



  • public final class FxGraphicalUtility
    extends java.lang.Object
    The Class FxGraphicalUtility.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javafx.scene.text.Font toFont​(java.lang.String aFontName, java.lang.String aText, double aLength, org.refcodes.graphical.LayoutMode aLayoutMode)
      Calculates the size for the given Font in order to fit in the given length (width or height) and returns an accordingly calculated Font with the same Font.getName().
      static javafx.scene.text.Font toFontHeight​(java.lang.String aFontName, java.lang.String aText, double aHeight)
      Calculates the size for the given Font in order to fit in the given height and returns an accordingly calculated Font with the same Font.getName().
      static double toFontSize​(java.lang.String aFontName, java.lang.String aText, double aLength, org.refcodes.graphical.LayoutMode aLayoutMode)
      Calculates the size for the given Font in order to fit in the given length (width or height).
      static double toFontSizeHeight​(java.lang.String aFontName, java.lang.String aText, double aHeight)
      Calculates the size for the given Font in order to fit in the given height.
      static double toFontSizeWidth​(java.lang.String aFontName, java.lang.String aText, double aWidth)
      Calculates the size for the given Font in order to fit in the given width.
      static javafx.scene.text.Font toFontWidth​(java.lang.String aFontName, java.lang.String aText, double aWidth)
      Calculates the size for the given Font in order to fit in the given width and returns an accordingly calculated Font with the same Font.getName().
      static javafx.scene.image.Image toImage​(java.io.InputStream aInputStream)
      To image.
      static javafx.scene.image.Image[] toImages​(java.io.InputStream... aInputStreams)
      To images.
      static javafx.geometry.Pos toPos​(org.refcodes.textual.HorizAlignTextMode aHorizAlignTextMode, org.refcodes.textual.VertAlignTextMode aVertAlignTextMode)
      Converts them text align modes to a Pos element.
      • Methods inherited from class java.lang.Object

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

      • toImage

        public static javafx.scene.image.Image toImage​(java.io.InputStream aInputStream)
        To image.
        Parameters:
        aInputStream - the input stream
        Returns:
        the image
      • toImages

        public static javafx.scene.image.Image[] toImages​(java.io.InputStream... aInputStreams)
        To images.
        Parameters:
        aInputStreams - the input streams
        Returns:
        the image[]
      • toFontSizeWidth

        public static double toFontSizeWidth​(java.lang.String aFontName,
                                             java.lang.String aText,
                                             double aWidth)
        Calculates the size for the given Font in order to fit in the given width.
        Parameters:
        aFontName - The name of the Font to be used.
        aText - The text for which to calculate the font size in order to fit into the given width.
        aWidth - The length width in which the text with the newly calculated font-size is to fit.
        Returns:
        The calculated font-size to be used for the given Font in order for the given text to fit into the provided width.
      • toFontSizeHeight

        public static double toFontSizeHeight​(java.lang.String aFontName,
                                              java.lang.String aText,
                                              double aHeight)
        Calculates the size for the given Font in order to fit in the given height.
        Parameters:
        aFontName - The name of the Font to be used.
        aText - The text for which to calculate the font size in order to fit into the given height.
        aHeight - The height in which the text with the newly calculated font-size is to fit.
        Returns:
        The calculated font-size to be used for the given Font in order for the given text to fit into the provided height.
      • toFontSize

        public static double toFontSize​(java.lang.String aFontName,
                                        java.lang.String aText,
                                        double aLength,
                                        org.refcodes.graphical.LayoutMode aLayoutMode)
        Calculates the size for the given Font in order to fit in the given length (width or height).
        Parameters:
        aFontName - The name of the Font to be used.
        aText - The text for which to calculate the font size in order to fit into the given length (width or height).
        aLength - The length (width or height, as of the LayoutMode) in which the text with the newly calculated font-size is to fit.
        aLayoutMode - The mode to determine whether to use the width or the height to calculate relative to.
        Returns:
        The calculated font-size to be used for the given Font in order for the given text to fit into the provided length (width or height).
      • toFont

        public static javafx.scene.text.Font toFont​(java.lang.String aFontName,
                                                    java.lang.String aText,
                                                    double aLength,
                                                    org.refcodes.graphical.LayoutMode aLayoutMode)
        Calculates the size for the given Font in order to fit in the given length (width or height) and returns an accordingly calculated Font with the same Font.getName().
        Parameters:
        aFontName - The name of the Font to be used.
        aText - The text for which to calculate the font size in order to fit into the given length (width or height).
        aLength - The length (width or height, as of the LayoutMode) in which the text with the newly calculated font-size is to fit.
        aLayoutMode - The mode to determine whether to use the width or the height to calculate relative to.
        Returns:
        The calculated Font to be used for the given Font in order for the given text to fit into the provided length (width or height).
      • toFontWidth

        public static javafx.scene.text.Font toFontWidth​(java.lang.String aFontName,
                                                         java.lang.String aText,
                                                         double aWidth)
        Calculates the size for the given Font in order to fit in the given width and returns an accordingly calculated Font with the same Font.getName().
        Parameters:
        aFontName - The name of the Font to be used.
        aText - The text for which to calculate the font size in order to fit into the given width.
        aWidth - The width in which the text with the newly calculated font-size is to fit.
        Returns:
        The calculated Font to be used for the given Font in order for the given text to fit into the provided width.
      • toFontHeight

        public static javafx.scene.text.Font toFontHeight​(java.lang.String aFontName,
                                                          java.lang.String aText,
                                                          double aHeight)
        Calculates the size for the given Font in order to fit in the given height and returns an accordingly calculated Font with the same Font.getName().
        Parameters:
        aFontName - The name of the Font to be used.
        aText - The text for which to calculate the font size in order to fit into the given height.
        aHeight - The height in which the text with the newly calculated font-size is to fit.
        Returns:
        The calculated Font to be used for the given Font in order for the given text to fit into the provided height.
      • toPos

        public static javafx.geometry.Pos toPos​(org.refcodes.textual.HorizAlignTextMode aHorizAlignTextMode,
                                                org.refcodes.textual.VertAlignTextMode aVertAlignTextMode)
        Converts them text align modes to a Pos element.
        Parameters:
        aHorizAlignTextMode - The horizontal portion to determine the according Pos element.
        aVertAlignTextMode - The vertical portion to determine the according Pos element.
        Returns:
        The accordingly determines Pos element.