All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.awt.font.TextHitInfo Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
/*

NOTICE


(c) 2005-2007 Sun Microsystems, Inc. All Rights Reserved.

Neither this file nor any files generated from it describe a complete specification, and they may only be used as described below. For example, no permission is given for you to incorporate this file, in whole or in part, in an implementation of a Java specification.

Sun Microsystems Inc. owns the copyright in this file and it is provided to you for informative, as opposed to normative, use. The file and any files generated from it may be used to generate other informative documentation, such as a unified set of documents of API signatures for a platform that includes technologies expressed as Java APIs. The file may also be used to produce "compilation stubs," which allow applications to be compiled and validated for such platforms.

Any work generated from this file, such as unified javadocs or compiled stub files, must be accompanied by this notice in its entirety.

This work corresponds to the API signatures of JSR 217: Personal Basis Profile 1.1. In the event of a discrepency between this work and the JSR 217 specification, which is available at http://www.jcp.org/en/jsr/detail?id=217, the latter takes precedence. */ package java.awt.font; import java.lang.String; /** * The TextHitInfo class represents a character position in a * text model, and a bias, or "side," of the character. Biases are * either leading (the left edge, for a left-to-right character) * or trailing (the right edge, for a left-to-right character). * Instances of TextHitInfo are used to specify caret and * insertion positions within text. *

* For example, consider the text "abc". TextHitInfo.trailing(1) * corresponds to the right side of the 'b' in the text. *

* Sometimes it is convenient to construct a TextHitInfo with * the same insertion offset as an existing one, but on the opposite * character. The getOtherHit method constructs a new * TextHitInfo with the same insertion offset as an existing * one, with a hit on the character on the other side of the insertion offset. * Calling getOtherHit on trailing(1) would return leading(2). * In general, getOtherHit for trailing(n) returns * leading(n+1) and getOtherHit for leading(n) * returns trailing(n-1). * * * */ public final class TextHitInfo { /* * This hidden constructor does not necessarily correspond to * a constructor in the original source file -- it keeps javadoc * from generating an inappropriate default constructor. */ private TextHitInfo() { } /** * Returns the index of the character hit. * @return the index of the character hit. */ public int getCharIndex() { return 0; } /** * Returns true if the leading edge of the character was * hit. * @return true if the leading edge of the character was * hit; false otherwise. */ public boolean isLeadingEdge() { return false; } /** * Returns the insertion index. This is the character index if * the leading edge of the character was hit, and one greater * than the character index if the trailing edge was hit. * @return the insertion index. */ public int getInsertionIndex() { return 0; } /** * Returns the hash code. * @return the hash code of this TextHitInfo, which is * also the charIndex of this TextHitInfo. */ public int hashCode() { return 0; } // PBP/PP // [5093408] : Copied language from equals(TextHitInfo) /** * Returns true if the specified Object is a * TextHitInfo and equals this TextHitInfo. * * A TextHitInfo is equal to this TextHitInfo * if and only if it has the same charIndex and * isLeadingEdge * as this TextHitInfo. This is not the same as having * the same insertion offset. * * @param obj the Object to test for equality * @return true if the specified Object * equals this TextHitInfo; false otherwise. */ public boolean equals(Object obj) { return false; } /** * Returns true if the specified TextHitInfo * has the same charIndex and isLeadingEdge * as this TextHitInfo. This is not the same as having * the same insertion offset. * @param hitInfo a specified TextHitInfo * @return true if the specified TextHitInfo * has the same charIndex and isLeadingEdge * as this TextHitInfo. */ // public boolean equals(TextHitInfo hitInfo) { // return false; // } /** * Returns a String representing the hit for debugging * use only. * @return a String representing this * TextHitInfo. */ public java.lang.String toString() { return null; } /** * Creates a TextHitInfo on the leading edge of the * character at the specified charIndex. * @param charIndex the index of the character hit * @return a TextHitInfo on the leading edge of the * character at the specified charIndex. */ public static TextHitInfo leading(int charIndex) { return null; } /** * Creates a hit on the trailing edge of the character at * the specified charIndex. * @param charIndex the index of the character hit * @return a TextHitInfo on the trailing edge of the * character at the specified charIndex. */ public static TextHitInfo trailing(int charIndex) { return null; } /** * Creates a TextHitInfo at the specified offset, * associated with the character before the offset. * @param offset an offset associated with the character before * the offset * @return a TextHitInfo at the specified offset. */ public static TextHitInfo beforeOffset(int offset) { return null; } /** * Creates a TextHitInfo at the specified offset, * associated with the character after the offset. * @param offset an offset associated with the character after * the offset * @return a TextHitInfo at the specified offset. */ public static TextHitInfo afterOffset(int offset) { return null; } /** * Creates a TextHitInfo on the other side of the * insertion point. This TextHitInfo remains unchanged. * @return a TextHitInfo on the other side of the * insertion point. */ public TextHitInfo getOtherHit() { return null; } /** * Creates a TextHitInfo whose character index is offset * by delta from the charIndex of this * TextHitInfo. This TextHitInfo remains * unchanged. * @param delta the value to offset this charIndex * @return a TextHitInfo whose charIndex is * offset by delta from the charIndex of * this TextHitInfo. */ public TextHitInfo getOffsetHit(int delta) { return null; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy