@DefaultProperty(value="text") public class Text extends Shape
Text
クラスは、テキストを表示するノードを定義します。段落は\n
で区切られ、テキストは段落境界で折り返されます。
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 | プロパティと説明 |
---|---|
ReadOnlyDoubleProperty |
baselineOffset
TextノードのlayoutBounds.minYの場所からのアルファベット(またはローマン体)のベースライン・オフセット。
|
ObjectProperty<TextBoundsType> |
boundsType
テキスト・ノードの境界線の計算方法を決定します。
|
ObjectProperty<Font> |
font
テキストのフォントを定義します。
|
ObjectProperty<FontSmoothingType> |
fontSmoothingType
リクエストされたフォント・スムージング・タイプ(グレーまたはLCD)を指定します。
|
DoubleProperty |
lineSpacing
行間のピクセル単位の垂直方向の総スペースを定義します。
|
BooleanProperty |
strikethrough
テキストの各行の中央を通過する線を表示するかどうかを定義します。
|
ObjectProperty<TextAlignment> |
textAlignment
境界ボックス内のテキストの水平方向の位置合せを定義します。
|
ObjectProperty<VPos> |
textOrigin
ローカル座標のテキスト座標系の原点を定義します。
|
StringProperty |
text
表示するテキスト文字列を定義します。
|
BooleanProperty |
underline
テキストの各行の下に線を表示するかどうかを定義します。
|
DoubleProperty |
wrappingWidth
ユーザー空間座標などのテキストの幅の制約を定義します。
|
DoubleProperty |
x
テキスト原点のX座標を定義します。
|
DoubleProperty |
y
テキスト原点のY座標を定義します。
|
fill、smooth、strokeDashOffset、strokeLineCap、strokeLineJoin、strokeMiterLimit、stroke、strokeType、strokeWidth
accessibleHelp、accessibleRoleDescription、accessibleRole、accessibleText、blendMode、boundsInLocal、boundsInParent、cacheHint、cache、clip、cursor、depthTest、disabled、disable、effectiveNodeOrientation、effect、eventDispatcher、focused、focusTraversable、hover、id、inputMethodRequests、layoutBounds、layoutX、layoutY、localToParentTransform、localToSceneTransform、managed、mouseTransparent、nodeOrientation、onContextMenuRequested、onDragDetected、onDragDone、onDragDropped、onDragEntered、onDragExited、onDragOver、onInputMethodTextChanged、onKeyPressed、onKeyReleased、onKeyTyped、onMouseClicked、onMouseDragEntered、onMouseDragExited、onMouseDragged、onMouseDragOver、onMouseDragReleased、onMouseEntered、onMouseExited、onMouseMoved、onMousePressed、onMouseReleased、onRotate、onRotationFinished、onRotationStarted、onScrollFinished、onScroll、onScrollStarted、onSwipeDown、onSwipeLeft、onSwipeRight、onSwipeUp、onTouchMoved、onTouchPressed、onTouchReleased、onTouchStationary、onZoomFinished、onZoom、onZoomStarted、opacity、parent、pickOnBounds、pressed、rotate、rotationAxis、scaleX、scaleY、scaleZ、scene、style、translateX、translateY、translateZ、visible
BASELINE_OFFSET_SAME_AS_HEIGHT
コンストラクタと説明 |
---|
Text()
Textの空のインスタンスを作成します。
|
Text(double x, double y, String text)
指定された文字列を含むTextのインスタンスを指定された座標に作成します。
|
Text(String text)
指定された文字列を含むTextのインスタンスを作成します。
|
修飾子と型 | メソッドと説明 |
---|---|
ReadOnlyDoubleProperty |
baselineOffsetProperty()
TextノードのlayoutBounds.minYの場所からのアルファベット(またはローマン体)のベースライン・オフセット。
|
ObjectProperty<TextBoundsType> |
boundsTypeProperty()
テキスト・ノードの境界線の計算方法を決定します。
|
ObjectProperty<Font> |
fontProperty()
テキストのフォントを定義します。
|
ObjectProperty<FontSmoothingType> |
fontSmoothingTypeProperty()
リクエストされたフォント・スムージング・タイプ(グレーまたはLCD)を指定します。
|
double |
getBaselineOffset()
プロパティbaselineOffsetの値を取得します。
|
TextBoundsType |
getBoundsType()
プロパティboundsTypeの値を取得します。
|
static List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
List<CssMetaData<? extends Styleable,?>> |
getCssMetaData()
NodeのCssMetaDataがリフレクションなしでアクセス可能になるように、このメソッドは
Node.getClassCssMetaData() に委任する必要があります。 |
Font |
getFont()
プロパティfontの値を取得します。
|
FontSmoothingType |
getFontSmoothingType()
プロパティfontSmoothingTypeの値を取得します。
|
double |
getLineSpacing()
プロパティlineSpacingの値を取得します。
|
String |
getText()
プロパティtextの値を取得します。
|
TextAlignment |
getTextAlignment()
プロパティtextAlignmentの値を取得します。
|
VPos |
getTextOrigin()
プロパティtextOriginの値を取得します。
|
double |
getWrappingWidth()
プロパティwrappingWidthの値を取得します。
|
double |
getX()
プロパティxの値を取得します。
|
double |
getY()
プロパティyの値を取得します。
|
boolean |
isStrikethrough()
プロパティstrikethroughの値を取得します。
|
boolean |
isUnderline()
プロパティunderlineの値を取得します。
|
DoubleProperty |
lineSpacingProperty()
行間のピクセル単位の垂直方向の総スペースを定義します。
|
Object |
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
このメソッドは、属性の値をリクエストするためにアシスティブ・テクノロジによって呼び出されます。
|
void |
setBoundsType(TextBoundsType value)
プロパティboundsTypeの値を設定します。
|
void |
setFont(Font value)
プロパティfontの値を設定します。
|
void |
setFontSmoothingType(FontSmoothingType value)
プロパティfontSmoothingTypeの値を設定します。
|
void |
setLineSpacing(double spacing)
プロパティlineSpacingの値を設定します。
|
void |
setStrikethrough(boolean value)
プロパティstrikethroughの値を設定します。
|
void |
setText(String value)
プロパティtextの値を設定します。
|
void |
setTextAlignment(TextAlignment value)
プロパティtextAlignmentの値を設定します。
|
void |
setTextOrigin(VPos value)
プロパティtextOriginの値を設定します。
|
void |
setUnderline(boolean value)
プロパティunderlineの値を設定します。
|
void |
setWrappingWidth(double value)
プロパティwrappingWidthの値を設定します。
|
void |
setX(double value)
プロパティxの値を設定します。
|
void |
setY(double value)
プロパティyの値を設定します。
|
BooleanProperty |
strikethroughProperty()
テキストの各行の中央を通過する線を表示するかどうかを定義します。
|
ObjectProperty<TextAlignment> |
textAlignmentProperty()
境界ボックス内のテキストの水平方向の位置合せを定義します。
|
ObjectProperty<VPos> |
textOriginProperty()
ローカル座標のテキスト座標系の原点を定義します。
|
StringProperty |
textProperty()
表示するテキスト文字列を定義します。
|
String |
toString()
この
Text オブジェクトの文字列表現を返します。 |
BooleanProperty |
underlineProperty()
テキストの各行の下に線を表示するかどうかを定義します。
|
boolean |
usesMirroring()
ノードの向きが右から左の場合にノードをミラー化するかどうかを指定します。
|
DoubleProperty |
wrappingWidthProperty()
ユーザー空間座標などのテキストの幅の制約を定義します。
|
DoubleProperty |
xProperty()
テキスト原点のX座標を定義します。
|
DoubleProperty |
yProperty()
テキスト原点のY座標を定義します。
|
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
accessibleHelpProperty、accessibleRoleDescriptionProperty、accessibleRoleProperty、accessibleTextProperty、addEventFilter、addEventHandler、applyCss、autosize、blendModeProperty、boundsInLocalProperty、boundsInParentProperty、buildEventDispatchChain、cacheHintProperty、cacheProperty、clipProperty、computeAreaInScreen、contains、contains、cursorProperty、depthTestProperty、disabledProperty、disableProperty、effectiveNodeOrientationProperty、effectProperty、eventDispatcherProperty、executeAccessibleAction、fireEvent、focusedProperty、focusTraversableProperty、getAccessibleHelp、getAccessibleRole、getAccessibleRoleDescription、getAccessibleText、getBlendMode、getBoundsInLocal、getBoundsInParent、getCacheHint、getClip、getContentBias、getCursor、getDepthTest、getEffect、getEffectiveNodeOrientation、getEventDispatcher、getId、getInputMethodRequests、getLayoutBounds、getLayoutX、getLayoutY、getLocalToParentTransform、getLocalToSceneTransform、getNodeOrientation、getOnContextMenuRequested、getOnDragDetected、getOnDragDone、getOnDragDropped、getOnDragEntered、getOnDragExited、getOnDragOver、getOnInputMethodTextChanged、getOnKeyPressed、getOnKeyReleased、getOnKeyTyped、getOnMouseClicked、getOnMouseDragEntered、getOnMouseDragExited、getOnMouseDragged、getOnMouseDragOver、getOnMouseDragReleased、getOnMouseEntered、getOnMouseExited、getOnMouseMoved、getOnMousePressed、getOnMouseReleased、getOnRotate、getOnRotationFinished、getOnRotationStarted、getOnScroll、getOnScrollFinished、getOnScrollStarted、getOnSwipeDown、getOnSwipeLeft、getOnSwipeRight、getOnSwipeUp、getOnTouchMoved、getOnTouchPressed、getOnTouchReleased、getOnTouchStationary、getOnZoom、getOnZoomFinished、getOnZoomStarted、getOpacity、getParent、getProperties、getPseudoClassStates、getRotate、getRotationAxis、getScaleX、getScaleY、getScaleZ、getScene、getStyle、getStyleableParent、getStyleClass、getTransforms、getTranslateX、getTranslateY、getTranslateZ、getTypeSelector、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、localToParent、localToParent、localToParentTransformProperty、localToScene、localToScene、localToScene、localToScene、localToScene、localToScene、localToScene、localToScene、localToScene、localToScene、localToSceneTransformProperty、localToScreen、localToScreen、localToScreen、localToScreen、localToScreen、lookup、lookupAll、managedProperty、maxHeight、maxWidth、minHeight、minWidth、mouseTransparentProperty、nodeOrientationProperty、notifyAccessibleAttributeChanged、onContextMenuRequestedProperty、onDragDetectedProperty、onDragDoneProperty、onDragDroppedProperty、onDragEnteredProperty、onDragExitedProperty、onDragOverProperty、onInputMethodTextChangedProperty、onKeyPressedProperty、onKeyReleasedProperty、onKeyTypedProperty、onMouseClickedProperty、onMouseDragEnteredProperty、onMouseDragExitedProperty、onMouseDraggedProperty、onMouseDragOverProperty、onMouseDragReleasedProperty、onMouseEnteredProperty、onMouseExitedProperty、onMouseMovedProperty、onMousePressedProperty、onMouseReleasedProperty、onRotateProperty、onRotationFinishedProperty、onRotationStartedProperty、onScrollFinishedProperty、onScrollProperty、onScrollStartedProperty、onSwipeDownProperty、onSwipeLeftProperty、onSwipeRightProperty、onSwipeUpProperty、onTouchMovedProperty、onTouchPressedProperty、onTouchReleasedProperty、onTouchStationaryProperty、onZoomFinishedProperty、onZoomProperty、onZoomStartedProperty、opacityProperty、parentProperty、parentToLocal、parentToLocal、parentToLocal、parentToLocal、parentToLocal、pickOnBoundsProperty、prefHeight、prefWidth、pressedProperty、pseudoClassStateChanged、relocate、removeEventFilter、removeEventHandler、requestFocus、resize、resizeRelocate、rotateProperty、rotationAxisProperty、scaleXProperty、scaleYProperty、scaleZProperty、sceneProperty、sceneToLocal、sceneToLocal、sceneToLocal、sceneToLocal、sceneToLocal、sceneToLocal、sceneToLocal、sceneToLocal、screenToLocal、screenToLocal、screenToLocal、setAccessibleHelp、setAccessibleRole、setAccessibleRoleDescription、setAccessibleText、setBlendMode、setCache、setCacheHint、setClip、setCursor、setDepthTest、setDisable、setDisabled、setEffect、setEventDispatcher、setEventHandler、setFocused、setFocusTraversable、setHover、setId、setInputMethodRequests、setLayoutX、setLayoutY、setManaged、setMouseTransparent、setNodeOrientation、setOnContextMenuRequested、setOnDragDetected、setOnDragDone、setOnDragDropped、setOnDragEntered、setOnDragExited、setOnDragOver、setOnInputMethodTextChanged、setOnKeyPressed、setOnKeyReleased、setOnKeyTyped、setOnMouseClicked、setOnMouseDragEntered、setOnMouseDragExited、setOnMouseDragged、setOnMouseDragOver、setOnMouseDragReleased、setOnMouseEntered、setOnMouseExited、setOnMouseMoved、setOnMousePressed、setOnMouseReleased、setOnRotate、setOnRotationFinished、setOnRotationStarted、setOnScroll、setOnScrollFinished、setOnScrollStarted、setOnSwipeDown、setOnSwipeLeft、setOnSwipeRight、setOnSwipeUp、setOnTouchMoved、setOnTouchPressed、setOnTouchReleased、setOnTouchStationary、setOnZoom、setOnZoomFinished、setOnZoomStarted、setOpacity、setPickOnBounds、setPressed、setRotate、setRotationAxis、setScaleX、setScaleY、setScaleZ、setStyle、setTranslateX、setTranslateY、setTranslateZ、setUserData、setVisible、snapshot、snapshot、startDragAndDrop、startFullDrag、styleProperty、toBack、toFront、translateXProperty、translateYProperty、translateZProperty、visibleProperty
public final StringProperty textProperty
getText()
、setText(String)
public final DoubleProperty xProperty
getX()
、setX(double)
public final DoubleProperty yProperty
getY()
、setY(double)
public final ObjectProperty<Font> fontProperty
getFont()
、setFont(Font)
public final ObjectProperty<VPos> textOriginProperty
VPos.BASELINE
およびVPos.TOP
には上位行の原点を定義し、VPos.BOTTOM
には下位行の原点を定義します。getTextOrigin()
、setTextOrigin(VPos)
public final ObjectProperty<TextBoundsType> boundsTypeProperty
TextBoundsType
を参照してください。getBoundsType()
、setBoundsType(TextBoundsType)
public final DoubleProperty wrappingWidthProperty
> 0
である場合、この制約を満たすために、必要に応じてテキストが行折返しされます。getWrappingWidth()
、setWrappingWidth(double)
public final BooleanProperty underlineProperty
isUnderline()
、setUnderline(boolean)
public final BooleanProperty strikethroughProperty
isStrikethrough()
、setStrikethrough(boolean)
public final ObjectProperty<TextAlignment> textAlignmentProperty
getTextAlignment()
、setTextAlignment(TextAlignment)
public final DoubleProperty lineSpacingProperty
getLineSpacing()
、setLineSpacing(double)
public final ReadOnlyDoubleProperty baselineOffsetProperty
getBaselineOffset()
public final ObjectProperty<FontSmoothingType> fontSmoothingTypeProperty
getFontSmoothingType()
、setFontSmoothingType(FontSmoothingType)
public Text()
public Text(String text)
text
- インスタンスに含まれるテキストpublic Text(double x, double y, String text)
x
- テキストの水平位置y
- テキストの垂直位置text
- インスタンスに含まれるテキストpublic boolean usesMirroring()
Node
ノードがミラー化される場合は、起点が自動的に右上隅に移動され、ミラー化変換を使用して子がレイアウトされ、ノードが右から左に描画されます。ノードによっては、変換を使用せずに右から左に描画した方がよい場合があります。これらのノードに対してfalse
を指定すると、向きが右から左のときに自動変換が使用されなくなります。
usesMirroring
、クラス: Node
public final void setText(String value)
public final 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
およびVPos.TOP
には上位行の原点を定義し、VPos.BOTTOM
には下位行の原点を定義します。public final VPos getTextOrigin()
VPos.BASELINE
およびVPos.TOP
には上位行の原点を定義し、VPos.BOTTOM
には下位行の原点を定義します。public final ObjectProperty<VPos> textOriginProperty()
VPos.BASELINE
およびVPos.TOP
には上位行の原点を定義し、VPos.BOTTOM
には下位行の原点を定義します。getTextOrigin()
、setTextOrigin(VPos)
public final void setBoundsType(TextBoundsType value)
TextBoundsType
を参照してください。public final TextBoundsType getBoundsType()
TextBoundsType
を参照してください。public final ObjectProperty<TextBoundsType> boundsTypeProperty()
TextBoundsType
を参照してください。getBoundsType()
、setBoundsType(TextBoundsType)
public final void setWrappingWidth(double value)
> 0
である場合、この制約を満たすために、必要に応じてテキストが行折返しされます。public final double getWrappingWidth()
> 0
である場合、この制約を満たすために、必要に応じてテキストが行折返しされます。public final DoubleProperty wrappingWidthProperty()
> 0
である場合、この制約を満たすために、必要に応じてテキストが行折返しされます。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()
getTextAlignment()
、setTextAlignment(TextAlignment)
public final void setLineSpacing(double spacing)
public final double getLineSpacing()
public final DoubleProperty lineSpacingProperty()
getLineSpacing()
、setLineSpacing(double)
public final double getBaselineOffset()
getBaselineOffset
、クラス: Node
Node.BASELINE_OFFSET_SAME_AS_HEIGHT
public final ReadOnlyDoubleProperty baselineOffsetProperty()
getBaselineOffset()
public final void setFontSmoothingType(FontSmoothingType value)
public final FontSmoothingType getFontSmoothingType()
public final ObjectProperty<FontSmoothingType> fontSmoothingTypeProperty()
getFontSmoothingType()
、setFontSmoothingType(FontSmoothingType)
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
Node.getClassCssMetaData()
に委任する必要があります。getCssMetaData
、インタフェース: Styleable
getCssMetaData
、クラス: Shape
public String toString()
Text
オブジェクトの文字列表現を返します。public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
Node
このメソッドは一般に、特定の役割に必要な属性を実装するためにサブクラスによってオーバーライドされます。
特定の属性が処理されない場合、スーパー・クラス実装を呼び出す必要があります。
queryAccessibleAttribute
、クラス: Node
attribute
- リクエストされた属性parameters
- オプションのパラメータ・リストAccessibleAttribute
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.