package GUI;

import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;

public class SignOutBox extends VBox {

    private Label signOutBoxLabel;
    private ListView<String> listView;
    private Button signOutButton;
    private HBox horizontalLayout;

    public SignOutBox() {
        this(0);
    }

    public SignOutBox(double spacing) {
        super(spacing);
        initializeFields();
        initializeLayout();
    }

    private void initializeFields() {
        signOutBoxLabel = new Label("Sign Out");
        signOutBoxLabel.setFont(new Font(20));
        listView = new ListView<>();
        listView.setMaxSize(200, 150);
        signOutButton = new Button("Sign Out");
        horizontalLayout = new HBox();
        horizontalLayout.setAlignment(Pos.BOTTOM_RIGHT);
    }

    private void initializeLayout() {
        horizontalLayout.getChildren().add(signOutButton);
        this.setAlignment(Pos.TOP_CENTER);
        this.getChildren().addAll(signOutBoxLabel, listView, horizontalLayout);
        setMargin(listView, new Insets(20, 0, 20, 0));
        setVgrow(horizontalLayout, Priority.ALWAYS);
        setMinSize(250, 250);
    }

    public void addActiveStudent(String fullName) {
        listView.getItems().add(fullName);
    }

    public void signOutStudent(String fullName) {
        listView.getItems().remove(fullName);
    }
}

@@ -7,16 +7,44 @@
 e GUI;%0A%0A
+import Information.Student;%0A
 import j
@@ -436,20 +436,21 @@
 tView%3CSt
-ring
+udent
 %3E listVi
@@ -1441,45 +1441,443 @@
 lic 
-void addActiveStudent(String fullName
+Button getSignOutButton() %7B%0A        return signOutButton;%0A    %7D%0A%0A    public Student getSelectedStudent() %7B%0A        Student student = listView.getSelectionModel().getSelectedItem();%0A        if (student == null) %7B%0A            PopUp.display(%22Error%22, %22No student was selected%22);%0A            throw new NullPointerException(%22No Student was selected%22);%0A        %7D%0A        return student;%0A    %7D%0A%0A    public void addActiveStudent(Student student
 ) %7B%0A
@@ -1908,24 +1908,23 @@
 s().add(
-fullName
+student
 );%0A    %7D
@@ -1962,21 +1962,21 @@
 t(St
-ring fullName
+udent student
 ) %7B%0A
@@ -2014,16 +2014,15 @@
 ove(
-fullName
+student
 );%0A 

Set ListView to contain Students