private ScrollPane createMatchingUsersPane() {
   ScrollPane matchingUsersPane = new ScrollPane();
   matchingUsersPane.setMaxHeight(200);
   matchingUsersPane.setMinHeight(200);
   matchingUsersPane.setContent(matchingUsersBox);
   return matchingUsersPane;
 }
Example #2
0
  public void displayPane() throws IOException {

    addStationsToCB();

    paneTop.getColumnConstraints().add(new ColumnConstraints(60));
    paneTop.getColumnConstraints().add(new ColumnConstraints(200));
    paneTop.getColumnConstraints().add(new ColumnConstraints(100));

    paneBot.getColumnConstraints().add(new ColumnConstraints(60));
    paneBot.getColumnConstraints().add(new ColumnConstraints(200));
    paneBot.getColumnConstraints().add(new ColumnConstraints(100));

    paneCenter.getColumnConstraints().add(new ColumnConstraints(300));

    paneTop.setPadding(new Insets(10, 10, 10, 10));
    paneTop.setAlignment(Pos.CENTER);
    paneTop.setHgap(5);
    paneTop.setVgap(5);

    paneBot.setPadding(new Insets(10, 10, 10, 10));
    paneBot.setAlignment(Pos.CENTER);
    paneBot.setHgap(5);
    paneBot.setVgap(5);

    paneTop.add(new Label("Station :"), 0, 0);
    paneTop.add(cbStations, 1, 0);
    paneTop.add(btOpen, 2, 0);

    paneBot.add(new Label("Quantity :"), 0, 0);
    paneBot.add(cbQuantity, 1, 0);
    paneBot.add(btShow, 2, 0);

    paneTop.setHalignment(btOpen, HPos.RIGHT);
    paneBot.setHalignment(btShow, HPos.RIGHT);

    paneCenter.setHgap(5);
    paneCenter.setVgap(5);
    paneCenter.setAlignment(Pos.CENTER);
    sp.setContent(paneCenter);
    sp.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);
    bp.setMargin(sp, new Insets(20, 50, 40, 50));
    bp.setTop(paneTop);
    bp.setCenter(sp);
    bp.setBottom(paneBot);

    btOpen.setOnAction(
        e -> {
          try {
            open();
          } catch (IOException er) {
            er.printStackTrace();
          }
        });

    btShow.setOnAction(e -> showGraph());
  }
Example #3
0
  public void addImageTab(Path imagePath) {

    TabPane previewTabPane = controller.getPreviewTabPane();

    ImageTab tab = new ImageTab();
    tab.setPath(imagePath);
    tab.setText(imagePath.getFileName().toString());

    if (previewTabPane.getTabs().contains(tab)) {
      previewTabPane.getSelectionModel().select(tab);
      return;
    }

    Image image = new Image(IOHelper.pathToUrl(imagePath));
    ImageView imageView = new ImageView(image);
    imageView.setPreserveRatio(true);

    imageView.setFitWidth(previewTabPane.getWidth());

    previewTabPane
        .widthProperty()
        .addListener(
            (observable, oldValue, newValue) -> {
              imageView.setFitWidth(previewTabPane.getWidth());
            });

    Tooltip tip = new Tooltip(imagePath.toString());
    Tooltip.install(tab.getGraphic(), tip);

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    scrollPane.setContent(imageView);
    scrollPane.addEventFilter(
        ScrollEvent.SCROLL,
        e -> {
          if (e.isControlDown() && e.getDeltaY() > 0) {
            // zoom in
            imageView.setFitWidth(imageView.getFitWidth() + 16.0);
          } else if (e.isControlDown() && e.getDeltaY() < 0) {
            // zoom out
            imageView.setFitWidth(imageView.getFitWidth() - 16.0);
          }
        });

    tab.setContent(scrollPane);

    TabPane tabPane = previewTabPane;
    tabPane.getTabs().add(tab);
    tabPane.getSelectionModel().select(tab);
  }
  @FXML
  private void customersButtonClicked(ActionEvent event) {
    configureButtons();
    customersButton.setGraphic(customersSelectedIMV);

    // Clear old content
    contentPane.getChildren().clear();

    titleLabel.setText("Customer Information");

    ScrollPane scrollPane = new ScrollPane();

    contentPane.getChildren().add(scrollPane);

    VBox box = new VBox();
    box.setSpacing(10);
    box.setAlignment(Pos.TOP_CENTER);
    box.setPrefWidth(900);

    // set up for ALL CUSTOMERS
    Text cHeader = new Text("All Customers");
    cHeader.setFont(new Font("System", 24));

    ObservableList<Customer> data = FXCollections.observableArrayList(operation.getAllCustomers());
    TableView cTable = new TableView();

    TableColumn cfnCol = new TableColumn("First Name");
    cfnCol.setCellValueFactory(new PropertyValueFactory<>("firstName"));
    TableColumn clnCol = new TableColumn("Last Name");
    clnCol.setCellValueFactory(new PropertyValueFactory<>("lastName"));
    TableColumn cEmailCol = new TableColumn("Email");
    cEmailCol.setCellValueFactory(new PropertyValueFactory<>("email"));
    TableColumn cUpdatedAtCol = new TableColumn("Updated At");
    cUpdatedAtCol.setCellValueFactory(new PropertyValueFactory<>("updatedAt"));
    TableColumn cDiscountCol = new TableColumn("Discount");
    cDiscountCol.setCellValueFactory(new PropertyValueFactory<>("discount"));

    cTable.getColumns().addAll(cfnCol, clnCol, cEmailCol, cUpdatedAtCol, cDiscountCol);
    cTable.setItems(data);
    cTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    box.getChildren().addAll(cHeader, cTable);
    scrollPane.setContent(box);
  }
  public PrenotaViaggioView(
      Stage stage, PrenotaViaggioControl prenotaViaggioControl, GpMediator gpimpl) {
    this.prenotaViaggioControl = prenotaViaggioControl;
    this.gpMediator = gpimpl;
    gpimpl.addColleague(this);

    this.tg = new ToggleGroup();

    this.gridCredential = new GridPane();

    double percentageWidth = 0.50;
    double percentageHeight = 0.50;

    layout = new SplitPane();
    layout.setPadding(new Insets(20, 0, 20, 20));
    layout.setOrientation(Orientation.HORIZONTAL);
    Rectangle2D screenSize = Screen.getPrimary().getBounds();
    percentageWidth *= screenSize.getWidth();
    percentageHeight *= screenSize.getHeight();

    sp1 = buildLeft();
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(sp1);

    sp2 = new StackPane();

    layout.getItems().addAll(scrollPane, sp2);
    layout.setDividerPositions(0.5f, 0.5f);

    this.scene = new Scene(layout, percentageWidth, percentageHeight);

    scene.getStylesheets().add("JMetroLightTheme.css");
    stage.getIcons().add(new Image("icon.png"));

    stage.setTitle("Creazione Viaggio Gruppo");
    stage.setScene(scene);
    stage.show();
  }
  private void initDialog() {
    dialog.initOwner(mainApp.getPrimaryStage());
    dialog.initModality(Modality.APPLICATION_MODAL);
    dialog.initStyle(StageStyle.DECORATED);
    dialog.setResizable(true);
    dialog.setTitle("Recordings Already Exist");
    dialog.setHeaderText("Replace or rename recordings?");
    dialog.getDialogPane().setPadding(new Insets(10));

    VBox vbox = new VBox();
    vbox.setSpacing(10);
    dialog.getDialogPane().setContent(vbox);

    Label label =
        new Label(
            "Archiving the following recordings will replace files on your computer unless you rename them:");
    vbox.getChildren().add(label);

    VBox recordingBox = new VBox();
    recordingBox.setSpacing(20);
    for (Recording recording : recordingsToDisplay) {
      recording.setFileExistsAction(Recording.FileExistsAction.REPLACE);
      recordingBox.getChildren().add(buildRecordingGrid(recording));
    }

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.getStyleClass().add("recording-exists-list");
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
    scrollPane.setContent(recordingBox);
    scrollPane.setPadding(new Insets(10));
    vbox.getChildren().add(scrollPane);

    dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
  }
  private void buildUserCredentials(ActionEvent event) {

    // System.out.println("Valore di numreserved " + Integer.toString(numreserved));
    GridPane gp = ((GridPane) ((Button) event.getSource()).getParent());
    int numreserved = ((Spinner<Integer>) gp.getChildren().get(0)).getValue();
    gridCredential.getChildren().clear();

    /*
    int j =0;
    for(int i=0; i<numreserved*3;i = i + 3){

        Label nameL = new Label("Nome partecipante");
        Label surnameL = new Label("Cognome partecipante");
        Label birthdayL = new Label("Data Nascita");

        TextField txname = new TextField();
        TextField txsurname = new TextField();
        TextField txbirthday = new TextField();

        gridCredential.add(nameL,j,i);
        gridCredential.add(txname,j+1,i);
        gridCredential.add(surnameL,j,i+1);
        gridCredential.add(txsurname,j+1,i+1);
        gridCredential.add(birthdayL,j,i+2);
        gridCredential.add(txbirthday,j+1,i+2);
        gridCredential.setVgap(20);
        gridCredential.setHgap(3);
    }*/

    for (int i = 0; i < numreserved; i++) {

      GridPane grd = new GridPane();

      Label lblL = new Label("Inserire credenziali partecipante");
      Label nameL = new Label("Nome partecipante");
      Label surnameL = new Label("Cognome partecipante");
      Label birthdayL = new Label("Data Nascita");

      TextField txname = new TextField();
      TextField txsurname = new TextField();
      TextField txbirthday = new TextField();

      grd.add(lblL, 0, 0);
      grd.addRow(1);
      grd.add(nameL, 0, 2);
      grd.add(txname, 1, 2);
      grd.add(surnameL, 0, 3);
      grd.add(txsurname, 1, 3);
      grd.add(birthdayL, 0, 4);
      grd.add(txbirthday, 1, 4);
      grd.addRow(5);
      grd.setVgap(10);
      grd.setHgap(3);

      gridCredential.add(grd, 0, i);
    }

    Button okButton = new Button("OK");
    gridCredential.add(okButton, 0, numreserved);

    okButton.setId(((RadioButton) tg.getSelectedToggle()).getId());
    okButton.setOnAction(prenotaViaggioControl::reserveTrip);

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(gridCredential);

    gp.add(scrollPane, 0, 1);

    gpMediator.send(gridCredential, this);
  }
  public ConfigurationsDialogBuilder create(
      DependencyDotFileGenerator dependencyDotFileGenerator,
      GradleScriptPreferences preferences,
      Os os,
      String outputFileName) {
    this.outputFileName = outputFileName;
    this.dependencyDotFileGenerator = dependencyDotFileGenerator;
    this.preferences = preferences;
    this.os = os;
    dialog = new ConfigurationChoiceDialog(this);
    dialog.setResizable(true);
    dialog.initStyle(UTILITY);
    dialog.initModality(APPLICATION_MODAL);
    dialog.setIconified(false);
    dialog.centerOnScreen();
    dialog.borderPanel = BorderPaneBuilder.create().styleClass("dialog").build();
    dialog.stackPane = new StackPane();

    StackPane stackPane = dialog.stackPane;

    dialog.log = new TextArea();

    TextArea log = dialog.log;
    BorderPane borderPanel = dialog.borderPanel;

    // message
    dialog.configurationsBox = new VBox();

    VBox configurationsBox = dialog.configurationsBox;

    dialog.configurationsBox = configurationsBox;
    dialog.progressIndicator = new ProgressIndicator();

    ProgressIndicator progressIndicator = dialog.progressIndicator;

    stackPane.getChildren().add(log);
    stackPane.getChildren().add(progressIndicator);
    progressIndicator.setPrefSize(50, 50);
    progressIndicator.setMaxSize(50, 50);
    configurationsBox.setSpacing(15);
    configurationsBox.setAlignment(CENTER_LEFT);
    dialog.scrollPane = new ScrollPane();

    ScrollPane scrollPane = dialog.scrollPane;

    scrollPane.setContent(configurationsBox);
    dialog.borderPanel.setCenter(stackPane);
    BorderPane.setAlignment(configurationsBox, CENTER_LEFT);
    BorderPane.setMargin(configurationsBox, new Insets(MARGIN, MARGIN, MARGIN, 2 * MARGIN));

    // buttons
    dialog.buttonsPanel = new HBox();

    final HBox buttonsPanel = dialog.buttonsPanel;

    buttonsPanel.setSpacing(MARGIN);
    buttonsPanel.setAlignment(BOTTOM_CENTER);
    BorderPane.setMargin(buttonsPanel, new Insets(0, 0, 1.5 * MARGIN, 0));
    borderPanel.setBottom(buttonsPanel);
    borderPanel
        .widthProperty()
        .addListener(
            new ChangeListener<Number>() {
              public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                buttonsPanel.layout();
              }
            });
    dialog.scene = new Scene(borderPanel);
    dialog.setScene(dialog.scene);

    URL resource =
        ConfigurationsDialogBuilder.class.getResource(
            "/com/nurflugel/gradle/ui/dialogservice/dialog.css");
    String externalForm = resource.toExternalForm();

    // dialog.borderPanel.styleClass("dialog");
    dialog.getScene().getStylesheets().add(externalForm);

    return this;
  }
  private void erzeugeDetailAnsicht(PolizistDaten SpaltenDaten) {
    Label LabelA = new Label("PersonenID");
    Label LabelAWert = new Label(Integer.toString(SpaltenDaten.getPersonenID()));

    Label LabelB = new Label("Name");
    Label LabelBWert = new Label(SpaltenDaten.getName());

    Label LabelC = new Label("Geburtsdatum");
    Label LabelCWert = new Label(SpaltenDaten.getGebDatum());

    Label LabelD = new Label("Nationalität");
    Label LabelDWert = new Label(SpaltenDaten.getNation());

    Label LabelE = new Label("Geschlecht");
    Label LabelEWert = new Label(SpaltenDaten.getGeschlecht());

    Label LabelF = new Label("Todesdatum");
    Label LabelFWert = new Label(SpaltenDaten.getTodDatum());

    Label LabelG = new Label("Dienstgrad");
    Label LabelGWert = new Label(SpaltenDaten.getDienstgrad());

    Button ButtonBearbeiten = new Button("Bearbeiten...");
    Button ButtonLoeschen = new Button("Löschen");

    Button ButtonSuchePerson = new Button("Suche nach Person");
    Button ButtonSucheArbeit = new Button("Suche nach Arbeitsverhältnissen");
    Button ButtonSucheArbeitAn = new Button("Suche nach zugewiesenen Fällen");
    Button ButtonSucheNotizen = new Button("Suche nach erstellten Notizen");
    Button ButtonSucheIndizien = new Button("Suche nach eingestellten Indizien");

    Button ButtonClose = new Button("Detailansicht verlassen");

    ButtonBearbeiten.setOnAction(
        event -> {
          Tabelle.getSelectionModel().clearSelection();
          Tabelle.getSelectionModel().select(SpaltenDaten);
          updateSelectedEntry();
          Hauptprogramm.setRechteAnsicht(null);
        });
    ButtonLoeschen.setOnAction(
        event -> {
          Tabelle.getSelectionModel().clearSelection();
          Tabelle.getSelectionModel().select(SpaltenDaten);
          deleteSelectedEntrys();
          Hauptprogramm.setRechteAnsicht(null);
        });

    ButtonSuchePerson.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          PersonenAM.PersonenSuchAnsicht(SpaltenDaten.getPersonenID());
        });
    ButtonSucheArbeit.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          ArbeitenAM.SucheNachPersonenID(SpaltenDaten.getPersonenID());
        });
    ButtonSucheArbeitAn.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          ArbeitenAnAM.SucheNachPersonenID(SpaltenDaten.getPersonenID());
        });
    ButtonSucheNotizen.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          NotizAM.SucheNachAnlegendem(SpaltenDaten.getPersonenID());
        });
    ButtonSucheIndizien.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          IndizAM.SucheNachAnlegendem(SpaltenDaten.getPersonenID());
        });

    ButtonClose.setOnAction(event -> Hauptprogramm.setRechteAnsicht(null));

    ButtonBearbeiten.setMaxWidth(Double.MAX_VALUE);
    ButtonBearbeiten.setMinWidth(150);
    ButtonLoeschen.setMaxWidth(Double.MAX_VALUE);
    ButtonLoeschen.setMinWidth(150);
    ButtonSuchePerson.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheArbeit.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheArbeitAn.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheNotizen.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheIndizien.setMaxWidth(Double.MAX_VALUE);
    ButtonClose.setMaxWidth(Double.MAX_VALUE);

    // Wir haben ein Gridpane oben, eine HBox unten in einer VBox in einem ScrollPane
    GridPane Oben = new GridPane();
    Oben.setHgap(10);
    Oben.setVgap(10);
    Oben.addColumn(0, LabelA, LabelB, LabelC, LabelD, LabelE, LabelF, LabelG);
    Oben.addColumn(
        1, LabelAWert, LabelBWert, LabelCWert, LabelDWert, LabelEWert, LabelFWert, LabelGWert);
    Oben.getColumnConstraints().add(new ColumnConstraints(100));
    Oben.getColumnConstraints().add(new ColumnConstraints(200));

    HBox Unten = new HBox(10);
    Unten.getChildren().addAll(ButtonBearbeiten, ButtonLoeschen);
    Unten.setMaxWidth(300);
    Unten.alignmentProperty().setValue(Pos.CENTER);

    VBox Mittelteil = new VBox(10);
    Mittelteil.setPadding(new Insets(10, 20, 10, 10));
    Mittelteil.getChildren()
        .addAll(
            Oben,
            Unten,
            ButtonSuchePerson,
            ButtonSucheArbeit,
            ButtonSucheArbeitAn,
            ButtonSucheNotizen,
            ButtonSucheIndizien,
            ButtonClose);

    ScrollPane Aussen = new ScrollPane();

    Aussen.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    Aussen.setContent(Mittelteil);

    Hauptprogramm.setRechteAnsicht(Aussen);
  }
  @FXML
  private void ratingButtonClicked(ActionEvent event) throws SQLException {
    configureButtons();
    ratingButton.setGraphic(ratingSelectedIMV);

    // clear old content
    contentPane.getChildren().clear();

    // set up
    titleLabel.setText("Rating and Feedback");

    // rating box
    HBox ratingBox = new HBox();
    ratingBox.setAlignment(Pos.CENTER);
    ratingBox.setSpacing(20);
    ratingBox.setPadding(new Insets(10, 0, 10, 0));

    // Rating label
    Label ratingTitle = new Label("Average Rating: ");
    ratingTitle.setFont(new Font("System", 24));

    // 5 stars
    String yellowStarURL = "Graphics/StarYellow.png";
    String blankStarURL = "Graphics/StarBlank.png";

    ImageView starBlank1 =
        new ImageView(new Image(getClass().getResourceAsStream("Graphics/StarBlank.png")));
    ImageView starBlank2 =
        new ImageView(new Image(getClass().getResourceAsStream("Graphics/StarBlank.png")));
    ImageView starBlank3 =
        new ImageView(new Image(getClass().getResourceAsStream("Graphics/StarBlank.png")));
    ImageView starBlank4 =
        new ImageView(new Image(getClass().getResourceAsStream("Graphics/StarBlank.png")));
    ImageView starBlank5 =
        new ImageView(new Image(getClass().getResourceAsStream("Graphics/StarBlank.png")));

    Button star1 = new Button();
    star1.setGraphic(starBlank1);
    star1.setStyle("-fx-background-color: transparent");
    Button star2 = new Button();
    star2.setGraphic(starBlank2);
    star2.setStyle("-fx-background-color: transparent");
    Button star3 = new Button();
    star3.setGraphic(starBlank3);
    star3.setStyle("-fx-background-color: transparent");
    Button star4 = new Button();
    star4.setGraphic(starBlank4);
    star4.setStyle("-fx-background-color: transparent");
    Button star5 = new Button();
    star5.setGraphic(starBlank5);
    star5.setStyle("-fx-background-color: transparent");

    // get average rating
    double avgRating = 0;
    try {
      avgRating = operation.getAverageRating();
    } catch (SQLException e) {
      e.printStackTrace();
      ratingTitle.setText("Error! Can't get average rating");
    }

    Button[] buttonlist = new Button[5];
    buttonlist[0] = star1;
    buttonlist[1] = star2;
    buttonlist[2] = star3;
    buttonlist[3] = star4;
    buttonlist[4] = star5;

    for (int i = 0; i < Math.floor(avgRating); i++) {
      ImageView image = new ImageView(new Image(getClass().getResourceAsStream(yellowStarURL)));
      buttonlist[i].setGraphic(image);
    }

    // feedback box
    VBox feedBackBox = new VBox();
    feedBackBox.setAlignment(Pos.CENTER);
    feedBackBox.setSpacing(20);

    // Feedback title
    Label feedBackLabel = new Label("Feedback:");
    feedBackLabel.setFont(new Font("System", 24));

    // get feedback string
    String feedback = "";
    ArrayList<Rating> list = operation.getRatingsAndFeedbacks();

    for (Rating r : list) {
      feedback += r.getFeedback() + "\n\n";
    }

    Text feedbackText = new Text(feedback);
    feedbackText.setFont(new Font("System", 14));

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(feedbackText);

    // Add children nodes to appropriate boxes
    ratingBox.getChildren().addAll(ratingTitle, star1, star2, star3, star4, star5);
    feedBackBox.getChildren().addAll(feedBackLabel, scrollPane);

    // main box
    VBox mainBox = new VBox();
    mainBox.setSpacing(40);
    mainBox.getChildren().addAll(ratingBox, feedBackBox);

    contentPane.getChildren().add(mainBox);
  }
  @FXML
  private void reservationsButtonClicked(ActionEvent event) {
    configureButtons();
    reservationsButton.setGraphic(reservationsSelectedIMV);

    // Clear the content of contentPane
    contentPane.getChildren().clear();

    // Set title
    titleLabel.setText("Reservations");

    // Make box for weekly availability and reservations
    VBox box = new VBox();
    box.setSpacing(10);
    box.setAlignment(Pos.TOP_CENTER);
    box.setPrefWidth(900);

    // box for availability
    VBox abox = new VBox();
    box.setSpacing(10);
    box.setAlignment(Pos.TOP_CENTER);
    box.setPrefWidth(900);

    // box for reservations
    VBox resbox = new VBox();
    box.setSpacing(10);
    box.setAlignment(Pos.TOP_CENTER);
    box.setPrefWidth(900);

    // set up for weekly table availability
    Text aHeader = new Text("Tables still available");
    aHeader.setFont(new Font("System", 24));

    TableView aTable = new TableView();
    TableColumn aDateCol = new TableColumn("Date");
    aDateCol.setCellValueFactory(new PropertyValueFactory<>("date"));
    TableColumn tablesCol = new TableColumn("Tables Available");
    tablesCol.setCellValueFactory(new PropertyValueFactory<>("tablesAvailable"));

    // add table and title to availability box
    abox.getChildren().addAll(aHeader, aTable);
    abox.setSpacing(5);

    // set width for all cols
    aDateCol.setMinWidth(100);
    tablesCol.setMinWidth(100);

    aTable.getColumns().addAll(aDateCol, tablesCol);
    // Populate data to the table view
    operation.callDates();
    ObservableList<Availability> adata =
        FXCollections.observableArrayList(operation.getWeeklyAvailability());
    aTable.setItems(adata);
    aTable.setMaxHeight(235);
    aTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    // set up for reservations
    Text resHeader = new Text("All Reservations");
    resHeader.setFont(new Font("System", 24));

    TableView resTable = new TableView();
    TableColumn firstNameCol = new TableColumn("First Name");
    firstNameCol.setCellValueFactory(new PropertyValueFactory<>("firstName"));
    TableColumn lastNameCol = new TableColumn("Last Name");
    lastNameCol.setCellValueFactory(new PropertyValueFactory<>("lastName"));
    TableColumn tidCol = new TableColumn("tID");
    tidCol.setCellValueFactory(new PropertyValueFactory<>("tID"));
    TableColumn partySizeCol = new TableColumn("Party Size");
    partySizeCol.setCellValueFactory(new PropertyValueFactory<>("partySize"));
    TableColumn seatsCol = new TableColumn("Seats");
    seatsCol.setCellValueFactory(new PropertyValueFactory<>("seats"));
    TableColumn dateCol = new TableColumn("Reservation Date");
    dateCol.setCellValueFactory(new PropertyValueFactory<>("reservationDate"));

    // set width for all cols
    firstNameCol.setMinWidth(100);
    lastNameCol.setMinWidth(100);
    tidCol.setMinWidth(100);
    partySizeCol.setMinWidth(100);
    seatsCol.setMinWidth(100);
    dateCol.setMinWidth(300);

    // add table and title to availability box
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(resTable);
    scrollPane.setFitToWidth(true);
    resbox.getChildren().addAll(resHeader, scrollPane);
    resbox.setSpacing(5);

    resTable
        .getColumns()
        .addAll(firstNameCol, lastNameCol, tidCol, partySizeCol, seatsCol, dateCol);
    // Populate data to the table view
    ObservableList<ReservationInfo> resdata =
        FXCollections.observableArrayList(operation.getAllReservations());
    resTable.setItems(resdata);
    resTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    // add table view to content pane
    box.getChildren().addAll(abox, resbox);
    contentPane.getChildren().add(box);
  }