Class FxGraphicalUtility
java.lang.Object
org.refcodes.graphical.ext.javafx.FxGraphicalUtility
-
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.scene.text.FonttoFont(String aFontName, String aText, double aLength, org.refcodes.graphical.LayoutMode aLayoutMode) Calculates the size for the givenFontin order to fit in the given length (width or height) and returns an accordingly calculatedFontwith the sameFont.getName().static javafx.scene.text.FonttoFontHeight(String aFontName, String aText, double aHeight) Calculates the size for the givenFontin order to fit in the given height and returns an accordingly calculatedFontwith the sameFont.getName().static doubletoFontSize(String aFontName, String aText, double aLength, org.refcodes.graphical.LayoutMode aLayoutMode) Calculates the size for the givenFontin order to fit in the given length (width or height).static doubletoFontSizeHeight(String aFontName, String aText, double aHeight) Calculates the size for the givenFontin order to fit in the given height.static doubletoFontSizeWidth(String aFontName, String aText, double aWidth) Calculates the size for the givenFontin order to fit in the given width.static javafx.scene.text.FonttoFontWidth(String aFontName, String aText, double aWidth) Calculates the size for the givenFontin order to fit in the given width and returns an accordingly calculatedFontwith the sameFont.getName().static javafx.scene.image.ImagetoImage(InputStream aInputStream) To image.static javafx.scene.image.Image[]toImages(InputStream... aInputStreams) To images.static javafx.geometry.PostoPos(org.refcodes.textual.HorizAlignTextMode aHorizAlignTextMode, org.refcodes.textual.VertAlignTextMode aVertAlignTextMode) Converts them text align modes to aPoselement.
-
Method Details
-
toImage
To image.- Parameters:
aInputStream- the input stream- Returns:
- the image
-
toImages
To images.- Parameters:
aInputStreams- the input streams- Returns:
- the image[]
-
toFontSizeWidth
Calculates the size for the givenFontin order to fit in the given width.- Parameters:
aFontName- The name of theFontto 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
Fontin order for the given text to fit into the provided width.
-
toFontSizeHeight
Calculates the size for the givenFontin order to fit in the given height.- Parameters:
aFontName- The name of theFontto 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
Fontin order for the given text to fit into the provided height.
-
toFontSize
public static double toFontSize(String aFontName, String aText, double aLength, org.refcodes.graphical.LayoutMode aLayoutMode) Calculates the size for the givenFontin order to fit in the given length (width or height).- Parameters:
aFontName- The name of theFontto 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 theLayoutMode) 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
Fontin order for the given text to fit into the provided length (width or height).
-
toFont
public static javafx.scene.text.Font toFont(String aFontName, String aText, double aLength, org.refcodes.graphical.LayoutMode aLayoutMode) Calculates the size for the givenFontin order to fit in the given length (width or height) and returns an accordingly calculatedFontwith the sameFont.getName().- Parameters:
aFontName- The name of theFontto 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 theLayoutMode) 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
Fontto be used for the givenFontin order for the given text to fit into the provided length (width or height).
-
toFontWidth
Calculates the size for the givenFontin order to fit in the given width and returns an accordingly calculatedFontwith the sameFont.getName().- Parameters:
aFontName- The name of theFontto 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
Fontto be used for the givenFontin order for the given text to fit into the provided width.
-
toFontHeight
Calculates the size for the givenFontin order to fit in the given height and returns an accordingly calculatedFontwith the sameFont.getName().- Parameters:
aFontName- The name of theFontto 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
Fontto be used for the givenFontin 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 aPoselement.- Parameters:
aHorizAlignTextMode- The horizontal portion to determine the accordingPoselement.aVertAlignTextMode- The vertical portion to determine the accordingPoselement.- Returns:
- The accordingly determines
Poselement.
-