Exemplo n.º 1
0
  @Override
  public Dimension getTextDimensions() {
    if (!hasText()) return new Dimension(0, 0);

    int height = 0;
    int width = 0;
    for (TypedLayout layout : getLines()) {
      height += layout.getHeight();
      int lineWidth = layout.getWidth();
      if (lineWidth > width) width = lineWidth;
    }
    return new Dimension(width, height);
  }
Exemplo n.º 2
0
 public int getXOffset(TypedLayout line) {
   HorizontalAlignmentValue horizontalAlignment =
       getContainer().getStyle().getCompiledHorizontalAlignment();
   return horizontalAlignment.getX(line.getWidth(), getContainer().getBounds());
 }