Top Description Fields Constructors Methods
com.sun.javafx.scene.control.skin

public Class Utils

extends Object
Class Inheritance
Imports
com.sun.javafx.scene.NodeHelper, com.sun.javafx.scene.control.behavior.MnemonicInfo, com.sun.javafx.scene.text.TextLayout, .FontHelper, com.sun.javafx.tk.Toolkit, javafx.application.ConditionalFeature, .Platform, javafx.beans.InvalidationListener, .Observable, javafx.beans.value.ObservableValue, javafx.collections.ObservableList, javafx.geometry.Bounds, .HPos, .Point2D, .VPos, javafx.scene.Scene, javafx.scene.control.ContextMenu, .MenuItem, .OverrunStyle, com.sun.javafx.scene.control.ContextMenuContent, java.net.URL, javafx.scene.input.KeyCombination, .Mnemonic, javafx.scene.paint.Color, javafx.scene.text.Font, .Text, .TextBoundsType, java.text.Bidi, java.util.List, .Locale, java.util.function.Consumer

BE REALLY CAREFUL WITH RESTORING OR RESETTING STATE OF helper NODE AS LEFTOVER STATE CAUSES REALLY ODD NASTY BUGS! We expect all methods to set the Font property of helper but other than that any properties set should be restored to defaults.

Field Summary

Modifier and TypeField and Description
pack-priv static final TextBoundsType
pack-priv static final double
pack-priv static final String
pack-priv static final double
pack-priv static final Text
pack-priv static final TextLayout

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
public static void
addMnemonics(ContextMenu popup, Scene scene, boolean initialState)

public static void
addMnemonics(ContextMenu popup, Scene scene, boolean initialState, List<Mnemonic> into)

public static double
boundedSize(double value, double min, double max)

public static String
computeClippedText(Font font, String text, double width, OverrunStyle type, String ellipsisString)

public static String
computeClippedWrappedText(Font font, String text, double width, double height, double lineSpacing, OverrunStyle truncationStyle, String ellipsisString, TextBoundsType boundsType)

pack-priv static int
computeEndOfWord(Font font, String text, int index)

public static Point2D
computeMnemonicPosition(Font font, String text, int mnemonicIndex, double wrappingWidth, double lineSpacing, boolean isRTL)

pack-priv static int
computeStartOfWord(Font font, String text, int index)

public static double
computeTextHeight(Font font, String text, double wrappingWidth, TextBoundsType boundsType)

public static double
computeTextHeight(Font font, String text, double wrappingWidth, double lineSpacing, TextBoundsType boundsType)

public static double
computeTextWidth(Font font, String text, double wrappingWidth)

public static int
computeTruncationIndex(Font font, String text, double width)

public static double
computeXOffset(double width, double contentWidth, HPos hpos)

public static double
computeYOffset(double height, double contentHeight, VPos vpos)

public static <T> void
private static int
firstBreakCharIndex(String str, int start)

public static String
public static double
getAscent(Font font, TextBoundsType boundsType)

public static double
getLineHeight(Font font, TextBoundsType boundsType)

public static URL
private static boolean
public static boolean
private static int
lastBreakCharIndex(String str, int start)

public static void
private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_BOUNDS_TYPEback to summary
pack-priv static final TextBoundsType DEFAULT_BOUNDS_TYPE
DEFAULT_LINE_SPACINGback to summary
pack-priv static final double DEFAULT_LINE_SPACING
DEFAULT_TEXTback to summary
pack-priv static final String DEFAULT_TEXT
DEFAULT_WRAPPING_WIDTHback to summary
pack-priv static final double DEFAULT_WRAPPING_WIDTH
helperback to summary
pack-priv static final Text helper
layoutback to summary
pack-priv static final TextLayout layout

Constructor Detail

Utilsback to summary
public Utils()

Method Detail

addMnemonicsback to summary
public static void addMnemonics(ContextMenu popup, Scene scene)
addMnemonicsback to summary
public static void addMnemonics(ContextMenu popup, Scene scene, boolean initialState)
addMnemonicsback to summary
public static void addMnemonics(ContextMenu popup, Scene scene, boolean initialState, List<Mnemonic> into)
boundedSizeback to summary
public static double boundedSize(double value, double min, double max)
computeClippedTextback to summary
public static String computeClippedText(Font font, String text, double width, OverrunStyle type, String ellipsisString)
computeClippedWrappedTextback to summary
public static String computeClippedWrappedText(Font font, String text, double width, double height, double lineSpacing, OverrunStyle truncationStyle, String ellipsisString, TextBoundsType boundsType)
computeEndOfWordback to summary
pack-priv static int computeEndOfWord(Font font, String text, int index)
computeMnemonicPositionback to summary
public static Point2D computeMnemonicPosition(Font font, String text, int mnemonicIndex, double wrappingWidth, double lineSpacing, boolean isRTL)
computeStartOfWordback to summary
pack-priv static int computeStartOfWord(Font font, String text, int index)
computeTextHeightback to summary
public static double computeTextHeight(Font font, String text, double wrappingWidth, TextBoundsType boundsType)
computeTextHeightback to summary
public static double computeTextHeight(Font font, String text, double wrappingWidth, double lineSpacing, TextBoundsType boundsType)
computeTextWidthback to summary
public static double computeTextWidth(Font font, String text, double wrappingWidth)
computeTruncationIndexback to summary
public static int computeTruncationIndex(Font font, String text, double width)
computeXOffsetback to summary
public static double computeXOffset(double width, double contentWidth, HPos hpos)
computeYOffsetback to summary
public static double computeYOffset(double height, double contentHeight, VPos vpos)
executeOnceWhenPropertyIsNonNullback to summary
public static <T> void executeOnceWhenPropertyIsNonNull(ObservableValue<T> p, Consumer<T> consumer)
firstBreakCharIndexback to summary
private static int firstBreakCharIndex(String str, int start)
formatHexStringback to summary
public static String formatHexString(Color c)
getAscentback to summary
public static double getAscent(Font font, TextBoundsType boundsType)
getLineHeightback to summary
public static double getLineHeight(Font font, TextBoundsType boundsType)
getResourceback to summary
public static URL getResource(String str)
isPreferredBreakCharacterback to summary
private static boolean isPreferredBreakCharacter(char ch)
isTwoLevelFocusback to summary
public static boolean isTwoLevelFocus()
lastBreakCharIndexback to summary
private static int lastBreakCharIndex(String str, int start)
removeMnemonicsback to summary
public static void removeMnemonics(ContextMenu popup, Scene scene)
requiresComplexLayoutback to summary
private static boolean requiresComplexLayout(Font font, String string)