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 BooleanPropertyDefines 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, strokeWidthProperties 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.doubleThe '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 TextBoundsTypeGets the value of theboundsTypeproperty.doubleGets the value of thelineSpacingproperty.impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx) Computes the geometric bounds for this Node.final booleanGets the value of thestrikethroughproperty.final voidsetBoundsType(TextBoundsType value) Sets the value of theboundsTypeproperty.voidsetLineSpacing(double lineSpacing) Sets the value of thelineSpacingproperty.final voidsetStrikethrough(boolean value) Sets the value of thestrikethroughproperty.final BooleanPropertyDefines 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, subtractMethods 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, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
getBlendMode, setBlendModeMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClipMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffectMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFillProperty
getFill, setFillMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFontProperty
getFont, setFontMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutXMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutYMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManagedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClickedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacityMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSmoothProperty
isSmooth, setSmoothMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeDashOffsetProperty
getStrokeDashOffset, setStrokeDashOffsetMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineCapProperty
getStrokeLineCap, setStrokeLineCapMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineJoinProperty
getStrokeLineJoin, setStrokeLineJoinMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeMiterLimitProperty
getStrokeMiterLimit, setStrokeMiterLimitMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeProperty
getStroke, setStrokeMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeTypeProperty
getStrokeType, setStrokeTypeMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeWidthProperty
getStrokeWidth, setStrokeWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasTextAlignmentProperty
getTextAlignment, setTextAlignmentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasTextOriginProperty
getTextOrigin, setTextOriginMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasTextProperty
getText, setTextMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisibleMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWrappingWidthProperty
getWrappingWidth, setWrappingWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasXProperty
getX, setXMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasYProperty
getY, setYMethods inherited from interface javafx.scene.INode
getContentBias, isResizable, relocate, resize, resizeRelocateMethods 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:
xPropertyin interfaceHasXProperty- Returns:
- the
xproperty - See Also:
-
textOrigin
- Specified by:
textOriginPropertyin interfaceHasTextOriginProperty- Returns:
- the
textOriginproperty - See Also:
-
textAlignment
- Specified by:
textAlignmentPropertyin interfaceHasTextAlignmentProperty- Returns:
- the
textAlignmentproperty - See Also:
-
wrappingWidth
- Specified by:
wrappingWidthPropertyin interfaceHasWrappingWidthProperty- Returns:
- the
wrappingWidthproperty - See Also:
-
lineSpacing
-
y
- Specified by:
yPropertyin interfaceHasYProperty- Returns:
- the
yproperty - See Also:
-
text
- Specified by:
textPropertyin interfaceHasTextProperty- Returns:
- the
textproperty - See Also:
-
font
- Specified by:
fontPropertyin interfaceHasFontProperty- Returns:
- the
fontproperty - 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. SeeTextBoundsTypefor 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:
xPropertyin interfaceHasXProperty- Returns:
- the
xproperty - See Also:
-
textOriginProperty
- Specified by:
textOriginPropertyin interfaceHasTextOriginProperty- Returns:
- the
textOriginproperty - See Also:
-
textAlignmentProperty
- Specified by:
textAlignmentPropertyin interfaceHasTextAlignmentProperty- Returns:
- the
textAlignmentproperty - See Also:
-
wrappingWidthProperty
- Specified by:
wrappingWidthPropertyin interfaceHasWrappingWidthProperty- Returns:
- the
wrappingWidthproperty - See Also:
-
lineSpacingProperty
- Returns:
- the
lineSpacingproperty - See Also:
-
getLineSpacing
public double getLineSpacing()Gets the value of thelineSpacingproperty.- Property description:
- Returns:
- the value of the
lineSpacingproperty - See Also:
-
setLineSpacing
public void setLineSpacing(double lineSpacing) Sets the value of thelineSpacingproperty.- Property description:
- Parameters:
lineSpacing- the value for thelineSpacingproperty- See Also:
-
yProperty
- Specified by:
yPropertyin interfaceHasYProperty- Returns:
- the
yproperty - See Also:
-
textProperty
- Specified by:
textPropertyin interfaceHasTextProperty- Returns:
- the
textproperty - See Also:
-
fontProperty
- Specified by:
fontPropertyin interfaceHasFontProperty- Returns:
- the
fontproperty - See Also:
-
setBoundsType
Sets the value of theboundsTypeproperty.- 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
TextBoundsTypefor more information. - Default value:
- TextBoundsType.LOGICAL
- Parameters:
value- the value for theboundsTypeproperty- See Also:
-
getBoundsType
Gets the value of theboundsTypeproperty.- 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
TextBoundsTypefor more information. - Default value:
- TextBoundsType.LOGICAL
- Returns:
- the value of the
boundsTypeproperty - 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. SeeTextBoundsTypefor more information.- Default value:
- TextBoundsType.LOGICAL
- Returns:
- the
boundsTypeproperty - 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 thestrikethroughproperty.- Property description:
- Defines if each line of text should have a line through it.
- Default value:
- false
- Parameters:
value- the value for thestrikethroughproperty- See Also:
-
isStrikethrough
public final boolean isStrikethrough()Gets the value of thestrikethroughproperty.- Property description:
- Defines if each line of text should have a line through it.
- Default value:
- false
- Returns:
- the value of the
strikethroughproperty - See Also:
-
getBaselineOffset
public double getBaselineOffset()Description copied from interface:INodeThe '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_HEIGHTfor 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:
getBaselineOffsetin interfaceINode- Returns:
- offset of text baseline from layoutBounds.minY for non-resizable Nodes or
INode.BASELINE_OFFSET_SAME_AS_HEIGHTotherwise
-
impl_computeGeomBounds
Description copied from class:NodeComputes the geometric bounds for this Node. This method is abstract and must be implemented by each Node subclass.- Specified by:
impl_computeGeomBoundsin classNode
-