use of org.apache.poi.sl.usermodel.LineDecoration in project poi by apache.
the class DrawSimpleShape method drawDecoration.
protected void drawDecoration(Graphics2D graphics, Paint line, BasicStroke stroke) {
if (line == null) {
return;
}
graphics.setPaint(line);
List<Outline> lst = new ArrayList<Outline>();
LineDecoration deco = getShape().getLineDecoration();
Outline head = getHeadDecoration(graphics, deco, stroke);
if (head != null) {
lst.add(head);
}
Outline tail = getTailDecoration(graphics, deco, stroke);
if (tail != null) {
lst.add(tail);
}
for (Outline o : lst) {
java.awt.Shape s = o.getOutline();
Path p = o.getPath();
graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s);
if (p.isFilled()) {
graphics.fill(s);
}
if (p.isStroked()) {
graphics.draw(s);
}
}
}
Aggregations