public class ObjectsRenderer {
public static void render(Iterable<?> objects, Rectangle2D bounds, File file) {
// TODO Remove reference to Viewer.getVisualizer.
Visualizer v = VisualizerFactory.getVisualizer(objects, ListUtils.listClass(objects));
if (file.getName().toLowerCase().endsWith(".pdf")) {
LinkedVisualizer linkedVisualizer = new LinkedVisualizer(v, objects);
PDFRenderer.render(linkedVisualizer, bounds, file);
} else if (file.getName().toLowerCase().endsWith(".svg")) {
SVGRenderer.renderToFile(objects, bounds, file);