Package org.apache.batik.bridge
Class TextHit
- java.lang.Object
-
- org.apache.batik.bridge.TextHit
-
public class TextHit extends java.lang.Object
Class that encapsulates information returned from hit testing aTextSpanLayout
instance.- Version:
- $Id: TextHit.java 1733416 2016-03-03 07:07:13Z gadams $
- See Also:
TextSpanLayout
-
-
Field Summary
Fields Modifier and Type Field Description private int
charIndex
private boolean
leadingEdge
-
Constructor Summary
Constructors Constructor Description TextHit(int charIndex, boolean leadingEdge)
Constructs a TextHit with the specified values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCharIndex()
Returns the index of the character that has been hit.boolean
isLeadingEdge()
Returns whether on not the character has been hit on its leading edge.
-
-
-
Constructor Detail
-
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 Detail
-
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.
-
-