public DrawTextFragment getTextFragment(TextLayout layout, AttributedString str) { return new DrawTextFragment(layout, str); }
public float getLastLineHeight() { return (lines.isEmpty()) ? 0 : lines.get(lines.size()-1).getHeight(); }
public float getFirstLineLeading() { return (lines.isEmpty()) ? 0 : lines.get(0).getLeading(); }
if (!isEmptyParagraph()) { bullet = getBullet(graphics, line.getAttributedString().getIterator()); bullet.setPosition(x+leftMargin+indent, penY); bullet.draw(graphics); double bulletWidth = bullet.getLayout().getAdvance() + 1; penX = x + Math.max(leftMargin, leftMargin+indent+bulletWidth); } else { penX += (anchor.getWidth() - line.getWidth() - leftInset - rightInset - leftMargin) / 2; break; case RIGHT: penX += (anchor.getWidth() - line.getWidth() - leftInset - rightInset); break; default: line.setPosition(penX, penY); line.draw(graphics); penY += spacing*0.01* line.getHeight(); } else {
@Override public String toString(){ return "[" + getClass().getSimpleName() + "] " + getString(); }
if (!isEmptyParagraph()) { bullet = getBullet(graphics, line.getAttributedString().getIterator()); bullet.setPosition(x+leftMargin+indent, penY); bullet.draw(graphics); double bulletWidth = bullet.getLayout().getAdvance() + 1; penX = x + Math.max(leftMargin, leftMargin+indent+bulletWidth); } else { penX += (anchor.getWidth() - line.getWidth() - leftInset - rightInset - leftMargin) / 2; break; case RIGHT: penX += (anchor.getWidth() - line.getWidth() - leftInset - rightInset); break; default: line.setPosition(penX, penY); line.draw(graphics); penY += spacing*0.01* line.getHeight(); } else {
@Override public String toString(){ return "[" + getClass().getSimpleName() + "] " + getString(); }
public float getFirstLineHeight() { return (lines.isEmpty()) ? 0 : lines.get(0).getHeight(); }
/** * @return full height of this text run which is sum of ascent, descent and leading */ public float getHeight(){ double h = layout.getAscent() + layout.getDescent() + getLeading(); return (float)h; }
public DrawTextFragment getTextFragment(TextLayout layout, AttributedString str) { return new DrawTextFragment(layout, str); }
lines.add(line); maxLineHeight = Math.max(maxLineHeight, line.getHeight());
public float getFirstLineLeading() { return (lines.isEmpty()) ? 0 : lines.get(0).getLeading(); }
public float getFirstLineHeight() { return (lines.isEmpty()) ? 0 : lines.get(0).getHeight(); }
/** * @return full height of this text run which is sum of ascent, descent and leading */ public float getHeight(){ double h = layout.getAscent() + layout.getDescent() + getLeading(); return (float)h; }
public float getLastLineHeight() { return (lines.isEmpty()) ? 0 : lines.get(lines.size()-1).getHeight(); }
lines.add(line); maxLineHeight = Math.max(maxLineHeight, line.getHeight());