use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.
the class XSLFTableCell method setBorderDefaults.
private CTLineProperties setBorderDefaults(BorderEdge edge) {
CTLineProperties ln = getCTLine(edge, true);
if (ln.isSetNoFill()) {
ln.unsetNoFill();
}
if (!ln.isSetPrstDash()) {
ln.addNewPrstDash().setVal(STPresetLineDashVal.SOLID);
}
if (!ln.isSetCmpd()) {
ln.setCmpd(STCompoundLine.SNG);
}
if (!ln.isSetAlgn()) {
ln.setAlgn(STPenAlignment.CTR);
}
if (!ln.isSetCap()) {
ln.setCap(STLineCap.FLAT);
}
if (!ln.isSetRound()) {
ln.addNewRound();
}
if (!ln.isSetHeadEnd()) {
CTLineEndProperties hd = ln.addNewHeadEnd();
hd.setType(STLineEndType.NONE);
hd.setW(STLineEndWidth.MED);
hd.setLen(STLineEndLength.MED);
}
if (!ln.isSetTailEnd()) {
CTLineEndProperties tl = ln.addNewTailEnd();
tl.setType(STLineEndType.NONE);
tl.setW(STLineEndWidth.MED);
tl.setLen(STLineEndLength.MED);
}
return ln;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.
the class XSLFSimpleShape method setLineTailDecoration.
/**
* Specifies the line end decoration, such as a triangle or arrowhead.
*/
public void setLineTailDecoration(DecorationShape style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd();
if (style == null) {
if (lnEnd.isSetType()) {
lnEnd.unsetType();
}
} else {
lnEnd.setType(STLineEndType.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.
the class XSLFSimpleShape method setLineHeadLength.
/**
* Specifies the line end width in relation to the line width.
*/
public void setLineHeadLength(DecorationSize style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd();
if (style == null) {
if (lnEnd.isSetLen()) {
lnEnd.unsetLen();
}
} else {
lnEnd.setLen(STLineEndLength.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.
the class XSLFSimpleShape method setLineTailWidth.
/**
* specifies decorations which can be added to the tail of a line.
*/
public void setLineTailWidth(DecorationSize style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd();
if (style == null) {
if (lnEnd.isSetW()) {
lnEnd.unsetW();
}
} else {
lnEnd.setW(STLineEndWidth.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.
the class XSLFSimpleShape method setLineHeadDecoration.
/**
* Specifies the line end decoration, such as a triangle or arrowhead.
*
* @param style the line end docoration style
*/
public void setLineHeadDecoration(DecorationShape style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd();
if (style == null) {
if (lnEnd.isSetType()) {
lnEnd.unsetType();
}
} else {
lnEnd.setType(STLineEndType.Enum.forInt(style.ooxmlId));
}
}
Aggregations