Top Inners Fields Methods
com.sun.javafx.scene.text

public Interface TextLayout

Known Direct Implementers
com.sun.javafx.text.PrismTextLayout
Imports
javafx.scene.shape.PathElement, com.sun.javafx.geom.BaseBounds, .Shape

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public BaseBounds

Returns:

the layout bounds
getBounds
()

Returns the (logical) bounds of the layout minX is always zero minY is the ascent of the first line (negative) width the width of the widest line height the sum of all lines height Note that this width is different the wrapping width!

public BaseBounds
getBounds(TextSpan filter, BaseBounds bounds)

public PathElement[]
getCaretShape(int offset, boolean isLeading, float x, float y)

public TextLayout.Hit
getHitInfo(float x, float y)

public TextLine[]

Returns:

the text lines
getLines
()

Returns the lines of text layout.

public PathElement[]
getRange(int start, int end, int type, float x, float y)

public GlyphList[]

Returns:

the runs
getRuns
()

Returns the GlyphList of text layout.

public Shape

Returns:

the shape
getShape
(int
the type of the shapes to include
type
,
TextSpan filter)

Returns the shape of the entire text layout relative to the baseline of the first line.

public BaseBounds

Returns:

the visual bounds
getVisualBounds
(int type)

Returns the visual bounds of the layout using glyph bounding box

public boolean

Returns:

returns true is the call modifies the layout internal state.
setAlignment
(int alignment)

Sets the alignment for the TextLayout.

public boolean

Returns:

returns true is the call modifies the layout internal state.
setBoundsType
(int type)

Sets the bounds type for the TextLayout.

public boolean

Returns:

returns true is the call modifies the layout internal state.
setContent
(TextSpan[] spans)

Sets the content for the TextLayout.

public boolean

Returns:

returns true is the call modifies the layout internal state.
setContent
(String string, Object font)

Sets the content for the TextLayout.

public boolean

Returns:

returns true is the call modifies the layout internal state.
setDirection
(int direction)

Sets the direction (bidi algorithm's) for the TextLayout.

public boolean

Returns:

returns true is the call modifies the layout internal state.
setLineSpacing
(float spacing)

Sets the line spacing for the TextLayout.

public boolean

Returns:

returns true if the call modifies the layout internal state.
setTabSize
(int
the number of spaces represented by a tab. Default is 8. Minimum is 1, lower values will be clamped to 1.
spaces
)

Sets the tab size for the TextLayout.

public boolean

Returns:

returns true is the call modifies the layout internal state.
setWrapWidth
(float wrapWidth)

Sets the wrap width for the TextLayout.

Field Detail

ALIGN_CENTERback to summary
public static final int ALIGN_CENTER
ALIGN_JUSTIFYback to summary
public static final int ALIGN_JUSTIFY
ALIGN_LEFTback to summary
public static final int ALIGN_LEFT
ALIGN_MASKback to summary
public static final int ALIGN_MASK
ALIGN_RIGHTback to summary
public static final int ALIGN_RIGHT
ANALYSIS_MASKback to summary
public static final int ANALYSIS_MASK
BOUNDS_CENTERback to summary
public static final int BOUNDS_CENTER
BOUNDS_MASKback to summary
public static final int BOUNDS_MASK
DEFAULT_TAB_SIZEback to summary
public static final int DEFAULT_TAB_SIZE
DIRECTION_DEFAULT_LTRback to summary
public static final int DIRECTION_DEFAULT_LTR
DIRECTION_DEFAULT_RTLback to summary
public static final int DIRECTION_DEFAULT_RTL
DIRECTION_LTRback to summary
public static final int DIRECTION_LTR
DIRECTION_MASKback to summary
public static final int DIRECTION_MASK
DIRECTION_RTLback to summary
public static final int DIRECTION_RTL
FLAGS_ANALYSIS_VALIDback to summary
public static final int FLAGS_ANALYSIS_VALID
FLAGS_CACHED_STRIKETHROUGHback to summary
public static final int FLAGS_CACHED_STRIKETHROUGH
FLAGS_CACHED_UNDERLINEback to summary
public static final int FLAGS_CACHED_UNDERLINE
FLAGS_HAS_BIDIback to summary
public static final int FLAGS_HAS_BIDI
FLAGS_HAS_CJKback to summary
public static final int FLAGS_HAS_CJK
FLAGS_HAS_COMPLEXback to summary
public static final int FLAGS_HAS_COMPLEX
FLAGS_HAS_EMBEDDEDback to summary
public static final int FLAGS_HAS_EMBEDDED
FLAGS_HAS_TABSback to summary
public static final int FLAGS_HAS_TABS
FLAGS_LASTback to summary
public static final int FLAGS_LAST
FLAGS_LINES_VALIDback to summary
public static final int FLAGS_LINES_VALID
FLAGS_RTL_BASEback to summary
public static final int FLAGS_RTL_BASE
FLAGS_WRAPPEDback to summary
public static final int FLAGS_WRAPPED
TYPE_BASELINEback to summary
public static final int TYPE_BASELINE
TYPE_BEARINGSback to summary
public static final int TYPE_BEARINGS
TYPE_STRIKETHROUGHback to summary
public static final int TYPE_STRIKETHROUGH
TYPE_TEXTback to summary
public static final int TYPE_TEXT
TYPE_TOPback to summary
public static final int TYPE_TOP
TYPE_UNDERLINEback to summary
public static final int TYPE_UNDERLINE

Method Detail

getBoundsback to summary
public BaseBounds getBounds()

Returns the (logical) bounds of the layout minX is always zero minY is the ascent of the first line (negative) width the width of the widest line height the sum of all lines height Note that this width is different the wrapping width!

Returns:BaseBounds

the layout bounds

getBoundsback to summary
public BaseBounds getBounds(TextSpan filter, BaseBounds bounds)
getCaretShapeback to summary
public PathElement[] getCaretShape(int offset, boolean isLeading, float x, float y)
getHitInfoback to summary
public TextLayout.Hit getHitInfo(float x, float y)
getLinesback to summary
public TextLine[] getLines()

Returns the lines of text layout.

Returns:TextLine[]

the text lines

getRangeback to summary
public PathElement[] getRange(int start, int end, int type, float x, float y)
getRunsback to summary
public GlyphList[] getRuns()

Returns the GlyphList of text layout. The runs are returned order visually (rendering order), starting from the first line.

Returns:GlyphList[]

the runs

getShapeback to summary
public Shape getShape(int type, TextSpan filter)

Returns the shape of the entire text layout relative to the baseline of the first line.

Parameters
type:int

the type of the shapes to include

Returns:Shape

the shape

getVisualBoundsback to summary
public BaseBounds getVisualBounds(int type)

Returns the visual bounds of the layout using glyph bounding box

Returns:BaseBounds

the visual bounds

setAlignmentback to summary
public boolean setAlignment(int alignment)

Sets the alignment for the TextLayout.

Returns:boolean

returns true is the call modifies the layout internal state.

setBoundsTypeback to summary
public boolean setBoundsType(int type)

Sets the bounds type for the TextLayout.

Returns:boolean

returns true is the call modifies the layout internal state.

setContentback to summary
public boolean setContent(TextSpan[] spans)

Sets the content for the TextLayout. Supports multiple spans (rich text).

Returns:boolean

returns true is the call modifies the layout internal state.

setContentback to summary
public boolean setContent(String string, Object font)

Sets the content for the TextLayout. Shorthand for single span text (no rich text).

Returns:boolean

returns true is the call modifies the layout internal state.

setDirectionback to summary
public boolean setDirection(int direction)

Sets the direction (bidi algorithm's) for the TextLayout.

Returns:boolean

returns true is the call modifies the layout internal state.

setLineSpacingback to summary
public boolean setLineSpacing(float spacing)

Sets the line spacing for the TextLayout.

Returns:boolean

returns true is the call modifies the layout internal state.

setTabSizeback to summary
public boolean setTabSize(int spaces)

Sets the tab size for the TextLayout.

Parameters
spaces:int

the number of spaces represented by a tab. Default is 8. Minimum is 1, lower values will be clamped to 1.

Returns:boolean

returns true if the call modifies the layout internal state.

setWrapWidthback to summary
public boolean setWrapWidth(float wrapWidth)

Sets the wrap width for the TextLayout.

Returns:boolean

returns true is the call modifies the layout internal state.

com.sun.javafx.scene.text back to summary

public Class TextLayout.Hit

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
Hit(int charIndex, int insertionIndex, boolean leading)

Method Summary

Modifier and TypeMethod and Description
public int
public int
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charIndexback to summary
pack-priv int charIndex
insertionIndexback to summary
pack-priv int insertionIndex
leadingback to summary
pack-priv boolean leading

Constructor Detail

Hitback to summary
public Hit(int charIndex, int insertionIndex, boolean leading)

Method Detail

getCharIndexback to summary
public int getCharIndex()
getInsertionIndexback to summary
public int getInsertionIndex()
isLeadingback to summary
public boolean isLeading()