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);
}
}
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;
}
Aggregations