Top Description Inners Fields Constructors Methods
org.fxmisc.richtext

public Class TextExt

extends Text
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, javafx.beans.property.ObjectProperty, javafx.css.converter.SizeConverter, javafx.css.CssMetaData, .StyleConverter, .Styleable, .StyleableObjectProperty, javafx.scene.paint.Color, .Paint, javafx.scene.shape.StrokeLineCap, .StrokeType, javafx.scene.text.Text

A class which adds some more RichTextFX-specific styleable properties to JavaFX's Text class. The extra items can be styled using the properties (and accessors/mutators) or via CSS. Each property is documented with its CSS property. Each CSS property begins with the "-rtfx" prefix.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final StyleableObjectProperty<Paint>
private final StyleableObjectProperty<Paint>
private final StyleableObjectProperty<Number[]>
private final StyleableObjectProperty<StrokeType>
private final StyleableObjectProperty<Number>
private static final List<CssMetaData<? extends Styleable, ?>>
private final StyleableObjectProperty<StrokeLineCap>
private final StyleableObjectProperty<Paint>
private final StyleableObjectProperty<Number[]>
private final StyleableObjectProperty<Number>
private final StyleableObjectProperty<Number>
private final StyleableObjectProperty<Number>
private final StyleableObjectProperty<Number>

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public ObjectProperty<Paint>
backgroundColorProperty()

The background color of the section of text.

public ObjectProperty<Paint>
borderStrokeColorProperty()

The border stroke color of the section of text.

public ObjectProperty<Number[]>
borderStrokeDashArrayProperty()

The dash array used for drawing the border for a section of text.

public ObjectProperty<StrokeType>
borderStrokeTypeProperty()

The stroke type of the border stroke.

public ObjectProperty<Number>
borderStrokeWidthProperty()

The width of the border stroke.

public Paint
public Paint
public Number[]
public StrokeType
public Number
public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Overrides javafx.scene.text.Text.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

public StrokeLineCap
public Paint
public Number[]
public Number
public Number
public Number
public Number
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public ObjectProperty<StrokeLineCap>
underlineCapProperty()

The end cap style used for drawing each dash in a dashed underline for a section of text.

public ObjectProperty<Paint>
underlineColorProperty()

The underline color of the section of text.

public ObjectProperty<Number[]>
underlineDashArrayProperty()

The dash array used for drawing the underline for a section of text.

public ObjectProperty<Number>
underlineDoubleGapProperty()

The size of the gap between two parallel underline lines or wave forms.

public ObjectProperty<Number>
underlineOffsetProperty()

The offset of the underline for a section of text.

public ObjectProperty<Number>
underlineWaveRadiusProperty()

The arc radius used to draw a wavy underline.

public ObjectProperty<Number>
underlineWidthProperty()

The width of the underline for a section of text.

Inherited from javafx.scene.text.Text:
baselineOffsetPropertyboundsTypePropertycaretBiasPropertycaretPositionPropertycaretShapecaretShapePropertyfontPropertyfontSmoothingTypePropertygetBaselineOffsetgetBoundsTypegetCaretPositiongetCaretShapegetClassCssMetaDatagetFontgetFontSmoothingTypegetLineSpacinggetSelectionEndgetSelectionFillgetSelectionShapegetSelectionStartgetTabSizegetTextgetTextAlignmentgetTextOrigingetWrappingWidthgetXgetYhitTestisCaretBiasisStrikethroughisUnderlinelineSpacingPropertyqueryAccessibleAttributerangeShapeselectionEndPropertyselectionFillPropertyselectionShapePropertyselectionStartPropertysetBoundsTypesetCaretBiassetCaretPositionsetFontsetFontSmoothingTypesetLineSpacingsetSelectionEndsetSelectionFillsetSelectionStartsetStrikethroughsetTabSizesetTextsetTextAlignmentsetTextOriginsetUnderlinesetWrappingWidthsetXsetYstrikethroughPropertytabSizePropertytextAlignmentPropertytextOriginPropertytextPropertytoStringunderlinePropertyunderlineShapeusesMirroringwrappingWidthPropertyxPropertyyProperty

Field Detail

backgroundColorback to summary
private final StyleableObjectProperty<Paint> backgroundColor
borderStrokeColorback to summary
private final StyleableObjectProperty<Paint> borderStrokeColor
borderStrokeDashArrayback to summary
private final StyleableObjectProperty<Number[]> borderStrokeDashArray
borderStrokeTypeback to summary
private final StyleableObjectProperty<StrokeType> borderStrokeType
borderStrokeWidthback to summary
private final StyleableObjectProperty<Number> borderStrokeWidth
CSS_META_DATA_LISTback to summary
private static final List<CssMetaData<? extends Styleable, ?>> CSS_META_DATA_LIST
underlineCapback to summary
private final StyleableObjectProperty<StrokeLineCap> underlineCap
underlineColorback to summary
private final StyleableObjectProperty<Paint> underlineColor
underlineDashArrayback to summary
private final StyleableObjectProperty<Number[]> underlineDashArray
underlineDoubleGapback to summary
private final StyleableObjectProperty<Number> underlineDoubleGap
underlineOffsetback to summary
private final StyleableObjectProperty<Number> underlineOffset
underlineWaveRadiusback to summary
private final StyleableObjectProperty<Number> underlineWaveRadius
underlineWidthback to summary
private final StyleableObjectProperty<Number> underlineWidth

Constructor Detail

TextExtback to summary
public TextExt(String text)
TextExtback to summary
public TextExt()

Method Detail

backgroundColorPropertyback to summary
public ObjectProperty<Paint> backgroundColorProperty()

The background color of the section of text. By default, JavaFX doesn't support a background for Text (as it is a Shape item), but RichTextFX does support drawing a different background for different sections of text.

Note that this is actually a Paint type, so you can specify gradient or image fills rather than a flat colour. But due to line wrapping, it's possible that the fill may be used multiple times on separate lines even for the same segment of text.

Can be styled from CSS using the "-rtfx-background-color" property.
borderStrokeColorPropertyback to summary
public ObjectProperty<Paint> borderStrokeColorProperty()

The border stroke color of the section of text. By default, JavaFX doesn't support a border for Text (as it is a Shape item), but RichTextFX does support drawing a different background for different sections of text. The border will only be drawn if this has a non-null value and borderStrokeWidthProperty() a positive value

Note that this is actually a Paint type, so you can specify gradient or image fills rather than a flat colour. But due to line wrapping, it's possible that the fill may be used multiple times on separate lines even for the same segment of text.

Can be styled from CSS using the "-rtfx-border-stroke-color" property.
borderStrokeDashArrayPropertyback to summary
public ObjectProperty<Number[]> borderStrokeDashArrayProperty()

The dash array used for drawing the border for a section of text. The border stroke will only be drawn if borderStrokeColorProperty() (which determines the color) has a non-null value. See borderStrokeColorProperty() for more details. Can be styled from CSS using the "-rtfx-border-stroke-dash-array" property.

borderStrokeTypePropertyback to summary
public ObjectProperty<StrokeType> borderStrokeTypeProperty()

The stroke type of the border stroke. The border stroke will only be drawn if borderStrokeColorProperty() (which determines the color) has a non-null value. See borderStrokeColorProperty() for more details. Can be styled from CSS using the "-rtfx-border-stroke-type" property.

borderStrokeWidthPropertyback to summary
public ObjectProperty<Number> borderStrokeWidthProperty()

The width of the border stroke. The border stroke will only be drawn if borderStrokeColorProperty() (which determines the color) has a non-null value. See borderStrokeColorProperty() for more details. Can be styled from CSS using the "-rtfx-border-stroke-width" property.

getBackgroundColorback to summary
public Paint getBackgroundColor()
getBorderStrokeColorback to summary
public Paint getBorderStrokeColor()
getBorderStrokeDashArrayback to summary
public Number[] getBorderStrokeDashArray()
getBorderStrokeTypeback to summary
public StrokeType getBorderStrokeType()
getBorderStrokeWidthback to summary
public Number getBorderStrokeWidth()
getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.text.Text.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.scene.text.Text.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

Annotations
@Override
getUnderlineCapback to summary
public StrokeLineCap getUnderlineCap()
getUnderlineColorback to summary
public Paint getUnderlineColor()
getUnderlineDashArrayback to summary
public Number[] getUnderlineDashArray()
getUnderlineDoubleGapback to summary
public Number getUnderlineDoubleGap()
getUnderlineOffsetback to summary
public Number getUnderlineOffset()
getUnderlineWaveRadiusback to summary
public Number getUnderlineWaveRadius()
getUnderlineWidthback to summary
public Number getUnderlineWidth()
setBackgroundColorback to summary
public void setBackgroundColor(Paint fill)
setBorderStrokeColorback to summary
public void setBorderStrokeColor(Paint fill)
setBorderStrokeDashArrayback to summary
public void setBorderStrokeDashArray(Number[] array)
setBorderStrokeTypeback to summary
public void setBorderStrokeType(StrokeType type)
setBorderStrokeWidthback to summary
public void setBorderStrokeWidth(Number width)
setUnderlineCapback to summary
public void setUnderlineCap(StrokeLineCap cap)
setUnderlineColorback to summary
public void setUnderlineColor(Paint fill)
setUnderlineDashArrayback to summary
public void setUnderlineDashArray(Number[] dashArray)
setUnderlineDoubleGapback to summary
public void setUnderlineDoubleGap(Number radius)
setUnderlineOffsetback to summary
public void setUnderlineOffset(Number width)
setUnderlineWaveRadiusback to summary
public void setUnderlineWaveRadius(Number radius)
setUnderlineWidthback to summary
public void setUnderlineWidth(Number width)
underlineCapPropertyback to summary
public ObjectProperty<StrokeLineCap> underlineCapProperty()

The end cap style used for drawing each dash in a dashed underline for a section of text. Can be styled from CSS using the "-rtfx-underline-cap" property.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

underlineColorPropertyback to summary
public ObjectProperty<Paint> underlineColorProperty()

The underline color of the section of text.

Note that this is actually a Paint type, so you can specify gradient or image fills rather than a flat colour. But due to line wrapping, it's possible that the fill may be used multiple times on separate lines even for the same segment of text.

Can be styled from CSS using the "-rtfx-underline-color" property (not to be confused with JavaFX's separate "-fx-underline" property).

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

underlineDashArrayPropertyback to summary
public ObjectProperty<Number[]> underlineDashArrayProperty()

The dash array used for drawing the underline for a section of text. Can be styled from CSS using the "-rtfx-underline-dash-array" property.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

underlineDoubleGapPropertyback to summary
public ObjectProperty<Number> underlineDoubleGapProperty()

The size of the gap between two parallel underline lines or wave forms. If null or zero, the underline will be a single line or wave form. Can be styled from CSS using the "-rtfx-underline-double-gap" property.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

underlineOffsetPropertyback to summary
public ObjectProperty<Number> underlineOffsetProperty()

The offset of the underline for a section of text. If null or zero, the underline will be drawn along the baseline of the text. Can be styled from CSS using the "-rtfx-underline-offset" property.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

underlineWaveRadiusPropertyback to summary
public ObjectProperty<Number> underlineWaveRadiusProperty()

The arc radius used to draw a wavy underline. If null or zero, the underline will be a simple line. Can be styled from CSS using the "-rtfx-underline-wave-radius" property.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

underlineWidthPropertyback to summary
public ObjectProperty<Number> underlineWidthProperty()

The width of the underline for a section of text. If null or zero, the underline will not be drawn. Can be styled from CSS using the "-rtfx-underline-width" property.

Note that the underline properties specified here are orthogonal to the underlineProperty() inherited from Text. The underline properties defined here in TextExt will cause an underline to be drawn if underlineWidthProperty() is non-null and greater than zero, regardless of the value of underlineProperty().

org.fxmisc.richtext back to summary

private Class TextExt.StyleableProperties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<TextExt, Paint>
private static final CssMetaData<TextExt, Paint>
private static final CssMetaData<TextExt, Number[]>
private static final CssMetaData<TextExt, StrokeType>
private static final CssMetaData<TextExt, Number>
private static final CssMetaData<TextExt, StrokeLineCap>
private static final CssMetaData<TextExt, Paint>
private static final CssMetaData<TextExt, Number[]>
private static final CssMetaData<TextExt, Number>
private static final CssMetaData<TextExt, Number>
private static final CssMetaData<TextExt, Number>
private static final CssMetaData<TextExt, Number>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BACKGROUND_COLORback to summary
private static final CssMetaData<TextExt, Paint> BACKGROUND_COLOR
BORDER_COLORback to summary
private static final CssMetaData<TextExt, Paint> BORDER_COLOR
BORDER_DASH_ARRAYback to summary
private static final CssMetaData<TextExt, Number[]> BORDER_DASH_ARRAY
BORDER_TYPEback to summary
private static final CssMetaData<TextExt, StrokeType> BORDER_TYPE
BORDER_WIDTHback to summary
private static final CssMetaData<TextExt, Number> BORDER_WIDTH
UNDERLINE_CAPback to summary
private static final CssMetaData<TextExt, StrokeLineCap> UNDERLINE_CAP
UNDERLINE_COLORback to summary
private static final CssMetaData<TextExt, Paint> UNDERLINE_COLOR
UNDERLINE_DASH_ARRAYback to summary
private static final CssMetaData<TextExt, Number[]> UNDERLINE_DASH_ARRAY
UNDERLINE_DOUBLE_GAPback to summary
private static final CssMetaData<TextExt, Number> UNDERLINE_DOUBLE_GAP
UNDERLINE_OFFSETback to summary
private static final CssMetaData<TextExt, Number> UNDERLINE_OFFSET
UNDERLINE_WAVE_RADIUSback to summary
private static final CssMetaData<TextExt, Number> UNDERLINE_WAVE_RADIUS
UNDERLINE_WIDTHback to summary
private static final CssMetaData<TextExt, Number> UNDERLINE_WIDTH

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()