checkPainter(); int start = getStartOffset(); int end = glyphPainter.getBoundedPosition(this, start, pos, len); if (end == 0) weight = BadBreakWeight; else { if (getBreakLocation(start, end) != -1) weight = ExcellentBreakWeight; else
  public int getBreakWeight(int axis, float pos, float len)  {    int weight;    if (axis == Y_AXIS)      weight = super.getBreakWeight(axis, pos, len);    else      {        // FIXME: Commented out because the Utilities.getBreakLocation method        // is still buggy. The GoodBreakWeight is a reasonable workaround for        // now.//        int startOffset = getStartOffset();//        int endOffset = getEndOffset() - 1;//        Segment s = getText(startOffset, endOffset);//        Container c = getContainer();//        FontMetrics fm = c.getFontMetrics(c.getFont());//        int x0 = (int) pos;//        int x = (int) (pos + len);//        int breakLoc = Utilities.getBreakLocation(s, fm, x0, x,//                                                  getTabExpander(),//                                                  startOffset);//        if (breakLoc == startOffset || breakLoc == endOffset)//          weight = GoodBreakWeight;//        else//          weight = ExcellentBreakWeight;        weight = GoodBreakWeight;      }    return weight;  }