Java Code Examples for java.awt.font.TextLayout.getLogicalHighlightShape()

The following are Jave code examples for showing how to use getLogicalHighlightShape() of the java.awt.font.TextLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: OpenJSharp   File: TextMeasureTests.java   Source Code and License Vote up 6 votes
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    int len = tlctx.text.length();
    Rectangle2D lb = tlctx.lb;
    Shape s;
    if (len < 3) {
        do {
            s = tl.getLogicalHighlightShape(0, len, lb);
        } while (--numReps >= 0);
    } else {
        do {
            for (int i = 3; i < len; ++i) {
                s = tl.getLogicalHighlightShape(i-3, i, lb);
            }
        } while (--numReps >= 0);
    }
}
 
Example 2
Project: jdk8u-jdk   File: TextMeasureTests.java   Source Code and License Vote up 6 votes
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    int len = tlctx.text.length();
    Rectangle2D lb = tlctx.lb;
    Shape s;
    if (len < 3) {
        do {
            s = tl.getLogicalHighlightShape(0, len, lb);
        } while (--numReps >= 0);
    } else {
        do {
            for (int i = 3; i < len; ++i) {
                s = tl.getLogicalHighlightShape(i-3, i, lb);
            }
        } while (--numReps >= 0);
    }
}
 
Example 3
Project: openjdk-jdk10   File: TextMeasureTests.java   Source Code and License Vote up 6 votes
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    int len = tlctx.text.length();
    Rectangle2D lb = tlctx.lb;
    Shape s;
    if (len < 3) {
        do {
            s = tl.getLogicalHighlightShape(0, len, lb);
        } while (--numReps >= 0);
    } else {
        do {
            for (int i = 3; i < len; ++i) {
                s = tl.getLogicalHighlightShape(i-3, i, lb);
            }
        } while (--numReps >= 0);
    }
}