// Path: client/src/main/java/xyz/elmot/oscill/Main.java
// @SuppressWarnings("WeakerAccess")
// public static String PORT_NAME = "ttyACM0";


import com.sun.javafx.collections.ObservableListWrapper;
import com.sun.javafx.webkit.WebConsoleListener;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.scene.Scene;
import javafx.scene.control.ChoiceBox;
import javafx.scene.image.Image;
import javafx.scene.input.KeyCombination;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
import java.io.BufferedReader;
import java.io.StringReader;
import java.util.Arrays;
import static xyz.elmot.oscill.Main.PORT_NAME;
                e.printStackTrace();
            }
        });

        stage.setTitle("Oscilloscope");
        stage.setFullScreenExitKeyCombination(KeyCombination.keyCombination("F11"));
        WebView webView = createWebView();
        ChoiceBox<String> ports = new ChoiceBox<>();
        listPortsToChoiceBox(ports);
        ports.setValue(PORT_NAME);
        ports.onShowingProperty().set(e ->
                listPortsToChoiceBox(ports));
        ports.onActionProperty().set(value->
                commFacility.setPortName(ports.getValue()));
        BorderPane root = new BorderPane(webView, ports, null, null, null);
        Scene scene = new Scene(root);
        decorateStage(stage, scene);
        stage.setScene(scene);
        stage.setOnCloseRequest(event -> Platform.exit());
        stage.show();
    }

    private void listPortsToChoiceBox(ChoiceBox<String> ports) {
        ports.setItems(
                new ObservableListWrapper<>(Arrays.asList(CommFacility.ports())
                ));
    }

    private WebView createWebView() {
        WebConsoleListener.setDefaultListener(
// Path: client/src/main/java/xyz/elmot/oscill/Main.java
// @SuppressWarnings("WeakerAccess")
// public static String PORT_NAME = "ttyACM0";


// Path: client/src/main/java/xyz/elmot/oscill/BrowserMain.java
import com.sun.javafx.collections.ObservableListWrapper;
import com.sun.javafx.webkit.WebConsoleListener;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.scene.Scene;
import javafx.scene.control.ChoiceBox;
import javafx.scene.image.Image;
import javafx.scene.input.KeyCombination;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
import java.io.BufferedReader;
import java.io.StringReader;
import java.util.Arrays;
import static xyz.elmot.oscill.Main.PORT_NAME;

                e.printStackTrace();
            }
        });

        stage.setTitle("Oscilloscope");
        stage.setFullScreenExitKeyCombination(KeyCombination.keyCombination("F11"));
        WebView webView = createWebView();
        ChoiceBox<String> ports = new ChoiceBox<>();
        listPortsToChoiceBox(ports);
        ports.setValue(PORT_NAME);
        ports.onShowingProperty().set(e ->
                listPortsToChoiceBox(ports));
        ports.onActionProperty().set(value->
                commFacility.setPortName(ports.getValue()));
        BorderPane root = new BorderPane(webView, ports, null, null, null);
        Scene scene = new Scene(root);
        decorateStage(stage, scene);
        stage.setScene(scene);
        stage.setOnCloseRequest(event -> Platform.exit());
        stage.show();
    }

    private void listPortsToChoiceBox(ChoiceBox<String> ports) {
        ports.setItems(
                new ObservableListWrapper<>(Arrays.asList(CommFacility.ports())
                ));
    }

    private WebView createWebView() {
        WebConsoleListener.setDefaultListener(
                (webView1, message, lineNumber, sourceId) ->