use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method setLineCompound.
/**
* @param compound set the line compound style
*/
public void setLineCompound(LineCompound compound) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
if (compound == null) {
if (ln.isSetCmpd()) {
ln.unsetCmpd();
}
} else {
STCompoundLine.Enum xCmpd;
switch(compound) {
default:
case SINGLE:
xCmpd = STCompoundLine.SNG;
break;
case DOUBLE:
xCmpd = STCompoundLine.DBL;
break;
case THICK_THIN:
xCmpd = STCompoundLine.THICK_THIN;
break;
case THIN_THICK:
xCmpd = STCompoundLine.THIN_THICK;
break;
case TRIPLE:
xCmpd = STCompoundLine.TRI;
break;
}
ln.setCmpd(xCmpd);
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method getLineHeadDecoration.
/**
* @return the line end decoration shape
*/
public DecorationShape getLineHeadDecoration() {
CTLineProperties ln = getLn(this, false);
DecorationShape ds = DecorationShape.NONE;
if (ln != null && ln.isSetHeadEnd() && ln.getHeadEnd().isSetType()) {
ds = DecorationShape.fromOoxmlId(ln.getHeadEnd().getType().intValue());
}
return ds;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties 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));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method setLineHeadWidth.
/**
* specifies decoration width of the head of a line.
*
* @param style the decoration width
*/
public void setLineHeadWidth(DecorationSize style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd();
if (style == null) {
if (lnEnd.isSetW()) {
lnEnd.unsetW();
}
} else {
lnEnd.setW(STLineEndWidth.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method setLineColor.
/**
* @param color the color to paint the shape outline.
* A <code>null</code> value turns off the shape outline.
*/
public void setLineColor(Color color) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
if (ln.isSetSolidFill()) {
ln.unsetSolidFill();
}
if (ln.isSetGradFill()) {
ln.unsetGradFill();
}
if (ln.isSetPattFill()) {
ln.unsetPattFill();
}
if (ln.isSetNoFill()) {
ln.unsetNoFill();
}
if (color == null) {
ln.addNewNoFill();
} else {
CTSolidColorFillProperties fill = ln.addNewSolidFill();
XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr());
col.setColor(color);
}
}
Aggregations