Search in sources :

Example 1 with VerticalAlignment

use of org.apache.poi.sl.usermodel.VerticalAlignment in project poi by apache.

the class XSLFTextShape method copy.

@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);
    }
}
Also used : VerticalAlignment(org.apache.poi.sl.usermodel.VerticalAlignment) CTTextBody(org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody)

Example 2 with VerticalAlignment

use of org.apache.poi.sl.usermodel.VerticalAlignment in project poi by apache.

the class XSLFTableCell method getVerticalAlignment.

@Override
public VerticalAlignment getVerticalAlignment() {
    CTTableCellProperties cellProps = getCellProperties(false);
    VerticalAlignment align = VerticalAlignment.TOP;
    if (cellProps != null && cellProps.isSetAnchor()) {
        int ival = cellProps.getAnchor().intValue();
        align = VerticalAlignment.values()[ival - 1];
    }
    return align;
}
Also used : VerticalAlignment(org.apache.poi.sl.usermodel.VerticalAlignment) CTTableCellProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties) DrawPaint(org.apache.poi.sl.draw.DrawPaint) SolidPaint(org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)

Aggregations

VerticalAlignment (org.apache.poi.sl.usermodel.VerticalAlignment)2 DrawPaint (org.apache.poi.sl.draw.DrawPaint)1 SolidPaint (org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)1 CTTableCellProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties)1 CTTextBody (org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody)1