public BufferedImage render(List<ColouredPolygon> entity)
    {
        // Need to set the background before applying the transform.
        graphics.setTransform(IDENTITY_TRANSFORM);
        graphics.setColor(Color.GRAY);
        graphics.fillRect(0, 0, targetSize.width, targetSize.height);
        if (transform != null)
        {
            graphics.setTransform(transform);
        }
        for (ColouredPolygon polygon : entity)
        {
            graphics.setColor(polygon.getColour());
            graphics.fillPolygon(polygon.getPolygon());
        }
        return image;
    }
public BufferedImage render ( List < ColouredPolygon > entity ) { graphics . setTransform ( IDENTITY_TRANSFORM ) ; graphics . setColor ( Color . GRAY ) ; graphics . fillRect ( 0 , 0 , targetSize . width , targetSize . height ) ; if ( transform != null ) { graphics . setTransform ( transform ) ; } for ( ColouredPolygon polygon : entity ) { graphics . setColor ( polygon . getColour ( ) ) ; graphics . fillPolygon ( polygon . getPolygon ( ) ) ; } return image ; }
Renders the specified polygons as an image.
@param entity A collection of coloured polygons.
@return An image object displaying the polygons.