Methods Summary |
---|
public static java.awt.font.TextHitInfo | afterOffset(int offset)Returns a (leading) TextHitInfo object associated with the character
after the specified offset.
return new TextHitInfo(offset, false);
|
public static java.awt.font.TextHitInfo | beforeOffset(int offset)Returns a (trailing) TextHitInfo object associated with the character
before the specified offset.
return new TextHitInfo(offset - 1, true);
|
public boolean | equals(java.lang.Object obj)Compares this TextHitInfo object with the specified object.
if (obj instanceof TextHitInfo) {
return equals((TextHitInfo)obj);
}
return false;
|
public boolean | equals(java.awt.font.TextHitInfo thi)Compares this TextHitInfo object with the specified TextHitInfo object.
return thi != null && thi.charIdx == charIdx && thi.isTrailing == isTrailing;
|
public int | getCharIndex()Gets the index of the character hit.
return charIdx;
|
public int | getInsertionIndex()Gets the insertion index.
return isTrailing ? charIdx + 1 : charIdx;
|
public java.awt.font.TextHitInfo | getOffsetHit(int offset)Gets a TextHitInfo object with its character index at the specified
offset from the character index of this TextHitInfo.
return new TextHitInfo(charIdx + offset, isTrailing);
|
public java.awt.font.TextHitInfo | getOtherHit()Gets a TextHitInfo associated with the other side of the insertion point.
return isTrailing ? new TextHitInfo(charIdx + 1, false)
: new TextHitInfo(charIdx - 1, true);
|
public int | hashCode()Returns the hash code value of this TextHitInfo instance.
return HashCode.combine(charIdx, isTrailing);
|
public boolean | isLeadingEdge()Returns true if the leading edge of the character is hit, false if the
trailing edge of the character is hit.
return !isTrailing;
|
public static java.awt.font.TextHitInfo | leading(int charIndex)Returns a TextHitInfo object associated with the leading edge of the
character at the specified char index.
return new TextHitInfo(charIndex, false);
|
public java.lang.String | toString()Returns the textual string representation of this TextHitInfo instance.
return new String("TextHitInfo[" + charIdx + ", " + //$NON-NLS-1$ //$NON-NLS-2$
(isTrailing ? "Trailing" : "Leading") + "]" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
);
|
public static java.awt.font.TextHitInfo | trailing(int charIndex)Returns a TextHitInfo associated with the trailing edge of the character
at the specified char index.
return new TextHitInfo(charIndex, true);
|