stathissideris/ditaa — pull request #2 by bnd (2013-12-10 17:05:30+00:00)
Title: CustomShapeDefinition to provide shapes programmatically

The general way to extend DITAA with new shapes is to parse and SVG file and then render this shape with SVG in the output. This is very general but requires the batik libraries to be available. In my case I needed a simple way to extend the shapes programmatically.

It turned out that this was quite easy to do in the design. I added 2 methods to the CustomShapeDefinition. A render method that could completely take over the rendering and a simpler getPath method that can provide a GeneralPath.

If the CustomShapeDefinition can provide a path, this path is used and all options work as they do for the built in types. If there is no path, the render method is called. If this returns false, the standard custom shapes are used.

[I would appreciate it if you could merge this since it seems useful to others and then I don't have to fork this project. Thanks for the good work!]