示例#1
0
  /**
   * Specifies that a shape should be auto-fit to fully contain the text described within it.
   * Auto-fitting is when text within a shape is scaled in order to contain all the text inside
   *
   * @param value type of autofit
   */
  public void setTextAutofit(TextAutofit value) {
    CTTextBodyProperties bodyPr = getTextBodyPr();
    if (bodyPr != null) {
      if (bodyPr.isSetSpAutoFit()) bodyPr.unsetSpAutoFit();
      if (bodyPr.isSetNoAutofit()) bodyPr.unsetNoAutofit();
      if (bodyPr.isSetNormAutofit()) bodyPr.unsetNormAutofit();

      switch (value) {
        case NONE:
          bodyPr.addNewNoAutofit();
          break;
        case NORMAL:
          bodyPr.addNewNormAutofit();
          break;
        case SHAPE:
          bodyPr.addNewSpAutoFit();
          break;
      }
    }
  }