Examples of preceding()


Examples of java.text.BreakIterator.preceding()

        result = min;
      } else if (max == origMax
          && getStringExtents2(string.substring(0, max), font).width <= availableWidth) {
        result = max;
      } else {
        result = Math.max(MIN, breakItr.preceding(Math.min(max, string
            .length() - 1)));
      }
      break;

    case CSSTextLayout.WORD_WRAP_SOFT:
View Full Code Here

Examples of java.text.BreakIterator.preceding()

      } else if (breakItr.isBoundary(min)) {
        result = min;
      } else if (breakItr.isBoundary(Math.min(max, string.length() - 1))) {
        result = max;
      } else {
        result = breakItr.preceding(Math.min(max, string.length() - 1));
      }
      if (result <= 0) {
        result = min;
      }
      break;
View Full Code Here

Examples of java.text.BreakIterator.preceding()

                bIter.setText( msg );
                continue;
            }

            // get the last boundary before the specified offset
            currentPos = bIter.preceding( offset );
            // append from the start to currentPos
            buf.append( msg.substring( 0, currentPos ) );

            // start next line
            buf.append( LS );
View Full Code Here

Examples of java.text.BreakIterator.preceding()

            return bi.last() - offset;
        }
        if (bi.isBoundary(fullIndex)) {
            return Character.isWhitespace(s.array[fullIndex]) ? index + 1 : index;
        }
        int prev = bi.preceding(fullIndex);
        if (prev == bi.first()) {
            return index;
        }
        return prev - offset;
    }
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        int iteratorWordStart = 0;
        bi.first();
        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 {
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        }
        assertNotNull(content);
        bi.first();
        for (int i = 0; i < length; i++) {
            int utilitiesPrevWord = 0;
            int iteratorPrevWord = bi.preceding(i);
            while (iteratorPrevWord > 0
                    && ((content.charAt(iteratorPrevWord) == ' ' || content
                            .charAt(iteratorPrevWord) == '\n') || content
                            .charAt(iteratorPrevWord) == '\t')) {
                iteratorPrevWord = bi.preceding(iteratorPrevWord);
View Full Code Here

Examples of java.text.BreakIterator.preceding()

            int iteratorPrevWord = bi.preceding(i);
            while (iteratorPrevWord > 0
                    && ((content.charAt(iteratorPrevWord) == ' ' || content
                            .charAt(iteratorPrevWord) == '\n') || content
                            .charAt(iteratorPrevWord) == '\t')) {
                iteratorPrevWord = bi.preceding(iteratorPrevWord);
            }
            try {
                utilitiesPrevWord = Utilities.getPreviousWord(c, i);
            } catch (BadLocationException e) {
            }
View Full Code Here

Examples of java.text.BreakIterator.preceding()

            breaker.setText(s);

            // Backward search should start from end+1 unless there's NO end+1
            int startFrom = end + (pend > end ? 1 : 0);
            for (;;) {
                startFrom = breaker.preceding(s.offset + (startFrom - pstart))
                          + (pstart - s.offset);
                if (startFrom > start) {
                    // The break spot is within the view
                    bs[ix++] = startFrom;
                } else {
View Full Code Here

Examples of java.text.BreakIterator.preceding()

                    words.setText(s);
                    int end = findWordLimit(index, words, PREVIOUS, s);
                    if (end == BreakIterator.DONE) {
                        return null;
                    }
                    int start = words.preceding(end);
                    if (start == BreakIterator.DONE) {
                        return null;
                    }
                    return s.substring(start, end);
                }
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        String content = null;

        content = doc.getText(0, doc.getLength());
        bi.setText(content);

        int iteratorPrevWord = bi.preceding(pos);
        while (iteratorPrevWord > 0
                && ((content.charAt(iteratorPrevWord) == ' '
                    || content.charAt(iteratorPrevWord) == '\n')
                    || content.charAt(iteratorPrevWord) == '\t')) {
            iteratorPrevWord = bi.preceding(iteratorPrevWord);
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.