Class NTxNodeHighlight

java.lang.Object
net.thevpc.ntexup.api.document.node.NTxNodeHighlight

public class NTxNodeHighlight extends Object
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.
Highlights are attached/detached through 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

      public NTxNodeHighlight(Color color, boolean wholeNode, String... needles)
      Parameters:
      color - highlight color (typically translucent)
      wholeNode - true to tint the whole node bounds, false to tint matching text tokens
      needles - normalized needles (see NTxHighlights.normalize(String))
  • Method Details

    • getColor

      public Color getColor()
    • getNeedles

      public String[] getNeedles()
      Returns the internal needles array (no copy: called from render hot paths).
    • isWholeNode

      public boolean isWholeNode()