Class TextExt

  • All Implemented Interfaces:
    Styleable, EventTarget

    public class TextExt
    extends 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 Text.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 Text.underlineProperty().

    • Constructor Detail

      • TextExt

        public TextExt​(String text)
      • TextExt

        public TextExt()
    • Method Detail

      • getBackgroundColor

        public Paint getBackgroundColor()
        Gets the value of the property backgroundColor.
        Property description:
        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.
      • setBackgroundColor

        public void setBackgroundColor​(Paint fill)
        Sets the value of the property backgroundColor.
        Property description:
        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.
      • backgroundColorProperty

        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.
        See Also:
        getBackgroundColor(), setBackgroundColor(Paint)
      • getBorderStrokeColor

        public Paint getBorderStrokeColor()
        Gets the value of the property borderStrokeColor.
        Property description:
        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.
      • setBorderStrokeColor

        public void setBorderStrokeColor​(Paint fill)
        Sets the value of the property borderStrokeColor.
        Property description:
        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.
      • borderStrokeColorProperty

        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.
        See Also:
        getBorderStrokeColor(), setBorderStrokeColor(Paint)
      • getBorderStrokeWidth

        public Number getBorderStrokeWidth()
        Gets the value of the property borderStrokeWidth.
        Property description:
        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.
      • setBorderStrokeWidth

        public void setBorderStrokeWidth​(Number width)
        Sets the value of the property borderStrokeWidth.
        Property description:
        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.
      • getBorderStrokeType

        public StrokeType getBorderStrokeType()
        Gets the value of the property borderStrokeType.
        Property description:
        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.
      • setBorderStrokeType

        public void setBorderStrokeType​(StrokeType type)
        Sets the value of the property borderStrokeType.
        Property description:
        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.
      • getBorderStrokeDashArray

        public Number[] getBorderStrokeDashArray()
        Gets the value of the property borderStrokeDashArray.
        Property description:
        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.
      • setBorderStrokeDashArray

        public void setBorderStrokeDashArray​(Number[] array)
        Sets the value of the property borderStrokeDashArray.
        Property description:
        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.
      • getUnderlineColor

        public Paint getUnderlineColor()
        Gets the value of the property underlineColor.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineColor

        public void setUnderlineColor​(Paint fill)
        Sets the value of the property underlineColor.
        Property description:
        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 Text.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 Text.underlineProperty().

      • underlineColorProperty

        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 Text.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 Text.underlineProperty().

        See Also:
        getUnderlineColor(), setUnderlineColor(Paint)
      • getUnderlineWidth

        public Number getUnderlineWidth()
        Gets the value of the property underlineWidth.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineWidth

        public void setUnderlineWidth​(Number width)
        Sets the value of the property underlineWidth.
        Property description:
        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 Text.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 Text.underlineProperty().

      • getUnderlineOffset

        public Number getUnderlineOffset()
        Gets the value of the property underlineOffset.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineOffset

        public void setUnderlineOffset​(Number width)
        Sets the value of the property underlineOffset.
        Property description:
        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 Text.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 Text.underlineProperty().

      • getUnderlineWaveRadius

        public Number getUnderlineWaveRadius()
        Gets the value of the property underlineWaveRadius.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineWaveRadius

        public void setUnderlineWaveRadius​(Number radius)
        Sets the value of the property underlineWaveRadius.
        Property description:
        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 Text.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 Text.underlineProperty().

      • getUnderlineDoubleGap

        public Number getUnderlineDoubleGap()
        Gets the value of the property underlineDoubleGap.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineDoubleGap

        public void setUnderlineDoubleGap​(Number radius)
        Sets the value of the property underlineDoubleGap.
        Property description:
        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 Text.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 Text.underlineProperty().

      • getUnderlineDashArray

        public Number[] getUnderlineDashArray()
        Gets the value of the property underlineDashArray.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineDashArray

        public void setUnderlineDashArray​(Number[] dashArray)
        Sets the value of the property underlineDashArray.
        Property description:
        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 Text.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 Text.underlineProperty().

      • getUnderlineCap

        public StrokeLineCap getUnderlineCap()
        Gets the value of the property underlineCap.
        Property description:
        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 Text.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 Text.underlineProperty().

      • setUnderlineCap

        public void setUnderlineCap​(StrokeLineCap cap)
        Sets the value of the property underlineCap.
        Property description:
        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 Text.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 Text.underlineProperty().