Class NTxNodeHighlight
java.lang.Object
net.thevpc.ntexup.api.document.node.NTxNodeHighlight
MVC search-highlight model bound to a single node. It states what is
highlighted on that node (a color plus the normalized needles to match),
while node renderers decide where and how to paint it:
- text-based renderers (subclasses of
net.thevpc.ntexup.engine.renderer.text.NTxTextBaseRenderer) paint one rounded rectangle behind each matching token (isWholeNode()== false); - any other renderer paints a single rounded rectangle over the node's
layout bounds (
isWholeNode()== true), which covers equations and other non-text content.
NTxHighlights (stored in the
node's user-object map, so they survive render-cache invalidation) and are
only painted by hosts that enable the
NTxRendererContext.CAPABILITY_SEARCH_HIGHLIGHTS
capability (the screen viewer); PDF/HTML/image renders stay clean.- See Also:
-
Constructor Details
-
NTxNodeHighlight
- Parameters:
color- highlight color (typically translucent)wholeNode-trueto tint the whole node bounds,falseto tint matching text tokensneedles- normalized needles (seeNTxHighlights.normalize(String))
-
-
Method Details
-
getColor
-
getNeedles
Returns the internal needles array (no copy: called from render hot paths). -
isWholeNode
public boolean isWholeNode()
-