Spec-Zone .ru
спецификации, руководства, описания, API
|
public final class Text extends Shape
Text
class defines a node that displays a text.
Paragraphs are separated by '\n'
and the text is wrapped on
paragraph boundaries.
import javafx.scene.text.*; Text t = new Text(10, 50, "This is a test"); t.setFont(new Font(20));
import javafx.scene.text.*; Text t = new Text(); text.setFont(new Font(20)); text.setText("First row\nSecond row");
import javafx.scene.text.*; Text t = new Text(); text.setFont(new Font(20)); text.setWrappingWidth(200); text.setTextAlignment(TextAlignment.JUSTIFY) text.setText("The quick brown fox jumps over the lazy dog");
Type | Property and Description |
---|---|
ReadOnlyDoubleProperty |
baselineOffset
The 'alphabetic' (or roman) baseline offset from the Text node's layoutBounds.minY location.
|
ObjectProperty<TextBoundsType> |
boundsType
Determines how the bounds of the text node are calculated.
|
ObjectProperty<Font> |
font
Defines the font of text.
|
BooleanProperty |
strikethrough
Defines if each line of text should have a line through it.
|
ObjectProperty<TextAlignment> |
textAlignment
Defines horizontal text alignment in the bounding box.
|
ObjectProperty<VPos> |
textOrigin
Defines the origin of text coordinate system in local coordinates.
|
StringProperty |
text
Defines text string that is to be displayed.
|
BooleanProperty |
underline
Defines if each line of text should have a line below it.
|
DoubleProperty |
wrappingWidth
Defines a width constraint for the text in user space coordinates,
e.g.
|
DoubleProperty |
x
Defines the X coordinate of text origin.
|
DoubleProperty |
y
Defines the Y coordinate of text origin.
|
fillProperty, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty
blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
Constructor and Description |
---|
Text()
Creates an empty instance of Text.
|
Text(double x,
double y,
java.lang.String text)
Creates an instance of Text on the given coordinates containing the
given string.
|
Text(java.lang.String text)
Creates an instance of Text containing the given string.
|
Modifier and Type | Method and Description |
---|---|
ReadOnlyDoubleProperty |
baselineOffsetProperty()
The 'alphabetic' (or roman) baseline offset from the Text node's layoutBounds.minY location.
|
ObjectProperty<TextBoundsType> |
boundsTypeProperty()
Determines how the bounds of the text node are calculated.
|
ObjectProperty<Font> |
fontProperty()
Defines the font of text.
|
double |
getBaselineOffset()
The 'alphabetic' (or roman) baseline offset from the Text node's layoutBounds.minY location.
|
TextBoundsType |
getBoundsType()
Determines how the bounds of the text node are calculated.
|
Font |
getFont()
Defines the font of text.
|
java.lang.String |
getText()
Defines text string that is to be displayed.
|
TextAlignment |
getTextAlignment()
Defines horizontal text alignment in the bounding box.
|
VPos |
getTextOrigin()
Defines the origin of text coordinate system in local coordinates.
|
double |
getWrappingWidth()
Defines a width constraint for the text in user space coordinates,
e.g.
|
double |
getX()
Defines the X coordinate of text origin.
|
double |
getY()
Defines the Y coordinate of text origin.
|
boolean |
isStrikethrough()
Defines if each line of text should have a line through it.
|
boolean |
isUnderline()
Defines if each line of text should have a line below it.
|
void |
setBoundsType(TextBoundsType value)
Determines how the bounds of the text node are calculated.
|
void |
setFont(Font value)
Defines the font of text.
|
void |
setStrikethrough(boolean value)
Defines if each line of text should have a line through it.
|
void |
setText(java.lang.String value)
Defines text string that is to be displayed.
|
void |
setTextAlignment(TextAlignment value)
Defines horizontal text alignment in the bounding box.
|
void |
setTextOrigin(VPos value)
Defines the origin of text coordinate system in local coordinates.
|
void |
setUnderline(boolean value)
Defines if each line of text should have a line below it.
|
void |
setWrappingWidth(double value)
Defines a width constraint for the text in user space coordinates,
e.g.
|
void |
setX(double value)
Defines the X coordinate of text origin.
|
void |
setY(double value)
Defines the Y coordinate of text origin.
|
BooleanProperty |
strikethroughProperty()
Defines if each line of text should have a line through it.
|
ObjectProperty<TextAlignment> |
textAlignmentProperty()
Defines horizontal text alignment in the bounding box.
|
ObjectProperty<VPos> |
textOriginProperty()
Defines the origin of text coordinate system in local coordinates.
|
StringProperty |
textProperty()
Defines text string that is to be displayed.
|
BooleanProperty |
underlineProperty()
Defines if each line of text should have a line below it.
|
DoubleProperty |
wrappingWidthProperty()
Defines a width constraint for the text in user space coordinates,
e.g.
|
DoubleProperty |
xProperty()
Defines the X coordinate of text origin.
|
DoubleProperty |
yProperty()
Defines the Y coordinate of text origin.
|
fillProperty, getFill, getStroke, getStrokeDashArray, getStrokeDashOffset, getStrokeLineCap, getStrokeLineJoin, getStrokeMiterLimit, getStrokeType, getStrokeWidth, intersect, isSmooth, setFill, setSmooth, setStroke, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeType, setStrokeWidth, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract, union
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOpacity, getParent, getProperties, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScene, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, startDragAndDrop, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
getText()
,
setText(String)
getX()
,
setX(double)
getY()
,
setY(double)
getFont()
,
setFont(Font)
VPos.BASELINE
and
VPos.TOP
define the origin of the top row while
VPos.BOTTOM
defines the origin of the bottom row.getTextOrigin()
,
setTextOrigin(VPos)
TextBoundsType
for more information.getBoundsType()
,
setBoundsType(TextBoundsType)
> 0
text will be line wrapped as needed
to satisfy this constraint.getWrappingWidth()
,
setWrappingWidth(double)
isUnderline()
,
setUnderline(boolean)
isStrikethrough()
,
setStrikethrough(boolean)
getBaselineOffset()
public Text()
public Text(java.lang.String text)
text
- text to be contained in the instancepublic Text(double x, double y, java.lang.String text)
x
- the horizontal position of the texty
- the vertical position of the texttext
- text to be contained in the instancepublic final void setText(java.lang.String value)
public final java.lang.String getText()
public final StringProperty textProperty()
getText()
,
setText(String)
public final void setX(double value)
public final double getX()
public final DoubleProperty xProperty()
getX()
,
setX(double)
public final void setY(double value)
public final double getY()
public final DoubleProperty yProperty()
getY()
,
setY(double)
public final void setFont(Font value)
public final Font getFont()
public final ObjectProperty<Font> fontProperty()
getFont()
,
setFont(Font)
public final void setTextOrigin(VPos value)
VPos.BASELINE
and
VPos.TOP
define the origin of the top row while
VPos.BOTTOM
defines the origin of the bottom row.public final VPos getTextOrigin()
VPos.BASELINE
and
VPos.TOP
define the origin of the top row while
VPos.BOTTOM
defines the origin of the bottom row.public final ObjectProperty<VPos> textOriginProperty()
VPos.BASELINE
and
VPos.TOP
define the origin of the top row while
VPos.BOTTOM
defines the origin of the bottom row.getTextOrigin()
,
setTextOrigin(VPos)
public final void setBoundsType(TextBoundsType value)
TextBoundsType
for more information.public final TextBoundsType getBoundsType()
TextBoundsType
for more information.public final ObjectProperty<TextBoundsType> boundsTypeProperty()
TextBoundsType
for more information.getBoundsType()
,
setBoundsType(TextBoundsType)
public final void setWrappingWidth(double value)
> 0
text will be line wrapped as needed
to satisfy this constraint.public final double getWrappingWidth()
> 0
text will be line wrapped as needed
to satisfy this constraint.public final DoubleProperty wrappingWidthProperty()
> 0
text will be line wrapped as needed
to satisfy this constraint.getWrappingWidth()
,
setWrappingWidth(double)
public final void setUnderline(boolean value)
public final boolean isUnderline()
public final BooleanProperty underlineProperty()
isUnderline()
,
setUnderline(boolean)
public final void setStrikethrough(boolean value)
public final boolean isStrikethrough()
public final BooleanProperty strikethroughProperty()
isStrikethrough()
,
setStrikethrough(boolean)
public final void setTextAlignment(TextAlignment value)
public final TextAlignment getTextAlignment()
public final ObjectProperty<TextAlignment> textAlignmentProperty()
public final double getBaselineOffset()
getBaselineOffset
in class Node
public final ReadOnlyDoubleProperty baselineOffsetProperty()
getBaselineOffset()
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to