if (mark >= shift + s.count) return mark;    int preceding = breaker.preceding(mark + 1 + s.offset);  if (preceding != 0) return preceding + shift;    return mark;
if (mark < s.count - 1) { for (int i = s.offset + mark; i >= s.offset; i--) { char ch = s.array[i]; if (ch < 256) {  if (Character.isWhitespace(ch)) { breakLoc = i - s.offset + 1; break; } } else {  BreakIterator bi = BreakIterator.getLineInstance(); bi.setText(s); int pos = bi.preceding(i + 1); if (pos > s.offset) { breakLoc = breakLoc - s.offset; } break; } } } return breakLoc;
  public static final int getBreakLocation(Segment s, FontMetrics metrics,                                           int x0, int x, TabExpander e,                                           int startOffset)  {    int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset, false);    BreakIterator breaker = BreakIterator.getWordInstance();    breaker.setText(s);        // If startOffset and s.offset differ then we need to use    // that difference two convert the offset between the two metrics.     int shift = startOffset - s.offset;        // If mark is equal to the end of the string, just use that position.    if (mark >= shift + s.count)      return mark;        // Try to find a word boundary previous to the mark at which we     // can break the text.    int preceding = breaker.preceding(mark + 1 + s.offset);        if (preceding != 0)      return preceding + shift;          // If preceding is 0 we couldn't find a suitable word-boundary so      // just break it on the character boundary      return mark;  }