Package javafx.scene.text
Class Text
java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.text.Text
- All Implemented Interfaces:
LayoutMeasurable
,LayoutMeasurableMixin
,HasBlendModeProperty
,HasClipProperty
,HasEffectProperty
,HasFillProperty
,HasFontProperty
,HasLayoutXProperty
,HasLayoutYProperty
,HasManagedProperty
,HasMouseTransparentProperty
,HasOnMouseClickedProperty
,HasOpacityProperty
,HasParentProperty
,HasSmoothProperty
,HasStrokeDashOffsetProperty
,HasStrokeLineCapProperty
,HasStrokeLineJoinProperty
,HasStrokeMiterLimitProperty
,HasStrokeProperty
,HasStrokeTypeProperty
,HasStrokeWidthProperty
,HasTextAlignmentProperty
,HasTextOriginProperty
,HasTextProperty
,HasVisibleProperty
,HasWrappingWidthProperty
,HasXProperty
,HasYProperty
,Styleable
,EventTarget
,INode
- Direct Known Subclasses:
LabeledText
public class Text
extends Shape
implements HasXProperty, HasYProperty, HasTextProperty, HasTextOriginProperty, HasTextAlignmentProperty, HasWrappingWidthProperty, HasFontProperty
- Author:
- Bruno Salmon
-
Property Summary
PropertiesTypePropertyDescriptionfinal Property<TextBoundsType>
Determines how the bounds of the text node are calculated.final BooleanProperty
Defines if each line of text should have a line through it.Properties inherited from class javafx.scene.shape.Shape
fill, smooth, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, stroke, strokeType, strokeWidth
Properties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visible
-
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Property<TextBoundsType>
Determines how the bounds of the text node are calculated.double
The 'alphabetic' (or 'roman') baseline offset from the node's layoutBounds.minY location that should be used when this node is being vertically aligned by baseline with other nodes.final TextBoundsType
Gets the value of theboundsType
property.double
Gets the value of thelineSpacing
property.impl_computeGeomBounds
(BaseBounds bounds, BaseTransform tx) Computes the geometric bounds for this Node.final boolean
Gets the value of thestrikethrough
property.final void
setBoundsType
(TextBoundsType value) Sets the value of theboundsType
property.void
setLineSpacing
(double lineSpacing) Sets the value of thelineSpacing
property.final void
setStrikethrough
(boolean value) Sets the value of thestrikethrough
property.final BooleanProperty
Defines if each line of text should have a line through it.Methods inherited from class javafx.scene.shape.Shape
fillProperty, getStrokeDashArray, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract
Methods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_computeLayoutBounds, impl_getLayoutBounds, impl_isTreeVisible, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onPeerSizeChanged, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, shouldUseLayoutMeasurable, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFillProperty
getFill, setFill
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFontProperty
getFont, setFont
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSmoothProperty
isSmooth, setSmooth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeDashOffsetProperty
getStrokeDashOffset, setStrokeDashOffset
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineCapProperty
getStrokeLineCap, setStrokeLineCap
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineJoinProperty
getStrokeLineJoin, setStrokeLineJoin
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeMiterLimitProperty
getStrokeMiterLimit, setStrokeMiterLimit
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeProperty
getStroke, setStroke
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeTypeProperty
getStrokeType, setStrokeType
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeWidthProperty
getStrokeWidth, setStrokeWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasTextAlignmentProperty
getTextAlignment, setTextAlignment
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasTextOriginProperty
getTextOrigin, setTextOrigin
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasTextProperty
getText, setText
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWrappingWidthProperty
getWrappingWidth, setWrappingWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasXProperty
getX, setX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasYProperty
getY, setY
Methods inherited from interface javafx.scene.INode
getContentBias, isResizable, relocate, resize, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
-
Property Details
-
x
- Specified by:
xProperty
in interfaceHasXProperty
- Returns:
- the
x
property - See Also:
-
textOrigin
- Specified by:
textOriginProperty
in interfaceHasTextOriginProperty
- Returns:
- the
textOrigin
property - See Also:
-
textAlignment
- Specified by:
textAlignmentProperty
in interfaceHasTextAlignmentProperty
- Returns:
- the
textAlignment
property - See Also:
-
wrappingWidth
- Specified by:
wrappingWidthProperty
in interfaceHasWrappingWidthProperty
- Returns:
- the
wrappingWidth
property - See Also:
-
lineSpacing
-
y
- Specified by:
yProperty
in interfaceHasYProperty
- Returns:
- the
y
property - See Also:
-
text
- Specified by:
textProperty
in interfaceHasTextProperty
- Returns:
- the
text
property - See Also:
-
font
- Specified by:
fontProperty
in interfaceHasFontProperty
- Returns:
- the
font
property - See Also:
-
boundsType
Determines how the bounds of the text node are calculated. Logical bounds is a more appropriate default for text than the visual bounds. SeeTextBoundsType
for more information.- Default value:
- TextBoundsType.LOGICAL
- See Also:
-
strikethrough
Defines if each line of text should have a line through it.- Default value:
- false
- See Also:
-
-
Constructor Details
-
Text
public Text() -
Text
-
Text
-
-
Method Details
-
xProperty
- Specified by:
xProperty
in interfaceHasXProperty
- Returns:
- the
x
property - See Also:
-
textOriginProperty
- Specified by:
textOriginProperty
in interfaceHasTextOriginProperty
- Returns:
- the
textOrigin
property - See Also:
-
textAlignmentProperty
- Specified by:
textAlignmentProperty
in interfaceHasTextAlignmentProperty
- Returns:
- the
textAlignment
property - See Also:
-
wrappingWidthProperty
- Specified by:
wrappingWidthProperty
in interfaceHasWrappingWidthProperty
- Returns:
- the
wrappingWidth
property - See Also:
-
lineSpacingProperty
- Returns:
- the
lineSpacing
property - See Also:
-
getLineSpacing
public double getLineSpacing()Gets the value of thelineSpacing
property.- Property description:
- Returns:
- the value of the
lineSpacing
property - See Also:
-
setLineSpacing
public void setLineSpacing(double lineSpacing) Sets the value of thelineSpacing
property.- Property description:
- Parameters:
lineSpacing
- the value for thelineSpacing
property- See Also:
-
yProperty
- Specified by:
yProperty
in interfaceHasYProperty
- Returns:
- the
y
property - See Also:
-
textProperty
- Specified by:
textProperty
in interfaceHasTextProperty
- Returns:
- the
text
property - See Also:
-
fontProperty
- Specified by:
fontProperty
in interfaceHasFontProperty
- Returns:
- the
font
property - See Also:
-
setBoundsType
Sets the value of theboundsType
property.- Property description:
- Determines how the bounds of the text node are calculated.
Logical bounds is a more appropriate default for text than
the visual bounds. See
TextBoundsType
for more information. - Default value:
- TextBoundsType.LOGICAL
- Parameters:
value
- the value for theboundsType
property- See Also:
-
getBoundsType
Gets the value of theboundsType
property.- Property description:
- Determines how the bounds of the text node are calculated.
Logical bounds is a more appropriate default for text than
the visual bounds. See
TextBoundsType
for more information. - Default value:
- TextBoundsType.LOGICAL
- Returns:
- the value of the
boundsType
property - See Also:
-
boundsTypeProperty
Determines how the bounds of the text node are calculated. Logical bounds is a more appropriate default for text than the visual bounds. SeeTextBoundsType
for more information.- Default value:
- TextBoundsType.LOGICAL
- Returns:
- the
boundsType
property - See Also:
-
strikethroughProperty
Defines if each line of text should have a line through it.- Default value:
- false
- Returns:
- if each line of text should have a line through it
- See Also:
-
setStrikethrough
public final void setStrikethrough(boolean value) Sets the value of thestrikethrough
property.- Property description:
- Defines if each line of text should have a line through it.
- Default value:
- false
- Parameters:
value
- the value for thestrikethrough
property- See Also:
-
isStrikethrough
public final boolean isStrikethrough()Gets the value of thestrikethrough
property.- Property description:
- Defines if each line of text should have a line through it.
- Default value:
- false
- Returns:
- the value of the
strikethrough
property - See Also:
-
getBaselineOffset
public double getBaselineOffset()Description copied from interface:INode
The 'alphabetic' (or 'roman') baseline offset from the node's layoutBounds.minY location that should be used when this node is being vertically aligned by baseline with other nodes. By default this returnsINode.BASELINE_OFFSET_SAME_AS_HEIGHT
for resizable Nodes and layoutBounds height for non-resizable. Subclasses which contain text should override this method to return their actual text baseline offset.- Specified by:
getBaselineOffset
in interfaceINode
- Returns:
- offset of text baseline from layoutBounds.minY for non-resizable Nodes or
INode.BASELINE_OFFSET_SAME_AS_HEIGHT
otherwise
-
impl_computeGeomBounds
Description copied from class:Node
Computes the geometric bounds for this Node. This method is abstract and must be implemented by each Node subclass.- Specified by:
impl_computeGeomBounds
in classNode
-