Examples of TextHitInfo


Examples of com.google.code.appengine.awt.font.TextHitInfo

                thi.charIdx == charIdx &&
                thi.isTrailing == isTrailing;
    }

    public TextHitInfo getOffsetHit(int offset) {
        return new TextHitInfo(charIdx + offset, isTrailing);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

        return new TextHitInfo(charIdx + offset, isTrailing);
    }

    public TextHitInfo getOtherHit() {
        return isTrailing ?
                new TextHitInfo(charIdx+1, false) :
                new TextHitInfo(charIdx-1, true);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

    public int getCharIndex() {
        return charIdx;
    }

    public static TextHitInfo trailing(int charIndex) {
        return new TextHitInfo(charIndex, true);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

    public static TextHitInfo trailing(int charIndex) {
        return new TextHitInfo(charIndex, true);
    }

    public static TextHitInfo leading(int charIndex) {
        return new TextHitInfo(charIndex, false);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

    public static TextHitInfo leading(int charIndex) {
        return new TextHitInfo(charIndex, false);
    }

    public static TextHitInfo beforeOffset(int offset) {
        return new TextHitInfo(offset-1, true);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

    public static TextHitInfo beforeOffset(int offset) {
        return new TextHitInfo(offset-1, true);
    }

    public static TextHitInfo afterOffset(int offset) {
        return new TextHitInfo(offset, false);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

        if (visual == breaker.getCharCount()) {
            return null;
        }

        TextHitInfo newInfo;

        while(visual <= breaker.getCharCount()) {
            visual++;
            newInfo = getHitInfoFromVisual(visual);

            if (newInfo.getCharIndex() >= breaker.logical2segment.length) {
                return newInfo;
            }

            if (hitInfo.getCharIndex() >= 0) { // Don't check for leftmost info
                if (
                        breaker.logical2segment[newInfo.getCharIndex()] !=
                        breaker.logical2segment[hitInfo.getCharIndex()]
                ) {
                    return newInfo; // We crossed segment boundary
                }
            }

            TextRunSegment seg = breaker.runSegments.get(breaker.logical2segment[newInfo
                    .getCharIndex()]);
            if (!seg.charHasZeroAdvance(newInfo.getCharIndex())) {
                return newInfo;
            }
        }

        return null;
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

        if (visual == 0) {
            return null;
        }

        TextHitInfo newInfo;

        while(visual >= 0) {
            visual--;
            newInfo = getHitInfoFromVisual(visual);

            if (newInfo.getCharIndex() < 0) {
                return newInfo;
            }

            // Don't check for rightmost info
            if (hitInfo.getCharIndex() < breaker.logical2segment.length) {
                if (
                        breaker.logical2segment[newInfo.getCharIndex()] !=
                        breaker.logical2segment[hitInfo.getCharIndex()]
                ) {
                    return newInfo; // We crossed segment boundary
                }
            }

            TextRunSegment seg = breaker.runSegments.get(breaker.logical2segment[newInfo
                    .getCharIndex()]);
            if (!seg.charHasZeroAdvance(newInfo.getCharIndex())) {
                return newInfo;
            }
        }

        return null;
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

     */
    public Shape[] getCaretShapes(
            int offset, Rectangle2D bounds,
            TextLayout.CaretPolicy policy, TextLayout layout
    ) {
        TextHitInfo hit1 = TextHitInfo.afterOffset(offset);
        TextHitInfo hit2 = getVisualOtherHit(hit1);

        Shape caret1 = getCaretShape(hit1, layout);

        if (getVisualFromHitInfo(hit1) == getVisualFromHitInfo(hit2)) {
            return new Shape[] {caret1, null};
        }
        Shape caret2 = getCaretShape(hit2, layout);

        TextHitInfo strongHit = policy.getStrongCaret(hit1, hit2, layout);
        return strongHit.equals(hit1) ?
                new Shape[] {caret1, caret2} :
                new Shape[] {caret2, caret1};
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.TextHitInfo

    ) {
        GeneralPath res = new GeneralPath();

        for (int i=firstEndpoint; i<=secondEndpoint; i++) {
            int endRun = breaker.getLevelRunLimit(i, secondEndpoint);
            TextHitInfo hit1 = TextHitInfo.leading(i);
            TextHitInfo hit2 = TextHitInfo.trailing(endRun-1);

            Line2D caret1 = getCaretShape(hit1, layout, false, true, bounds);
            Line2D caret2 = getCaretShape(hit2, layout, false, true, bounds);

            res.append(connectCarets(caret1, caret2), false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.