--- a/modules/graphics/src/main/java/javafx/scene/text/TextFlow.java Thu Sep 10 18:27:06 2015 +1200 +++ b/modules/graphics/src/main/java/javafx/scene/text/TextFlow.java Thu Sep 10 20:21:10 2015 -0400 @@ -39,6 +39,7 @@ import javafx.scene.AccessibleRole; import javafx.scene.Node; import javafx.scene.layout.Pane; +import javafx.scene.shape.PathElement; import javafx.css.StyleableDoubleProperty; import javafx.css.StyleableObjectProperty; import javafx.css.CssMetaData; @@ -437,6 +438,15 @@ return top - getTextLayout().getBounds().getMinY(); } + public PathElement[] getCaretShape(int charIdx, boolean isLeading) { + return getTextLayout().getCaretShape(charIdx, isLeading, 0.0f, 0.0f); + } + + public PathElement[] getSelectionShape(int from, int to) { + return getTextLayout().getRange(from, to, TextLayout.TYPE_TEXT, 0, 0); + } + + /*************************************************************************** * * * Stylesheet Handling *