package com.queen.sandbox.algorithms.application;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Insets;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import java.util.*;

public class AlgorithmsFX extends Application {

    private final List<Button> buttons = new ArrayList<>();
    private final int WIDTH = 1920;
    private final int HEIGHT = 1080;

    @Override
    public void start(Stage primaryStage) {
        try {
            Parent mainContainer = FXMLLoader.load(getClass().getResource("../views/maincontainer.fxml"));
            Scene scene = new Scene(mainContainer);
//            scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
            primaryStage.setX(2516);
            primaryStage.setY(100);
            primaryStage.setScene(scene);
            primaryStage.show();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        launch(args);
    }

//        GridPane mainWindow = new GridPane();
//        mainWindow.setGridLinesVisible(true);
//        Pane playPanel = new StackPane();
//        playPanel.setOpaqueInsets(new Insets(10, 10, 10, 10));
//        playPanel.autosize();
//        playPanel.setBackground(new Background(new BackgroundFill(Color.WHEAT, CornerRadii.EMPTY, Insets.EMPTY)));
//        playPanel.setMaxWidth(Double.MAX_VALUE);
//        playPanel.setMaxHeight(Double.MAX_VALUE);
//
//        VBox leftPanel = new VBox();
//        Button quickFind = new Button("Quick Find");
//        Button quickUnion = new Button("Quick Union");
//        Button weightedQuickUnion = new Button("Weighted Quick Union");
//        Collections.addAll(buttons, quickFind, quickUnion, weightedQuickUnion);
//        leftPanel.getChildren().addAll(buttons);
//        mainWindow.add(leftPanel, 0, 0);
//        mainWindow.add(playPanel, 1, 0);
//        mainWindow.setPrefWidth(WIDTH);
//        GridPane.setHgrow(playPanel, Priority.ALWAYS);
//        GridPane.setVgrow(playPanel, Priority.ALWAYS);
//        GridPane.setHgrow(leftPanel, Priority.SOMETIMES);
//        GridPane.setVgrow(leftPanel, Priority.SOMETIMES);
//        mainWindow.setPrefHeight(HEIGHT);
//        mainWindow.setBackground(new Background(new BackgroundFill(Color.ALICEBLUE, CornerRadii.EMPTY, Insets.EMPTY)));
//        Scene scene = new Scene(mainWindow, WIDTH, HEIGHT);
//        Map<String, IWindow> windows = new HashMap<>();

//
//        playPanel.getChildren().addAll(windows.get("QuickUnion").getPane(), windows.get("QuickFind").getPane());
//        quickFind.setOnAction(event -> {
//            if (!windows.get("QuickFind").getPane().isVisible()) {
//                windows.get("QuickFind").getPane().setVisible(true);
//                windows.get("QuickUnion").getPane().setVisible(false);
//            }
//        });
//
//        quickUnion.setOnAction(event -> {
//            if (!windows.get("QuickUnion").getPane().isVisible()) {
//                windows.get("QuickFind").getPane().setVisible(false);
//                windows.get("QuickUnion").getPane().setVisible(true);
//            }
//        });
//
//        primaryStage.setX(2516);
//        primaryStage.setY(100);
//        primaryStage.setScene(scene);
//        primaryStage.show();
//    }
}

@@ -118,39 +118,8 @@
 er;%0A
-import javafx.geometry.Insets;%0A
 impo
@@ -224,83 +224,48 @@
 fx.s
-cene.layout.*;%0Aimport javafx.scene.paint.Color;%0Aimport javafx.stage.Stage;%0A
+tage.Stage;%0A%0Aimport java.util.ArrayList;
 %0Aimp
@@ -282,9 +282,12 @@
 til.
-*
+List
 ;%0A%0Ap
@@ -797,24 +797,75 @@
 nalForm());%0A
+            primaryStage.setTitle(%22AlgorithmsFX%22);%0A
             
@@ -1157,2321 +1157,7 @@
    %7D
-%0A%0A//        GridPane mainWindow = new GridPane();%0A//        mainWindow.setGridLinesVisible(true);%0A//        Pane playPanel = new StackPane();%0A//        playPanel.setOpaqueInsets(new Insets(10, 10, 10, 10));%0A//        playPanel.autosize();%0A//        playPanel.setBackground(new Background(new BackgroundFill(Color.WHEAT, CornerRadii.EMPTY, Insets.EMPTY)));%0A//        playPanel.setMaxWidth(Double.MAX_VALUE);%0A//        playPanel.setMaxHeight(Double.MAX_VALUE);%0A//%0A//        VBox leftPanel = new VBox();%0A//        Button quickFind = new Button(%22Quick Find%22);%0A//        Button quickUnion = new Button(%22Quick Union%22);%0A//        Button weightedQuickUnion = new Button(%22Weighted Quick Union%22);%0A//        Collections.addAll(buttons, quickFind, quickUnion, weightedQuickUnion);%0A//        leftPanel.getChildren().addAll(buttons);%0A//        mainWindow.add(leftPanel, 0, 0);%0A//        mainWindow.add(playPanel, 1, 0);%0A//        mainWindow.setPrefWidth(WIDTH);%0A//        GridPane.setHgrow(playPanel, Priority.ALWAYS);%0A//        GridPane.setVgrow(playPanel, Priority.ALWAYS);%0A//        GridPane.setHgrow(leftPanel, Priority.SOMETIMES);%0A//        GridPane.setVgrow(leftPanel, Priority.SOMETIMES);%0A//        mainWindow.setPrefHeight(HEIGHT);%0A//        mainWindow.setBackground(new Background(new BackgroundFill(Color.ALICEBLUE, CornerRadii.EMPTY, Insets.EMPTY)));%0A//        Scene scene = new Scene(mainWindow, WIDTH, HEIGHT);%0A//        Map%3CString, IWindow%3E windows = new HashMap%3C%3E();%0A%0A//%0A//        playPanel.getChildren().addAll(windows.get(%22QuickUnion%22).getPane(), windows.get(%22QuickFind%22).getPane());%0A//        quickFind.setOnAction(event -%3E %7B%0A//            if (!windows.get(%22QuickFind%22).getPane().isVisible()) %7B%0A//                windows.get(%22QuickFind%22).getPane().setVisible(true);%0A//                windows.get(%22QuickUnion%22).getPane().setVisible(false);%0A//            %7D%0A//        %7D);%0A//%0A//        quickUnion.setOnAction(event -%3E %7B%0A//            if (!windows.get(%22QuickUnion%22).getPane().isVisible()) %7B%0A//                windows.get(%22QuickFind%22).getPane().setVisible(false);%0A//                windows.get(%22QuickUnion%22).getPane().setVisible(true);%0A//            %7D%0A//        %7D);%0A//%0A//        primaryStage.setX(2516);%0A//        primaryStage.setY(100);%0A//        primaryStage.setScene(scene);%0A//        primaryStage.show();%0A//    %7D
 %0A%7D%0A

Clean up.