Spec-Zone.ru › OpenJavaFX 8
javafx.scene.text

Enum TextBoundsType

java.lang.Object
  • java.lang.Enum<TextBoundsType>
    • javafx.scene.text.TextBoundsType

All Implemented Interfaces:

Serializable, Comparable<TextBoundsType>



public enum TextBoundsType
extends Enum<TextBoundsType>
Specifies the behaviour of bounds reporting by Text nodes. The setting affects layoutBounds, boundsInLocal and boundsInParent The geometry of text can be measured either in terms of the bounds of the particular text to be rendered - visual bounds, or as properties of the font and the characters to be rendered - logical bounds. Visual bounds are more useful for positioning text as graphics, and for obtaining tight enclosing bounds around the text.

Logical bounds are important for laying out text relative to other text and other components, particularly those which also contain text. The bounds isn't specific to the text being rendered, and so will report heights which account for the potential ascent and descent of text using the font at its specified size. Also leading and trailing spaces are part of the logical advance width of the text.

Since:

JavaFX 2.0

  • Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    LOGICAL
    Use logical bounds as the basis for calculating the bounds.
    LOGICAL_VERTICAL_CENTER
    Use logical vertical centered bounds as the basis for calculating the bounds.
    VISUAL
    Use visual bounds as the basis for calculating the bounds.
  • Method Summary

    All MethodsStatic MethodsConcrete Methods
    Modifier and Type Method and Description
    static TextBoundsType valueOf(String name)
    Returns the enum constant of this type with the specified name.
    static TextBoundsType[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    • Methods inherited from class java.lang.Enum

      clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    • Methods inherited from class java.lang.Object

      getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Detail

    • LOGICAL

      public static final TextBoundsType LOGICAL
      Use logical bounds as the basis for calculating the bounds.

      The logical bounds are based on font metrics information. The width is based on the glyph advances and the height on the ascent, descent, and line gap. Except for the last line which does not include the line gap.

      Note: This is usually the fastest option.

    • VISUAL

      public static final TextBoundsType VISUAL
      Use visual bounds as the basis for calculating the bounds.

      Note: This is likely to be slower than using logical bounds.

    • LOGICAL_VERTICAL_CENTER

      public static final TextBoundsType LOGICAL_VERTICAL_CENTER
      Use logical vertical centered bounds as the basis for calculating the bounds.

      This bounds type is typically used to center Text nodes vertically within the bounds of its parent.

      Since:

      JavaFX 8.0

  • Method Detail

    • values

      public static TextBoundsType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
      for (TextBoundsType c : TextBoundsType.values())
          System.out.println(c);

      Returns:

      an array containing the constants of this enum type, in the order they are declared

    • valueOf

      public static TextBoundsType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

      Parameters:

      name - the name of the enum constant to be returned.

      Returns:

      the enum constant with the specified name

      Throws:

      IllegalArgumentException - if this enum type has no constant with the specified name

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API