Search in sources :

Example 6 with CTTableCellProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties 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)

Example 7 with CTTableCellProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.

the class XSLFTableCell method getTextDirection.

/**
     * @since POI 3.15-beta2
     */
@Override
public TextDirection getTextDirection() {
    CTTableCellProperties cellProps = getCellProperties(false);
    STTextVerticalType.Enum orientation;
    if (cellProps != null && cellProps.isSetVert()) {
        orientation = cellProps.getVert();
    } else {
        orientation = STTextVerticalType.HORZ;
    }
    switch(orientation.intValue()) {
        default:
        case STTextVerticalType.INT_HORZ:
            return TextDirection.HORIZONTAL;
        case STTextVerticalType.INT_VERT:
        case STTextVerticalType.INT_EA_VERT:
        case STTextVerticalType.INT_MONGOLIAN_VERT:
            return TextDirection.VERTICAL;
        case STTextVerticalType.INT_VERT_270:
            return TextDirection.VERTICAL_270;
        case STTextVerticalType.INT_WORD_ART_VERT:
        case STTextVerticalType.INT_WORD_ART_VERT_RTL:
            return TextDirection.STACKED;
    }
}
Also used : STTextVerticalType(org.openxmlformats.schemas.drawingml.x2006.main.STTextVerticalType) CTTableCellProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties)

Example 8 with CTTableCellProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.

the class XSLFTableCell method setBottomInset.

@Override
public void setBottomInset(double margin) {
    CTTableCellProperties pr = getCellProperties(true);
    pr.setMarB(Units.toEMU(margin));
}
Also used : CTTableCellProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties)

Example 9 with CTTableCellProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.

the class XSLFTableCell method getCellProperties.

protected CTTableCellProperties getCellProperties(boolean create) {
    if (_tcPr == null) {
        CTTableCell cell = getCell();
        _tcPr = cell.getTcPr();
        if (_tcPr == null && create) {
            _tcPr = cell.addNewTcPr();
        }
    }
    return _tcPr;
}
Also used : CTTableCell(org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell)

Example 10 with CTTableCellProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.

the class XSLFTableCell method setLeftInset.

@Override
public void setLeftInset(double margin) {
    CTTableCellProperties pr = getCellProperties(true);
    pr.setMarL(Units.toEMU(margin));
}
Also used : CTTableCellProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties)

Aggregations

CTTableCellProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties)10 CTSolidColorFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties)2 CTTableCell (org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell)2 STTextVerticalType (org.openxmlformats.schemas.drawingml.x2006.main.STTextVerticalType)2 DrawPaint (org.apache.poi.sl.draw.DrawPaint)1 SolidPaint (org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)1 VerticalAlignment (org.apache.poi.sl.usermodel.VerticalAlignment)1 XmlObject (org.apache.xmlbeans.XmlObject)1 CTBlipFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties)1 CTFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTFillProperties)1 CTGradientFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties)1 CTGroupFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTGroupFillProperties)1 CTLineProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)1 CTNoFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTNoFillProperties)1 CTPatternFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTPatternFillProperties)1 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)1 CTStyleMatrixReference (org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference)1 CTTextCharacterProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties)1 CTBackgroundProperties (org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperties)1