Exemple #1
0
 /** Render this sheet into the supplied graphics object */
 @Override
 protected boolean canDraw(XSLFShape shape) {
   if (shape instanceof XSLFSimpleShape) {
     XSLFSimpleShape txt = (XSLFSimpleShape) shape;
     CTPlaceholder ph = txt.getCTPlaceholder();
     if (ph != null) {
       return false;
     }
   }
   return true;
 }
Exemple #2
0
  @Override
  void copy(XSLFShape other) {
    super.copy(other);

    XSLFTextShape otherTS = (XSLFTextShape) other;
    CTTextBody otherTB = otherTS.getTextBody(false);
    CTTextBody thisTB = getTextBody(true);
    if (otherTB == null) {
      return;
    }

    thisTB.setBodyPr((CTTextBodyProperties) otherTB.getBodyPr().copy());

    if (thisTB.isSetLstStyle()) thisTB.unsetLstStyle();
    if (otherTB.isSetLstStyle()) {
      thisTB.setLstStyle((CTTextListStyle) otherTB.getLstStyle().copy());
    }

    boolean srcWordWrap = otherTS.getWordWrap();
    if (srcWordWrap != getWordWrap()) {
      setWordWrap(srcWordWrap);
    }

    double leftInset = otherTS.getLeftInset();
    if (leftInset != getLeftInset()) {
      setLeftInset(leftInset);
    }
    double rightInset = otherTS.getRightInset();
    if (rightInset != getRightInset()) {
      setRightInset(rightInset);
    }
    double topInset = otherTS.getTopInset();
    if (topInset != getTopInset()) {
      setTopInset(topInset);
    }
    double bottomInset = otherTS.getBottomInset();
    if (bottomInset != getBottomInset()) {
      setBottomInset(bottomInset);
    }

    VerticalAlignment vAlign = otherTS.getVerticalAlignment();
    if (vAlign != getVerticalAlignment()) {
      setVerticalAlignment(vAlign);
    }

    clearText();

    for (XSLFTextParagraph srcP : otherTS.getTextParagraphs()) {
      XSLFTextParagraph tgtP = addNewTextParagraph();
      tgtP.copy(srcP);
    }
  }
Exemple #3
0
 @Override
 public void setPlaceholder(Placeholder placeholder) {
   super.setPlaceholder(placeholder);
 }