use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method getLineTailDecoration.
public DecorationShape getLineTailDecoration() {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWHEAD);
return (prop == null) ? null : DecorationShape.fromNativeId(prop.getPropertyValue());
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method setLineCap.
/**
* Sets line cap.
*
* @param pen new style of the line.
*/
public void setLineCap(LineCap pen) {
AbstractEscherOptRecord opt = getEscherOptRecord();
setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDCAPSTYLE, pen == LineCap.FLAT ? -1 : pen.nativeId);
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method getLineHeadDecoration.
public DecorationShape getLineHeadDecoration() {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWHEAD);
return (prop == null) ? null : DecorationShape.fromNativeId(prop.getPropertyValue());
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method setLineBackgroundColor.
/**
* Sets the background color of line
*
* @param color new background color of the line
*/
public void setLineBackgroundColor(Color color) {
AbstractEscherOptRecord opt = getEscherOptRecord();
if (color == null) {
setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80000);
opt.removeEscherProperty(EscherProperties.LINESTYLE__BACKCOLOR);
} else {
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 0).getRGB();
setEscherProperty(opt, EscherProperties.LINESTYLE__BACKCOLOR, rgb);
setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x180018);
}
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method getLineWidth.
/**
* Returns width of the line in in points
*/
public double getLineWidth() {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH);
double width = (prop == null) ? DEFAULT_LINE_WIDTH : Units.toPoints(prop.getPropertyValue());
return width;
}
Aggregations