package com.theatlantic.autograph.py4j;

import py4j.GatewayServer;
import py4j.Py4JNetworkException;

/**
 * Initializes the Py4J Gateway server which allows access to
 * <tt>SVGRasterizer</tt> and its methods through py4j.
 *
 * @author <a href="https://github.com/fdintino">Frankie Dintino</a>
 * @version $Id$
 */
public class Main {
    
    /**
     * Returns a new instance of <tt>SVGRasterizer</tt> for the java gateway.
     *
     * @return A new <tt>SVGRasterizer</tt> instance.
     */
    public SVGRasterizer get_rasterizer() {
        return new SVGRasterizer();
    }
    
    /**
     * Returns a new instance of <tt>HighchartsExport</tt> for the java gateway.
     *
     * @return A new <tt>HighchartsExport</tt> instance.
     */
    public HighchartsExport get_highcharts_exporter() {
        return new HighchartsExport();
    }
    
    /**
     * The main method, which creates an instance of this class and starts the
     * gateway server.
     */
    public static void main(String[] args) {
        GatewayServer gatewayServer = new GatewayServer(new Main());
        try {
            gatewayServer.start();
        } catch (Py4JNetworkException e) {
            gatewayServer.shutdown();
            gatewayServer.start();
        }
        
        System.out.println("Gateway Server Started");
    }
}
@@ -331,24 +331,155 @@
  Main %7B%0A    
+static %7B%0A        // Set to headless so dock icon doesn't show on Mac%0A        System.setProperty(%22java.awt.headless%22, %22true%22);%0A    %7D
 %0A    /**%0A   

Set autograph.py4j.Main to run headless.