Esempio n. 1
0
  public int getMaxLabelWidth(Graphics2D g) {
    int max = 0;
    for (Label label : this.labels) {
      int w = (int) g.getFontMetrics().getStringBounds(label.getLabel(), g).getWidth();
      if (w > max) max = w;
    }

    return max;
  }
Esempio n. 2
0
  protected int getMaxLabelHeight(Graphics2D g) {
    int max = 0;
    for (Label label : this.labels) {
      int w = (int) g.getFontMetrics().getStringBounds(label.getLabel(), g).getHeight();
      if (w > max) max = w;
    }

    return max;
  }