Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8307861

TextFlow.underlineShape()

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • jfx21
    • javafx
    • None
    • source
    • minimal
    • Hide
      This change adds a new method to a non-final public class.
      This might cause a source incompatibility in the case when child class declares a method with the same signature.
      Show
      This change adds a new method to a non-final public class. This might cause a source incompatibility in the case when child class declares a method with the same signature.
    • Java API
    • JDK

      Summary

      Adding TextFlow.underlineShape() to add support for a spellchecker-like decoration, mirroring a similar method in Text with the same signature.

      Problem

      Underline shape in TextFlow is needed to enable spellchecker decoration (squiggly line) under text region that might span multiple Text segments.

      Solution

      Add a new method, TextFlow.underlineShape(int, int).

      Specification

      /modules/javafx.graphics/src/main/java/javafx/scene/text/TextFlow.java

      +    /**
      +     * Returns the shape for the underline in local coordinates.
      +     *
      +     * @param start the beginning character index for the range
      +     * @param end the end character index (non-inclusive) for the range
      +     * @return an array of {@code PathElement} which can be used to create a {@code Shape}
      +     * @since 21
      +     */
      +    public final PathElement[] underlineShape(int start, int end) {

            angorya Andy Goryachev
            angorya Andy Goryachev
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: