use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method setLineTailLength.
/**
* Specifies the line end width in relation to the line width.
*/
public void setLineTailLength(DecorationSize style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd();
if (style == null) {
if (lnEnd.isSetLen()) {
lnEnd.unsetLen();
}
} else {
lnEnd.setLen(STLineEndLength.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method getLineHeadWidth.
/**
* @return the line end decoration width
*/
public DecorationSize getLineHeadWidth() {
CTLineProperties ln = getLn(this, false);
DecorationSize ds = DecorationSize.MEDIUM;
if (ln != null && ln.isSetHeadEnd() && ln.getHeadEnd().isSetW()) {
ds = DecorationSize.fromOoxmlId(ln.getHeadEnd().getW().intValue());
}
return ds;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method getLineWidth.
/**
* @return line width in points. <code>0</code> means no line.
*/
public double getLineWidth() {
PropertyFetcher<Double> fetcher = new PropertyFetcher<Double>() {
@Override
public boolean fetch(XSLFShape shape) {
CTLineProperties ln = getLn(shape, false);
if (ln != null) {
if (ln.isSetNoFill()) {
setValue(0.);
return true;
}
if (ln.isSetW()) {
setValue(Units.toPoints(ln.getW()));
return true;
}
}
return false;
}
};
fetchShapeProperty(fetcher);
double lineWidth = 0;
if (fetcher.getValue() == null) {
CTLineProperties defaultLn = getDefaultLineProperties();
if (defaultLn != null) {
if (defaultLn.isSetW()) {
lineWidth = Units.toPoints(defaultLn.getW());
}
}
} else {
lineWidth = fetcher.getValue();
}
return lineWidth;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFTableCell method setBorderWidth.
@Override
public void setBorderWidth(BorderEdge edge, double width) {
CTLineProperties ln = getCTLine(edge, true);
ln.setW(Units.toEMU(width));
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFTableCell method setBorderCompound.
@Override
public void setBorderCompound(BorderEdge edge, LineCompound compound) {
if (compound == null) {
throw new IllegalArgumentException("LineCompound need to be specified.");
}
CTLineProperties ln = setBorderDefaults(edge);
ln.setCmpd(STCompoundLine.Enum.forInt(compound.ooxmlId));
}
Aggregations