public enum TextBoundsType extends java.lang.Enum<TextBoundsType>
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.
Enum Constant and Description |
---|
LOGICAL
Use logical bounds as the basis for calculating the bounds.
|
VISUAL
Use visual bounds as the basis for calculating the bounds.
|
Modifier and Type | Method and Description |
---|---|
static TextBoundsType |
valueOf(java.lang.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.
|
public static final TextBoundsType LOGICAL
Note: This is usually the fastest option.
public static final TextBoundsType VISUAL
Note: This is likely to be slower than using logical bounds.
public static TextBoundsType[] values()
for (TextBoundsType c : TextBoundsType.values()) System.out.println(c);
public static TextBoundsType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namejava.lang.NullPointerException
- if the argument is nullCopyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.