public Pane buildArtifactPropertiesLayout(
      PackageArtifact artifact,
      Map<String, PackageDescriptionViewImpl.ArtifactPropertyContainer> artifactPropertyFields,
      Set<PackageDescriptionViewImpl.ArtifactRelationshipContainer> artifactRelationshipFields,
      Map<String, CheckBox> metadataInheritanceButtonMap,
      PackageDescriptionPresenter packageDescriptionPresenter,
      PackageOntologyService packageOntologyService) {

    this.artifactPropertyFields = artifactPropertyFields;
    this.artifactRelationshipFields = artifactRelationshipFields;

    artifactDetailsLayout = new BorderPane();
    artifactDetailsLayout.setMinHeight(500);
    artifactDetailsLayout.setMinWidth(540);

    artifactDetailsLayout.getStylesheets().add("/css/app.css");
    artifactDetailsLayout.getStyleClass().add(PACKAGE_TOOL_POPUP_CLASS);

    this.metadataInheritanceButtonMap = metadataInheritanceButtonMap;
    this.presenter = packageDescriptionPresenter;
    this.packageOntologyService = packageOntologyService;

    createArtifactDetailsPopup(artifact);

    return artifactDetailsLayout;
  }
Ejemplo n.º 2
0
  public BorderPane viewStockDrinkList(final ObservableList<CategoryVO> listCategory) {
    final BorderPane borderPane = new BorderPane();

    borderPane.setMinWidth(Screen.getPrimary().getVisualBounds().getWidth());
    borderPane.setMinHeight(Screen.getPrimary().getVisualBounds().getHeight());
    borderPane.setPadding(new Insets(15, 0, 0, 20));
    borderPane.setId("borderxx");
    GridPane typesOfDrink = new GridPane();

    typesOfDrink.setVgap(20);
    typesOfDrink.setPadding(new Insets(130, 0, 0, 0));

    ToggleGroup groupDrink = new ToggleGroup();

    GridPane typesOfDrink2 = new GridPane();

    typesOfDrink2.setVgap(20);
    typesOfDrink2.setPadding(new Insets(130, 30, 0, 0));

    final ToggleButton bt1 = new ToggleButton(listCategory.get(0).getCategoryName());
    bt1.setToggleGroup(groupDrink);
    bt1.setId("drinkName");
    bt1.setMaxSize(250, 250);
    typesOfDrink2.add(bt1, 0, 0); // premium whisky

    bt1.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            // borderPane.setStyle("-fx-background-image: url('wine.jpeg');");
            /*borderPane.setCenter(drinks.viewWineStock());
            chkRect()*/
            borderPane.setCenter(
                viewStock(
                    listCategory.get(0).getCategotyId(), listCategory.get(0).getCategoryName()));
            animation.animateLeft(bt1, 0, 0);
          }
        });

    final ToggleButton bt2 = new ToggleButton(listCategory.get(1).getCategoryName());
    bt2.setToggleGroup(groupDrink);
    bt2.setId("drinkName");
    bt2.setMaxSize(250, 250);
    typesOfDrink.add(bt2, 0, 0); // regular whisky
    bt2.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            // borderPane.setStyle("-fx-background-image: url('vodka.jpg');");
            // borderPane.setCenter(drinks.viewVodkaStock());
            borderPane.setCenter(
                viewStock(
                    listCategory.get(1).getCategotyId(), listCategory.get(1).getCategoryName()));
            animation.animateRight(bt2, 0, 0);
          }
        });

    final ToggleButton bt3 = new ToggleButton(listCategory.get(2).getCategoryName());
    bt3.setToggleGroup(groupDrink);
    bt3.setId("drinkName");
    bt3.setMaxSize(250, 250);
    typesOfDrink2.add(bt3, 0, 1); // Premium Vodka
    bt3.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            // borderPane.setStyle("-fx-background-image: url('beer2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(2).getCategotyId(), listCategory.get(2).getCategoryName()));
            animation.animateLeft(bt3, 0, 1);
          }
        });

    final ToggleButton bt4 = new ToggleButton(listCategory.get(3).getCategoryName());
    bt4.setToggleGroup(groupDrink);
    bt4.setId("drinkName");
    bt4.setMaxSize(250, 250);
    typesOfDrink.add(bt4, 0, 1); // Regular Vodka
    bt4.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            // borderPane.setStyle("-fx-background-image: url('whisky.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(3).getCategotyId(), listCategory.get(3).getCategoryName()));
            animation.animateRight(bt4, 0, 1);
          }
        });

    final ToggleButton bt5 = new ToggleButton(listCategory.get(4).getCategoryName());
    bt5.setToggleGroup(groupDrink);
    bt5.setId("drinkName");
    bt5.setMaxSize(250, 250);
    typesOfDrink.add(bt5, 0, 4); // Brandy
    bt5.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            // borderPane.setStyle("-fx-background-image: url('rum2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(4).getCategotyId(), listCategory.get(5).getCategoryName()));
            animation.animateRight(bt5, 0, 4);
          }
        });

    final ToggleButton bt6 = new ToggleButton(listCategory.get(5).getCategoryName());
    bt6.setToggleGroup(groupDrink);
    bt6.setId("drinkName");
    bt6.setMaxSize(250, 250);
    typesOfDrink.add(bt6, 0, 5); // Gin
    bt6.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            // borderPane.setStyle("-fx-background-image: url('Scotch.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(5).getCategotyId(), listCategory.get(5).getCategoryName()));
            animation.animateRight(bt6, 0, 5);
          }
        });

    final ToggleButton bt7 =
        new ToggleButton(listCategory.get(6).getCategoryName().replace('&', '\n'));
    bt7.setToggleGroup(groupDrink);
    bt7.setId("drinkName");
    bt7.setMaxSize(250, 250);
    typesOfDrink2.add(bt7, 0, 5); // White Rum and Premixes
    bt7.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(6).getCategotyId(), listCategory.get(6).getCategoryName()));
            animation.animateLeft(bt7, 0, 5);
          }
        });

    final ToggleButton bt8 = new ToggleButton(listCategory.get(7).getCategoryName());
    bt8.setToggleGroup(groupDrink);
    bt8.setId("drinkName");
    bt8.setMaxSize(250, 250);
    typesOfDrink.add(bt8, 0, 3); // Regular Rum
    bt8.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(7).getCategotyId(), listCategory.get(7).getCategoryName()));
            animation.animateRight(bt8, 0, 3);
          }
        });

    final ToggleButton bt9 = new ToggleButton(listCategory.get(8).getCategoryName());
    bt9.setToggleGroup(groupDrink);
    bt9.setId("drinkName");
    bt9.setMaxSize(250, 250);
    typesOfDrink.add(bt9, 0, 6); // Beer
    bt9.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(8).getCategotyId(), listCategory.get(8).getCategoryName()));
            animation.animateRight(bt9, 0, 6);
          }
        });

    final ToggleButton bt10 = new ToggleButton(listCategory.get(9).getCategoryName());
    bt10.setToggleGroup(groupDrink);
    bt10.setId("drinkName");
    bt10.setMaxSize(250, 250);
    typesOfDrink2.add(bt10, 0, 3); // Wine
    bt10.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(9).getCategotyId(), listCategory.get(9).getCategoryName()));
            animation.animateLeft(bt10, 0, 3);
          }
        });

    final ToggleButton bt11 = new ToggleButton(listCategory.get(10).getCategoryName());
    bt11.setToggleGroup(groupDrink);
    bt11.setId("drinkName");
    bt11.setMaxSize(250, 250);
    typesOfDrink2.add(bt11, 0, 2); // Premium Scotch
    bt11.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(10).getCategotyId(), listCategory.get(10).getCategoryName()));
            animation.animateLeft(bt11, 0, 2);
          }
        });

    final ToggleButton bt12 = new ToggleButton(listCategory.get(11).getCategoryName());
    bt12.setToggleGroup(groupDrink);
    bt12.setId("drinkName");
    bt12.setMaxSize(250, 250);
    typesOfDrink.add(bt12, 0, 2); // regular Scotch
    bt12.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(11).getCategotyId(), listCategory.get(11).getCategoryName()));
            animation.animateRight(bt12, 0, 2);
          }
        });

    final ToggleButton bt13 = new ToggleButton(listCategory.get(12).getCategoryName());
    bt13.setToggleGroup(groupDrink);
    bt13.setId("drinkName");
    bt13.setMaxSize(250, 250);
    typesOfDrink2.add(bt13, 0, 4); // Beverages
    bt13.setOnAction(
        new EventHandler<ActionEvent>() {

          @Override
          public void handle(ActionEvent e) {
            //	borderPane.setStyle("-fx-background-image: url('othertype2.jpg');");
            borderPane.setCenter(
                viewStock(
                    listCategory.get(12).getCategotyId(), listCategory.get(12).getCategoryName()));
            animation.animateLeft(bt13, 0, 4);
          }
        });
    // typesOfDrink.getChildren().addAll(tbWine,tbVodka,tbBeer,tbWisky,tbRum,tbScotch,tbOther);
    borderPane.setLeft(typesOfDrink);
    borderPane.setRight(typesOfDrink2);
    bt2.fire();
    return borderPane;
  }
Ejemplo n.º 3
0
  public Connexion(final Stage stage) throws Exception {

    panelTitre.getChildren().add(titre);
    panelTitre.setAlignment(Pos.CENTER);
    panelTitre.setMinHeight(50);

    gridPane.setAlignment(Pos.CENTER);
    borderCenter.setCenter(gridPane);
    borderCenter.setMinHeight(100);

    panelPrincipal.setTop(panelTitre);
    panelPrincipal.setCenter(borderCenter);

    titre.setFont(Font.font("Verdana", 40));

    FileReader fr = new FileReader(fichierLogin);
    @SuppressWarnings("resource")
    BufferedReader br = new BufferedReader(fr);

    String ligneAdmin = br.readLine();
    String ligneUtil = br.readLine();

    String[] tabAdmin = ligneAdmin.split(";");
    admin.setIdentifiant(tabAdmin[0]);
    admin.setMotDePasse(tabAdmin[1]);

    String[] tabUtil = ligneUtil.split(";");
    util.setIdentifiant(tabUtil[0]);
    util.setMotDePasse(tabUtil[1]);

    panelPrincipal.setPadding(new Insets(10, 50, 50, 50));

    gridPane.setPadding(new Insets(7));
    gridPane.setHgap(7);
    gridPane.setVgap(7);

    lblUserName.setFont(Font.font("Arial", 15));
    lblPassword.setFont(Font.font("Arial", 15));

    gridPane.add(lblUserName, 0, 0);
    gridPane.add(txtUserName, 1, 0);
    gridPane.add(lblPassword, 0, 1);
    gridPane.add(pf, 1, 1);
    gridPane.add(btnLogin, 1, 3);
    gridPane.add(lblMessage, 1, 5);
    btnLogin.setFont(Font.font(null, 15));
    gridPane.setMinWidth(100);

    btnLogin.setPrefSize(100, 15);
    btnLogin.setOnAction(
        new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            checkUser = txtUserName.getText().toString();
            checkPw = pf.getText().toString();
            if (checkUser.equals(admin.getIdentifiant()) && checkPw.equals(admin.getMotDePasse())) {
              new EcranGestionStagiaire(stage);
            } else if (checkUser.equals(util.getIdentifiant())
                && checkPw.equals(util.getMotDePasse())) {
              new EcranAffichageStagiaire(stage);
            } else {
              lblMessage.setText("Identifiant ou mot de passe erroné");
              lblMessage.setFont(Font.font("Arial", 12));
              lblMessage.setTextFill(Color.RED);
            }
            txtUserName.setText("");
            pf.setText("");
          }
        });
    panelPrincipal.setStyle("-fx-background-color: #DCDCDC");
    Scene scene = new Scene(panelPrincipal, 800, 550);
    stage.setTitle("Annuaire des stagiaires");
    stage.setScene(scene);
    stage.show();
  }