Пример #1
0
  private void loadMapUI(Group root) {
    Group editorUI = new Group();
    editorUI.setLayoutX(0);
    editorUI.setLayoutY(600);
    editorUI.setVisible(true);

    ToggleGroup tGroup = new ToggleGroup();

    ToggleButton tb1 = new ToggleButton("Ground");
    tb1.setLayoutX(0);
    tb1.setLayoutY(0);
    tb1.setId("Ground");
    ToggleButton tb2 = new ToggleButton("Forest");
    tb2.setLayoutX(70);
    tb2.setLayoutY(0);
    tb2.setId("Forest");
    ToggleButton tb3 = new ToggleButton("G Env");
    tb3.setLayoutX(140);
    tb3.setLayoutY(0);
    tb3.setId("GEnv");

    tb1.setToggleGroup(tGroup);
    tb2.setToggleGroup(tGroup);
    tb3.setToggleGroup(tGroup);

    tGroup.selectedToggleProperty().addListener(new Gui.Listener.EditorChangePaletteListener());
    tGroup.selectToggle(tb1);
    editorUI.getChildren().add(tb1);
    editorUI.getChildren().add(tb2);
    editorUI.getChildren().add(tb3);

    root.getChildren().add(editorUI);
  }
Пример #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;
  }