Package java.text

Examples of java.text.BreakIterator.last()


        for (int i = 0; i < length; i++) {
            int utilitiesWordStart = 0;
            if (i < length - 1) {
                iteratorWordStart = bi.preceding(i + 1);
            } else {
                bi.last();
                iteratorWordStart = bi.previous();
            }
            try {
                utilitiesWordStart = Utilities.getWordStart(c, i);
            } catch (BadLocationException e) {
View Full Code Here


        // The last boundary in this case is same as the offset, so the above gives a wordStart
        // equal to the offset, when in most cases what we want is the wordstart to be the "x".
        String text = DocumentUtils.getText(doc, rowStart, offsetInRow) + "X";
        BreakIterator it = BreakIterator.getWordInstance();
        it.setText(text);
        int wordStart = it.last();
        if (wordStart == BreakIterator.DONE) {
            return rowStart;
        }
        if (wordStart == (offsetInRow + 1)) {
            // This is the case we guarded against by added an "X" to the string we're testing.
View Full Code Here

                    if (end == BreakIterator.DONE ||
                        text.substring(start, end).length() >= 50)
                    {
                        lineLabels[nLines].setText(text.substring(start, end == BreakIterator.DONE ?
                                                                  iter.last() : end));
                        textPanel.add(lineLabels[nLines++]);
                        start = end;
                    }
                    if (nLines == BALLOON_WORD_LINE_MAX_COUNT) {
                        if (end != BreakIterator.DONE) {
View Full Code Here

        if (p1 == parent1) {
            // This will most likely return the end, the assumption is
            // that if parent1 == p1, then we are the last portion of
            // a paragraph
            breakPoint = breaker.last();
        }
        else if (p1 + 1 == parent1) {
            // assert(s.count > 1)
            breakPoint = breaker.following(s.offset + s.count - 2);
            if (breakPoint >= s.count + s.offset) {
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.