protected Node getContentNode() {
    Node taskView = getTaskView();

    if (SettingsUtil.loadSettings().isShowStatistics()) {
      LOGGER.debug("Statistics enabled in settings");
      statisticsView = new VBox(20);

      // wrap statistics in scrollpane
      ScrollPane scrollPane = new ScrollPane(statisticsView);
      scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
      scrollPane.setFitToWidth(true);
      scrollPane.setPadding(new Insets(7));

      // both statistics and task view present
      // show both in a split pane
      SplitPane splitPane = new SplitPane();
      splitPane.setOrientation(Orientation.HORIZONTAL);
      splitPane.setDividerPosition(0, 0.8);
      splitPane.getItems().addAll(taskView, scrollPane);
      return splitPane;
    } else {
      LOGGER.debug("Statistics disabled in settings");
      return taskView;
    }
  }
 public CFBamJavaFXUInt32TypeAddPane(
     ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamUInt32TypeObj argFocus) {
   super();
   final String S_ProcName = "construct-schema-focus";
   if (formManager == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 1, "formManager");
   }
   cfFormManager = formManager;
   if (argSchema == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 2, "argSchema");
   }
   // argFocus is optional; focus may be set later during execution as
   // conditions of the runtime change.
   javafxSchema = argSchema;
   setJavaFXFocus(argFocus);
   attrPane = argSchema.getUInt32TypeFactory().newAttrPane(cfFormManager, argFocus);
   attrScrollPane = new ScrollPane(attrPane);
   attrScrollPane.setFitToWidth(true);
   attrScrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
   attrScrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
   attrScrollPane.setContent(attrPane);
   setOrientation(Orientation.VERTICAL);
   getItems().add(attrScrollPane);
 }
 // https://docs.oracle.com/javafx/2/ui_controls/table-view.htm
 @SuppressWarnings("unchecked")
 public DataPanel(final String string) {
   super(string);
   tableView = new ScrollPane();
   tableView.setPrefSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
   tableView.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
   // set(MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithHeight(),
   // MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithWidth());
   elementName = new TableColumn<>("element-name");
   elementValue = new TableColumn<>("element-value");
   elementName.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("elementName"));
   elementValue.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("elementValue"));
   dataTable = new TableView<TableEntry>();
   dataTable.getColumns().addAll(elementName, elementValue);
   dataTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
   dataTable.setPrefHeight(
       MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithHeight());
   dataTable.setPrefWidth(
       MsstGuiPckg.getInstance().getGuiPreferredSize().propertyDataPanelWithWidth());
   dataTable.setEditable(true);
   tableView.setContent(dataTable);
   ;
   tableView.setFitToHeight(true);
   tableView.setFitToWidth(true);
   setContent(tableView);
 }
Beispiel #4
0
  public FamilyForm() {

    getStylesheets().add("/CSS/familyFormCss.css");

    save = new Button("Save");
    cancel = new Button("Cancel");

    Title.setFontSmoothingType(FontSmoothingType.LCD);
    Title.setFont(javafx.scene.text.Font.font(20));

    scrollPane = new ScrollPane(getSubGrid());
    scrollPane.setFitToWidth(true);

    save.setPrefWidth(80);
    cancel.setPrefWidth(80);

    clientID = Controller.getInstance().getStaffInfo().getAccountID();

    /////////////////////////////////// MAIN PANE ///////////////////////////////////

    setConstraints(Title, 0, 0, 1, 1, HPos.CENTER, VPos.CENTER);
    setConstraints(scrollPane, 0, 1, 1, 1, HPos.CENTER, VPos.CENTER);

    getChildren().addAll(Title, scrollPane);

    save.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            if (Validate()) {
              String name = Name.getText().trim();

              if (Controller.isNotified && orginalName.equals("")) {
                orginalName = name;
              } else if (Controller.isNotified && !(orginalName.equals(""))) {
                if (!orginalName.equals(name)) {
                  orginalName = name;
                  Controller.isNotified = false;
                }
              }
              Save();
            }
          }
        });

    cancel.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            clear();
          }
        });
  }
 @Override
 protected ScrollPane createObjectsLayer() {
   objectsLayer = new ResourceGanttPlanObjectsLayer(controller);
   // Запихиваем слой объектов в скролл пэйн
   ScrollPane verticalScrollPane = new ScrollPane(objectsLayer);
   verticalScrollPane.setFitToWidth(true);
   verticalScrollPane
       .getStylesheets()
       .add(
           this.getClass()
               .getResource("/css/scrollpane.css")
               .toExternalForm()); // делаем вертикальный скроллпэйн прозрачным
   // Синхронизируем вертикальный скролл слоя объектов cо скроллом таблицы задач
   verticalScrollPane
       .vvalueProperty()
       .bindBidirectional(controller.resourceVerticalScrollValueProperty());
   return verticalScrollPane;
 }
Beispiel #6
0
  private static void showAdvancedSearch(Application app) {
    WorkbenchView view = new WorkbenchView();
    FormLayout formLayout = new FormLayout();

    formLayout.addHeader("Advanced Search");
    formLayout.addField("Name");

    formLayout.addActions(new Action("Save"), new Action("Cancel"));

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(formLayout);
    scrollPane.setFitToWidth(true);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);

    view.setCenterNode(scrollPane);

    app.setWorkbench(view);
    app.clearGlobalActions();
  }
  public EventPopoverPage(final DataService dataService, final Event event, boolean showBack) {
    this.showBack = showBack;
    getStyleClass().add("event-popover-page");

    final Session session = event.getSession();

    scrollPane = new ScrollPane();
    scrollPane.setFitToWidth(true);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    content =
        session == null
            ? new EventContent(event, dataService)
            : new SessionContent(session, event, dataService);
    scrollPane.setContent(content);
    getChildren().add(scrollPane);

    if (CHECK_AVAIL_TASK != null) {
      CHECK_AVAIL_TASK.cancel();
    }

    if (!ConferenceScheduleApp.getInstance().getSessionManagement().isGuestProperty().get()
        && content instanceof SessionContent) {
      CHECK_AVAIL_TASK = dataService.checkAvailability(event);
      CHECK_AVAIL_TASK.setOnSucceeded(
          new EventHandler<WorkerStateEvent>() {
            @Override
            public void handle(WorkerStateEvent event) {
              final SessionContent sc = (SessionContent) content;
              final Availability avail = CHECK_AVAIL_TASK.getValue();
              if (!sc.fav) {
                sc.button.setText(avail.full ? "Session Full" : "Register");
                full.set(avail.full);
              }
            }
          });
      FILTER_EXECUTOR.submit(CHECK_AVAIL_TASK);
    }
  }
  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);
  }
Beispiel #9
0
  private static void showCustomizeResults(Application app) {
    WorkbenchView view = new WorkbenchView();

    FormLayout formLayout = new FormLayout();
    formLayout.addHeader("Customize Results");

    formLayout.addField("Return related associations", EditorType.CHECKBOX);
    formLayout.addField("Return concurrent observations", EditorType.CHECKBOX);
    formLayout.addField("Return concept hierarchy", EditorType.CHECKBOX);
    formLayout.addField("Return basic organism phylogeny", EditorType.CHECKBOX);
    formLayout.addField("Return detailed organism phylogeny", EditorType.CHECKBOX);
    formLayout.addField("Categorize associations into columns", EditorType.CHECKBOX);

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(formLayout);
    scrollPane.setFitToWidth(true);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);

    view.setCenterNode(scrollPane);

    app.setWorkbench(view);
    app.clearGlobalActions();
  }
 public CFDbTestJavaFXOptFullRangeAskDeleteForm(
     ICFFormManager formManager,
     ICFDbTestJavaFXSchema argSchema,
     ICFDbTestOptFullRangeObj argFocus,
     ICFDeleteCallback callback) {
   super();
   final String S_ProcName = "construct-schema-focus";
   if (formManager == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 1, "formManager");
   }
   cfFormManager = formManager;
   if (argSchema == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 2, "argSchema");
   }
   // argFocus is optional; focus may be set later during execution as
   // conditions of the runtime change.
   javafxSchema = argSchema;
   javaFXFocus = argFocus;
   deleteCallback = callback;
   // Construct the various objects
   textAreaMessage = new CFTextArea();
   textAreaMessage.setText("Are you sure you want to delete this OptFullRange?");
   hboxButtons = new CFHBox(10);
   buttonOk = new CFButton();
   buttonOk.setMinWidth(200);
   buttonOk.setText("Ok");
   buttonOk.setOnAction(
       new EventHandler<ActionEvent>() {
         @Override
         public void handle(ActionEvent e) {
           final String S_ProcName = "actionOkPerformed";
           try {
             ICFDbTestOptFullRangeObj obj = getJavaFXFocusAsOptFullRange();
             ICFDbTestOptFullRangeEditObj editObj = (ICFDbTestOptFullRangeEditObj) obj.beginEdit();
             editObj.delete();
             editObj.endEdit();
             cfFormManager.closeCurrentForm();
             if (deleteCallback != null) {
               deleteCallback.formClosed(null);
               deleteCallback.deleted(obj);
             }
           } catch (Throwable t) {
             CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
           }
         }
       });
   buttonCancel = new CFButton();
   buttonCancel.setMinWidth(200);
   buttonCancel.setText("Cancel");
   buttonCancel.setOnAction(
       new EventHandler<ActionEvent>() {
         @Override
         public void handle(ActionEvent e) {
           final String S_ProcName = "actionCancelPerformed";
           try {
             cfFormManager.closeCurrentForm();
             if (deleteCallback != null) {
               deleteCallback.formClosed(null);
             }
           } catch (Throwable t) {
             CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
           }
         }
       });
   hboxButtons.getChildren().addAll(buttonOk, buttonCancel);
   attrPane = argSchema.getOptFullRangeFactory().newAttrPane(cfFormManager, argFocus);
   scrollPane = new ScrollPane();
   scrollPane.setFitToWidth(true);
   scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
   scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
   scrollPane.setContent(attrPane);
   setTop(textAreaMessage);
   setCenter(scrollPane);
   setBottom(hboxButtons);
 }
  /*
   * Creates an artifact details popup. This popup's content is a tabbed view, with a tab for general properties,
   * creator properties, and relationships.
   * @param artifact
   */
  private void createArtifactDetailsPopup(PackageArtifact artifact) {

    // The property popup will consist of the three tabs, general, creator and relationships.
    TabPane propertiesPopup = new TabPane();
    propertiesPopup.getStyleClass().add(PROPERTIES_POPUP_CLASS);

    // Create the general tab, all the properties that are not creator properties, as
    // defined by the ontology will be located here.
    Tab generalTab = new Tab();
    generalTab.setClosable(false);
    generalTab.setText(labels.get(Labels.LabelKey.PACKAGE_ARTIFACT_GENERAL));
    ScrollPane generalPane = new ScrollPane();
    generalPane.setHvalue(500);
    generalPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    generalPane.setContent(createGeneralTab(artifact));
    generalPane.setMinWidth(500);
    generalPane.setFitToWidth(true);
    generalTab.setContent(generalPane);

    propertiesPopup.getTabs().add(generalTab);

    // Displays all the properties that are labeled as creator properties by the
    // ontology.
    Tab creatorTab = new Tab();
    creatorTab.setClosable(false);
    ScrollPane creatorPane = new ScrollPane();
    creatorPane.setHvalue(500);
    creatorPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    creatorPane.setContent(createCreatorTab(artifact));
    creatorPane.setMinWidth(500);
    creatorPane.setFitToWidth(true);
    creatorTab.setText(labels.get(Labels.LabelKey.PACKAGE_ARTIFACT_CREATOR));
    creatorTab.setContent(creatorPane);

    if (creatorPane.getContent() != null) {
      propertiesPopup.getTabs().add(creatorTab);
    }

    // Create the relationship tab that displays all relationships the artifact has.
    Tab relationshipTab = new Tab();
    relationshipTab.setClosable(false);
    relationshipTab.setText(labels.get(Labels.LabelKey.PACKAGE_ARTIFACT_RELATIONSHIPS));
    ScrollPane relationshipPane = new ScrollPane();
    relationshipPane.setHvalue(500);
    relationshipPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    relationshipPane.setContent(createRelationshipTab(artifact));
    relationshipPane.setMinWidth(500);
    relationshipPane.setFitToWidth(true);
    relationshipTab.setContent(relationshipPane);
    propertiesPopup.getTabs().add(relationshipTab);

    // Create the inheritance tab that displays all inheritable properties that an artifact has.
    Tab inheritanceTab = new Tab();
    inheritanceTab.setClosable(false);
    inheritanceTab.setText(labels.get(Labels.LabelKey.PACKAGE_ARTIFACT_INHERITANCE));
    ScrollPane inheritancePane = new ScrollPane();
    inheritancePane.setHvalue(500);
    inheritancePane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    inheritancePane.setContent(createInheritanceTab(artifact));
    inheritancePane.setMinWidth(500);
    inheritancePane.setFitToWidth(true);
    inheritanceTab.setContent(inheritancePane);
    propertiesPopup.getTabs().add(inheritanceTab);

    artifactDetailsLayout.setCenter(propertiesPopup);

    HBox popupControls = new HBox(24);
    popupControls.setAlignment(Pos.CENTER_RIGHT);

    popupControls.getStyleClass().add(VIEW_FOOTER_CLASS);
    popupControls.setPrefHeight(40);

    popupControls.getChildren().add(cancelPopupLink);

    popupControls.getChildren().add(applyPopupButton);

    artifactDetailsLayout.setBottom(popupControls);
  }
  public IndividualLifeBarTitledPane(final IndividualLifeBar individualLifeBar) {
    this.individualLifeBar = individualLifeBar;

    setText("Configuração LifeBar de Objeto");

    VBox layout = new VBox();

    GridPane gridPane = new GridPane();

    ColumnConstraints col1 = new ColumnConstraints();
    col1.setPercentWidth(40);
    ColumnConstraints col2 = new ColumnConstraints();
    col2.setPercentWidth(30);
    ColumnConstraints col3 = new ColumnConstraints();
    col3.setPercentWidth(30);
    gridPane.getColumnConstraints().addAll(col1, col2, col3);

    Label label = new Label("Objeto");
    gridPane.add(label, 0, 0);

    boxLabelObjects = new ComboBox<String>();
    boxLabelObjects.getItems().addAll(individualLifeBar.getWorld().getObjectIds());

    if (individualLifeBar.getOwnerId() != null) {
      boxLabelObjects.getSelectionModel().select(individualLifeBar.getOwnerId());
    }

    boxLabelObjects.setOnMouseClicked(
        new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            for (String label : individualLifeBar.getWorld().getObjectIds()) {
              if (!boxLabelObjects.getItems().contains(label)) {
                boxLabelObjects.getItems().add(label);
              }
            }
          }
        });

    boxLabelObjects.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            individualLifeBar.setOwner(boxLabelObjects.getValue());
          }
        });

    gridPane.add(boxLabelObjects, 1, 0);
    layout.getChildren().add(gridPane);

    Separator separator = new Separator(Orientation.HORIZONTAL);
    separator.setPadding(new Insets(5, 0, 5, 0));
    layout.getChildren().add(separator);
    layout.setPadding(new Insets(5));

    lifeBarPane = new LifebarPane(individualLifeBar);
    layout.getChildren().add(lifeBarPane);
    ScrollPane scroll = new ScrollPane(layout);
    scroll.setFitToWidth(true);
    setContent(scroll);
  }
  @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);
  }
Beispiel #14
0
  /* ADMIN SCENE */
  public void start(Stage primaryStage) throws Exception {
    /** Done by Marco */
    primaryStage.setTitle("PubFinder");
    primaryStage.setResizable(false);
    PubDataAccessor.PubDataAccessor();

    /*Welcome scene*/
    WelcomeScene.welcomeScene();
    welcomeScene = WelcomeScene.welcomeScene;
    /*Welcome scene*/
    /** End of Marcos Work */
    /** Done by Shafiq and Anotnino */
    /* Admin add scene*/
    AdminAddScene.adminAddscene();
    adminAddScene = AdminAddScene.adminAddScene;
    /* Admin add scene*/

    /*Admin login scene*/
    AdminLoginScene.adminloginscene();
    adminLoginScene = AdminLoginScene.adminLoginScene;
    /*Admin login scene*/

    /*Admin choice scene*/
    AdminChoiceScene.adminchoicescene();
    adminChoiceScene = AdminChoiceScene.adminChoiceScene;
    /*Admin choice scene*/

    /* Admin Edit Scene*/
    adminEditScene = AdminEditScene.editScene;
    /* Admin Edit Scene*/
    /** End of Shafiq and Anotonino's Work */

    /*Pub button scene*/
    pubLayout = new StackPane();
    /** Done by Ahmad */
    searchNameInput = new TextField();
    searchNameInput.setId("search-field");
    searchNameInput.setPromptText("NAME");
    /** End of Ahmad's Work */
    searchStreetInput = new TextField();
    searchStreetInput.setId("search-field");
    searchStreetInput.setPromptText("STREET");
    searchAgeInput = new TextField();
    searchAgeInput.setId("search-field");
    searchAgeInput.setPromptText("AGE");
    /** Done by Aseel */
    CheckBox searchStudentDiscount = new CheckBox("DISCOUNTS");
    CheckBox searchBySpecialEvents = new CheckBox("EVENTS");
    CheckBox searchWithoutFees = new CheckBox("NO FEES");
    searchStudentDiscount.setId("check-search");
    searchBySpecialEvents.setId("check-search");
    searchWithoutFees.setId("check-search");
    ComboBox searchByRating =
        new ComboBox(
            FXCollections.observableArrayList(
                "\uF005",
                "\uF005\uF005",
                "\uF005\uF005\uF005",
                "\uF005\uF005\uF005\uF005",
                "\uF005\uF005\uF005\uF005\uF005"));
    searchByRating.setTooltip(new Tooltip("RATING"));
    searchByRating.setPromptText("RATING");
    searchByRating.setId("combo-search");
    ComboBox searchByArea =
        new ComboBox(
            FXCollections.observableArrayList(
                "All",
                "Avenyn",
                "Linné",
                "Haga",
                "Järntorget",
                "Magasinsgatan",
                "Vasastaden",
                "Gamlestaden",
                "Heden",
                "Masthugget",
                "Stigberget",
                "Other"));
    searchByArea.setTooltip(new Tooltip("AREA"));
    searchByArea.setPromptText("AREA");
    searchByArea.setId("combo-search");
    /** End of Aseel's Work */

    /** Done by Marco */
    pubLayout.setId("pubs");
    search = new Button("SEARCH");
    search.setId("button-search");
    GridPane inputGrid = new GridPane();
    inputGrid.setMaxHeight(100);
    inputGrid.setHgap(10);
    inputGrid.setVgap(10);
    inputGrid.setId("searchGrid");
    StackPane.setAlignment(inputGrid, Pos.TOP_LEFT);
    StackPane.setAlignment(search, Pos.TOP_RIGHT);
    /** End of Marco's Work */
    search.setOnAction(e -> searchForPubs());
    /** Done by Ahmad */
    searchNameInput.setOnKeyReleased(
        event1 -> {
          if (event1.getCode() == KeyCode.ENTER) {
            searchForPubs();
          }
        });
    /** End of Ahmad's Work */

    /** Done by Marco */
    searchStreetInput.setOnKeyReleased(
        event2 -> {
          if (event2.getCode() == KeyCode.ENTER) {
            searchForPubs();
          }
        });
    /** End of Marco's Work */

    /** Done by Ahmad */
    searchAgeInput.setOnKeyReleased(
        event3 -> {
          if (event3.getCode() == KeyCode.ENTER) {
            searchForPubs();
          }
        });
    /** End of Ahmad's Work */

    /** Done by Shafiq & Anotnino */
    searchStudentDiscount.setOnAction(
        event4 -> {
          if (searchStudentDiscount.isSelected()) {
            discount = 1;
          }
          if (!searchStudentDiscount.isSelected()) {
            discount = 0;
          }
        });

    searchWithoutFees.setOnAction(
        event5 -> {
          if (searchWithoutFees.isSelected()) {
            fee = 0;
          }
          if (!searchWithoutFees.isSelected()) {
            fee = 1;
          }
        });

    searchBySpecialEvents.setOnAction(
        event6 -> {
          if (searchBySpecialEvents.isSelected()) {

            searchEvent = true;
          }
          if (!searchBySpecialEvents.isSelected()) {
            searchEvent = false;
          }
        });

    searchByRating.setOnAction(
        event7 -> {
          if (searchByRating.getSelectionModel().isSelected(0)) {
            numberOfStars = 1;
          } else if (searchByRating.getSelectionModel().isSelected(1)) {
            numberOfStars = 2;
          } else if (searchByRating.getSelectionModel().isSelected(2)) {
            numberOfStars = 3;
          } else if (searchByRating.getSelectionModel().isSelected(3)) {
            numberOfStars = 4;
          } else if (searchByRating.getSelectionModel().isSelected(4)) {
            numberOfStars = 5;
          }
        });
    /** End of Shafiq and Anotino's Work */

    /** Done by Aseel and Antonino */
    searchByArea.setOnAction(
        event8 -> {
          if (searchByArea.getSelectionModel().isSelected(0)) {
            area_checker = 2;
          }
          if (searchByArea.getSelectionModel().isSelected(1)) {
            area = 0;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(2)) {
            area = 2;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(3)) {
            area = 3;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(4)) {
            area = 4;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(5)) {
            area = 5;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(6)) {
            area = 6;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(7)) {
            area = 7;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(8)) {
            area = 8;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(9)) {
            area = 9;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(10)) {
            area = 10;
            area_checker = 1;
          } else if (searchByArea.getSelectionModel().isSelected(11)) {
            area = 11;
            area_checker = 1;
          }
        });
    /** End of Aeel and Antonino's Work */

    /** Done by marco */
    ScrollPane pubScroll = new ScrollPane();
    pubScroll.setId("scroll");
    pubScroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    pubScroll.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);

    pubs = new GridPane();
    pubScroll.setContent(pubs);
    pubs.setId("pub-grid");
    pubs.setAlignment(Pos.CENTER);
    pubLayout.getChildren().add(pubScroll);

    inputGrid.add(searchNameInput, 1, 1);
    inputGrid.add(searchStreetInput, 2, 1);
    inputGrid.add(searchAgeInput, 3, 1);

    inputGrid.add(searchByRating, 4, 1);
    inputGrid.add(searchByArea, 5, 1);
    inputGrid.add(searchStudentDiscount, 6, 1);
    inputGrid.add(searchBySpecialEvents, 7, 1);
    inputGrid.add(searchWithoutFees, 8, 1);

    pubLayout.getChildren().add(inputGrid);
    pubLayout.getChildren().add(search);
    noPub = new Label("No pubs found");
    searchForPubs();

    pubScene = new Scene(pubLayout, 1000, 600);
    pubScene.getStylesheets().addAll(this.getClass().getResource("style.css").toExternalForm());
    /*Pub button scene*/

    /*Pub scene*/
    ScrollPane pubPageLayout = new ScrollPane();
    pubPageLayout.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    pubPageLayout.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    pubPageLayout.setFitToWidth(true);
    pubPageLayout.setContent(xPane);
    xPane.setId("pubScene");
    pubPageLayout.setId("gej");
    star.setId("starButton");
    eventLabel.setId("eventLabel");

    /*Items*/
    xPane.add(back, 1, 1);
    back.setId("button-logout");

    back.setOnAction(
        (event) -> {
          primaryStage.setScene(pubScene);
          xPane
              .getChildren()
              .removeAll(description, rating, overlay, pubName, map, star, rates, events);
          descriptionGrid
              .getChildren()
              .removeAll(age, open, address, type, discountForStudents, entranceFees);
          events.getChildren().removeAll(eventDescriptionGrid);
          eventDescriptionGrid.getChildren().removeAll(eventLabel, eventPane);
          eventPane.getChildren().removeAll(eventGrid);
          eventGrid.getChildren().removeAll(eventName, eventDescription);

          star.setText("0 \uF08A");
          star.setStyle(
              "#starButton{-fx-text-fill: #fff;}  #starButton:hover{-fx-text-fill: #fff;}");
        });
    /** End of Marco's work */

    /** Done by Shafiq & Antonino */
    star.setOnAction(
        event -> {
          int rate = PubDataAccessor.checkRate(this.id);
          int rateUpdate = rate + 1;
          /** End of Shafiq & Antonino's Work */

          /** Done by marco */
          star.setText((rateUpdate) + " \uF004");
          PubDataAccessor.updateRate(this.id);
          star.setStyle("-fx-text-fill: #731a2b;");
        });

    overlay.setHeight(header.getFitHeight());
    overlay.setWidth(header.getFitWidth() + 24);
    overlay.setX(0);
    overlay.setY(0);
    overlay.fillProperty().set(javafx.scene.paint.Color.rgb(115, 26, 43, 0.3));

    pubPage = new Scene(pubPageLayout, 1000, 600);
    pubPage.getStylesheets().addAll(this.getClass().getResource("style.css").toExternalForm());
    /*Pub scene*/

    primaryStage.setScene(welcomeScene);
    primaryStage.show();
    Main.primaryStage = primaryStage;
    /** End of Marcos work */
  }