java.lang.Object
io.sf.carte.echosvg.bridge.TextHit

public class TextHit extends Object
Class that encapsulates information returned from hit testing a TextSpanLayout instance.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TextHit(int charIndex, boolean leadingEdge)
    Constructs a TextHit with the specified values.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the index of the character that has been hit.
    boolean
    Returns whether on not the character has been hit on its leading edge.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextHit

      public TextHit(int charIndex, boolean leadingEdge)
      Constructs a TextHit with the specified values.
      Parameters:
      charIndex - The index of the character that has been hit. In the case of bidirectional text this will be the logical character index not the visual index. The index is relative to whole text within the selected TextNode.
      leadingEdge - Indicates which side of the character has been hit.
  • Method Details

    • getCharIndex

      public int getCharIndex()
      Returns the index of the character that has been hit.
      Returns:
      The character index.
    • isLeadingEdge

      public boolean isLeadingEdge()
      Returns whether on not the character has been hit on its leading edge.
      Returns:
      Whether on not the character has been hit on its leading edge.