Hello,
I am currently developing an application where the user provides a text which is than scanned for matching words or substrings. Afterwards the matches should be highlighted in the text so that the user can easily see them.
To implement this I would like to use a Textflow where the relevant parts are instances of Text. Currently I can use the Text.setFill method to paint these parts in a different color, but I would also like to draw some a colored background behind the text. After some digging I believe to have found the correct place in the code to modify, which is the NGText.renderContent2D method. If I am not mistaken it should be possible to add the necessary code at this location, however I cannot override impl_createPeer to return my subclassed NGText.
It would be nice if you could remove the final modifier, otherwise I would probably have to create my own control for this.
I am currently developing an application where the user provides a text which is than scanned for matching words or substrings. Afterwards the matches should be highlighted in the text so that the user can easily see them.
To implement this I would like to use a Textflow where the relevant parts are instances of Text. Currently I can use the Text.setFill method to paint these parts in a different color, but I would also like to draw some a colored background behind the text. After some digging I believe to have found the correct place in the code to modify, which is the NGText.renderContent2D method. If I am not mistaken it should be possible to add the necessary code at this location, however I cannot override impl_createPeer to return my subclassed NGText.
It would be nice if you could remove the final modifier, otherwise I would probably have to create my own control for this.
- relates to
-
JDK-8092016 Add background property to Text class
-
- Open
-