Пример #1
0
 @Override
 public void drawBackground(Graphics g) {
   renderer.drawText(
       g,
       text,
       font,
       FORE_COLOR,
       insets.x - getScrollLeft(),
       insets.y - getScrollTop(),
       getScrollWidth() - 2 * insets.x,
       getScrollHeight() - 2 * insets.y,
       0,
       getHeight(),
       true,
       alignment,
       false);
 }
Пример #2
0
 public float getPreferredHeight(float width) {
   return renderer.getWrappedBounds(text, font, width - 2 * insets.x).height
       + font.getLineHeight()
       - font.getCapHeight() // need to account for difference in line and cap height
       + 2 * insets.y;
 }