@Override
  public void initialize(URL arg0, ResourceBundle arg1) {

    initRectangle();
    initLogo();
    initTreeView();
    initGenButton();
    AddDbAction addDbAction = new AddDbAction(mItemMySql);
    for (int i = 0; i < 50; i++) {
      SelectLabel label = new SelectLabel("asd");

      label.setWrapText(true);
      label.setGraphic(new ImageView(Context.Icon_Table2));
      label.getStyleClass().add("label1");

      flowPane.getChildren().add(label);
    }

    flowPane.setPadding(new Insets(5, 0, 0, 5));
    flowPane.setVgap(5);
    flowPane.setHgap(5);
    flowPane.setMaxSize(200d, 200d);
    flowPane.autosize();

    flowPaneRoot.getChildren().add(selection);
  }
 private FlowPane createAssignedUserPane() {
   FlowPane assignedUserPane = new FlowPane();
   assignedUserPane.setPadding(new Insets(5, 5, 5, 5));
   assignedUserPane.setHgap(3);
   assignedUserPane.setVgap(5);
   assignedUserPane.setStyle("-fx-border-radius: 3;");
   return assignedUserPane;
 }
Beispiel #3
0
  public CreditView() {
    this.setUpTop();
    this.setUpCreditDescription();

    FlowPane botContainer = new FlowPane();
    botContainer.setOrientation(Orientation.HORIZONTAL);
    botContainer.setAlignment(Pos.CENTER_RIGHT);
    botContainer.setPadding(new Insets(5, 5, 5, 5));
    Button getBtn = new Button("Оформить заявку");
    botContainer.getChildren().add(getBtn);
    this.setBottom(botContainer);

    this.getStyleClass().add("credit-view");
  }
  public BoardView(int noPlayers, final Stage primaryStage) {

    window = primaryStage;
    window.setTitle("Quoridor");
    window.setMaxHeight(1280);
    window.setMaxWidth(1280);
    window.setResizable(false);

    BorderPane border = new BorderPane();

    infoPane = new FlowPane();
    infoPane.setPadding(new Insets(10));
    infoPane.setHgap(40);
    infoPane.setVgap(10);
    infoPane.setOrientation(Orientation.HORIZONTAL);

    bottomPane = new HBox();
    bottomPane.setSpacing(345);

    gameGrid = new GridPane();
    gameGrid.setPadding(new Insets(4));
    gameGrid.setId("gamegrid");

    border.setTop(infoPane);
    border.setCenter(gameGrid);

    playerPositionButtons = new PlayerPositionButton[9][9];
    wallPositionButtons = new WallPositionButton[9][8];
    horizontalWalls = new Pane[9][9];
    verticalWalls = new Pane[9][9];

    column = 0;
    row = 0;

    chooseVertical = new Button();
    chooseVertical.setPrefSize(100, 100);
    chooseVertical.setId("vWallBtn");

    Button home = new Button();
    home.setPrefSize(100, 100);
    home.setId("home");
    home.setOnAction(e -> confirmBox());

    bottomPane.getChildren().addAll(chooseVertical, home);

    border.setBottom(bottomPane);
    border.setMargin(bottomPane, new Insets(40, 40, 20, 20));

    for (int y = 0; y < 8; y++) {
      createMoveLine(y);
      createWallLine(y);
    }

    createMoveLine(8);

    main = new Scene(border, 600, 768);
    main.getStylesheets().add("gameplay/viewJFX/" + stylesheet);
    buildPlayerLabels(noPlayers);
    window.setScene(main);
    window.show();
  }
Beispiel #5
0
  @Override
  public void start(Stage stage) throws Exception {

    // ----------MENU----------

    MenuBar menuBar = new MenuBar();

    Menu menuFile = new Menu("File");
    MenuItem menuItemPurchase = new MenuItem("New Purchase");
    MenuItem menuItemStore = new MenuItem("New Store");
    MenuItem menuItemCategory = new MenuItem("New Category");
    MenuItem menuItemExit = new MenuItem("Exit");
    menuFile.getItems().addAll(menuItemPurchase, menuItemStore, menuItemCategory, menuItemExit);

    Menu menuHelp = new Menu("Help");
    menuBar.getMenus().addAll(menuFile, menuHelp);

    // ----------TOOLBAR----------

    ToolBar toolBar = new ToolBar();
    Button buttonPurchase = new Button();
    Button buttonStore = new Button();
    Button buttonCategory = new Button();
    buttonPurchase.setGraphic(new ImageView("/pictures/purchase.png"));
    buttonStore.setGraphic(new ImageView("/pictures/store.png"));
    buttonCategory.setGraphic(new ImageView("/pictures/category.png"));
    toolBar.getItems().addAll(buttonPurchase, buttonStore, buttonCategory);

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

          public void handle(ActionEvent actionEvent) {
            Stage stage = new Stage();
            try {
              new StoreWindows().start(stage);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        });

    // ----------WORKSPACE----------

    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);
    gridPane.setVgap(10);
    gridPane.setHgap(10);
    gridPane.setPadding(new Insets(0, 25, 25, 0));

    Label storeLabel = new Label("Store: ");
    storeLabel.setId("simpleLabel");
    gridPane.add(storeLabel, 0, 1);

    final ComboBox<String> stores = new ComboBox<String>();
    gridPane.add(stores, 1, 1);

    Label categoryLabel = new Label("Category: ");
    categoryLabel.setId("simpleLabel");
    gridPane.add(categoryLabel, 2, 1);

    final ComboBox<String> categories = new ComboBox<String>();
    gridPane.add(categories, 3, 1);

    Button bCount = new Button("Count");
    HBox hBox = new HBox(10);
    hBox.setAlignment(Pos.BOTTOM_RIGHT);
    hBox.getChildren().add(bCount);
    gridPane.add(hBox, 4, 1);

    FlowPane flowPane1 = new FlowPane();
    flowPane1.setAlignment(Pos.CENTER);
    flowPane1.setPadding(new Insets(10, 25, 25, 10));

    final Text spentTitle = new Text("SPENT: ");
    spentTitle.setId("headline");
    flowPane1.getChildren().add(spentTitle);

    // ----------DATABASE----------

    Label statusLabel = new Label();
    DaoFactory daoFactory = new MySQLDaoFactory();
    try {
      Connection connection = daoFactory.getConnection();
      statusLabel.setText("Database connection: success");
      StoreDao storeDao = new MySQLStoreDao(connection);
      ArrayList<Store> storeList = (ArrayList) storeDao.getStores();
      for (Store store : storeList) {
        stores.getItems().add(store.getName());
      }
      CategoryDao categoryDao = new MySQLCategoryDao(connection);
      ArrayList<Category> categoryList = (ArrayList) categoryDao.getCategories();
      for (Category category : categoryList) {
        categories.getItems().add(category.getTitle());
      }
    } catch (SQLException e) {
      statusLabel.setText("Database connection: failed");
    }
    FlowPane footer = new FlowPane();

    footer.setPadding(new Insets(10, 10, 10, 10));
    footer.getChildren().add(statusLabel);

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

          public void handle(ActionEvent actionEvent) {
            try {
              PurchaseDao purchaseDao = new MySQLPurchaseDao(new MySQLDaoFactory().getConnection());
              spentTitle.setText(
                  "SPENT: " + purchaseDao.showSpent(stores.getValue(), categories.getValue()));
            } catch (SQLException e) {
              e.printStackTrace();
            }
          }
        });

    // ----------VIEW----------

    Scene scene = new Scene(new VBox(), 800, 600);
    scene.getStylesheets().add("css/style.css");
    ((VBox) scene.getRoot()).getChildren().addAll(menuBar, toolBar, gridPane, flowPane1, footer);

    stage.setScene(scene);
    stage.setTitle("Cash Organizer");
    stage.getIcons().add(new Image("pictures/icon.png"));
    stage.show();
  }
Beispiel #6
0
  private FlowPane buildLowerArea() {

    FlowPane flow = new FlowPane();
    flow.setPadding(new Insets(10, 10, 10, 10));
    flow.prefHeightProperty().bind(this.heightProperty());
    flow.prefWidthProperty().bind(this.widthProperty());

    flow.setVgap(8);
    flow.setHgap(4);

    Button startDebbtn = new Button("Start New Debate");
    startDebbtn.setPrefSize(150, 50);

    Button judger1btn = new Button("Judge Round 1");
    judger1btn.setDisable(true);
    judger1btn.setPrefSize(150, 50);

    Button judger2btn = new Button("Judge Round 2");
    judger2btn.setDisable(true);
    judger2btn.setPrefSize(150, 50);

    Button judger3btn = new Button("Judge Round 3");
    judger3btn.setDisable(true);
    judger3btn.setPrefSize(150, 50);

    Button judger4btn = new Button("Judge Round 4");
    judger4btn.setDisable(true);
    judger4btn.setPrefSize(150, 50);

    Button finalResbtn = new Button("Final Result");
    finalResbtn.setDisable(true);
    finalResbtn.setPrefSize(150, 50);

    Hyperlink termhp = new Hyperlink("Terminate Current Match/Start New");

    flow.getChildren()
        .addAll(startDebbtn, judger1btn, judger2btn, judger3btn, judger4btn, finalResbtn, termhp);

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

          @Override
          public void handle(ActionEvent event) {

            judger1btn.setDisable(true);
            judger2btn.setDisable(true);
            judger3btn.setDisable(true);
            judger4btn.setDisable(true);
            finalResbtn.setDisable(true);
          }
        });

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

          @Override
          public void handle(ActionEvent event) {

            new MatchManager().StartMatch();
          }
        });

    return flow;
  }