use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.
the class XSLFTableCell method setRightInset.
@Override
public void setRightInset(double margin) {
CTTableCellProperties pr = getCellProperties(true);
pr.setMarR(Units.toEMU(margin));
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.
the class XSLFTableCell method setTopInset.
@Override
public void setTopInset(double margin) {
CTTableCellProperties pr = getCellProperties(true);
pr.setMarT(Units.toEMU(margin));
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.
the class XSLFTableCell method setFillColor.
/**
* Specifies a solid color fill. The shape is filled entirely with the specified color.
*
* @param color the solid color fill.
* The value of <code>null</code> unsets the solidFIll attribute from the underlying xml
*/
@Override
public void setFillColor(Color color) {
CTTableCellProperties spPr = getCellProperties(true);
if (color == null) {
if (spPr.isSetSolidFill()) {
spPr.unsetSolidFill();
}
} else {
CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr.getSolidFill() : spPr.addNewSolidFill();
XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr());
c.setColor(color);
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.
the class XSLFTableCell method prototype.
static CTTableCell prototype() {
CTTableCell cell = CTTableCell.Factory.newInstance();
CTTableCellProperties pr = cell.addNewTcPr();
pr.addNewLnL().addNewNoFill();
pr.addNewLnR().addNewNoFill();
pr.addNewLnT().addNewNoFill();
pr.addNewLnB().addNewNoFill();
return cell;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.
the class XSLFTableCell method setTextDirection.
/**
* @since POI 3.15-beta2
*/
@Override
public void setTextDirection(TextDirection orientation) {
CTTableCellProperties cellProps = getCellProperties(true);
if (orientation == null) {
if (cellProps.isSetVert()) {
cellProps.unsetVert();
}
} else {
STTextVerticalType.Enum vt;
switch(orientation) {
default:
case HORIZONTAL:
vt = STTextVerticalType.HORZ;
break;
case VERTICAL:
vt = STTextVerticalType.VERT;
break;
case VERTICAL_270:
vt = STTextVerticalType.VERT_270;
break;
case STACKED:
vt = STTextVerticalType.WORD_ART_VERT;
break;
}
cellProps.setVert(vt);
}
}
Aggregations