package radicalzephyr;

public class WebFX {

}

@@ -21,28 +21,1878 @@
 r;%0A%0A
-public class WebFX %7B
+import java.util.ArrayList;%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0Aimport java.util.List;%0A%0Aimport javafx.application.Application;%0Aimport javafx.scene.Scene;%0Aimport javafx.scene.web.WebView;%0Aimport javafx.scene.web.WebEngine;%0Aimport javafx.stage.Stage;%0A%0Apublic class WebFX extends Application %7B%0A    private String domain;%0A    private String port;%0A    private String width;%0A    private String height;%0A%0A    @Override%0A    public void init() throws Exception %7B%0A        Map%3CString, String%3E args = getParameters().getNamed();%0A%0A        this.domain = args.getOrDefault(%22domain%22, %22localhost%22);%0A        this.port   = args.getOrDefault(%22port%22, %223000%22);%0A%0A        this.width  = args.getOrDefault(%22width%22, %221024%22);%0A        this.height = args.getOrDefault(%22height%22, %22768%22);%0A    %7D%0A%0A    @Override%0A    public void start(Stage primaryStage) %7B%0A        WebView browser = new WebView();%0A        WebEngine engine = browser.getEngine();%0A%0A        String domain = %22localhost%22;%0A        String port = %229393%22;%0A%0A        engine.load(%22http://%22 + domain + %22:%22 + port);%0A%0A        int width = 1024;%0A        int height = 768;%0A        Scene s = new Scene(browser, width, height);%0A%0A        primaryStage.setScene(s);%0A        primaryStage.show();%0A    %7D%0A%0A    private static String%5B%5D constructArgVector(Map%3CString, Object%3E options) %7B%0A        List%3CString%3E args = new ArrayList%3CString%3E();%0A%0A        for (Entry%3CString, Object%3E option: options.entrySet()) %7B%0A            String argName  = option.getKey();%0A            String argValue = option.getValue().toString();%0A            args.add(String.format(%22--%25s=%25s%22, argName, argValue));%0A        %7D%0A%0A        return args.toArray(new String%5B0%5D);%0A    %7D%0A%0A    public static void start(Map%3CString, Object%3E options) %7B%0A        String%5B%5D args = constructArgVector(options);%0A        launch(args);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        launch(args);%0A    %7D
 %0A%0A%7D%0A

Implement first pass at JavaFX Application shim