Search in sources :

Example 1 with FillStyle

use of org.apache.poi.sl.usermodel.FillStyle in project poi by apache.

the class DrawFreeformShape method computeOutlines.

protected Collection<Outline> computeOutlines(Graphics2D graphics) {
    List<Outline> lst = new ArrayList<Outline>();
    FreeformShape<?, ?> fsh = getShape();
    Path2D sh = fsh.getPath();
    AffineTransform tx = (AffineTransform) graphics.getRenderingHint(Drawable.GROUP_TRANSFORM);
    if (tx == null) {
        tx = new AffineTransform();
    }
    java.awt.Shape canvasShape = tx.createTransformedShape(sh);
    FillStyle fs = fsh.getFillStyle();
    StrokeStyle ss = fsh.getStrokeStyle();
    Path path = new Path(fs != null, ss != null);
    lst.add(new Outline(canvasShape, path));
    return lst;
}
Also used : Path(org.apache.poi.sl.draw.geom.Path) Path2D(java.awt.geom.Path2D) ArrayList(java.util.ArrayList) FillStyle(org.apache.poi.sl.usermodel.FillStyle) AffineTransform(java.awt.geom.AffineTransform) Outline(org.apache.poi.sl.draw.geom.Outline) StrokeStyle(org.apache.poi.sl.usermodel.StrokeStyle)

Aggregations

AffineTransform (java.awt.geom.AffineTransform)1 Path2D (java.awt.geom.Path2D)1 ArrayList (java.util.ArrayList)1 Outline (org.apache.poi.sl.draw.geom.Outline)1 Path (org.apache.poi.sl.draw.geom.Path)1 FillStyle (org.apache.poi.sl.usermodel.FillStyle)1 StrokeStyle (org.apache.poi.sl.usermodel.StrokeStyle)1