Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nl.avans.view.dashboard;
- import javafx.collections.ObservableList;
- import javafx.geometry.Insets;
- import javafx.geometry.Pos;
- import javafx.scene.control.TableColumn;
- import javafx.scene.control.TableView;
- import javafx.scene.control.TextField;
- import javafx.scene.control.cell.PropertyValueFactory;
- import javafx.scene.layout.Background;
- import javafx.scene.layout.BackgroundFill;
- import javafx.scene.layout.FlowPane;
- import javafx.scene.layout.VBox;
- import javafx.scene.paint.Color;
- import nl.avans.controller.dashboard.CreateNewGameController;
- import nl.avans.controller.dashboard.StatisticsController;
- import nl.avans.helpers.Styling;
- public class StatisticsPane extends FlowPane {
- private TableView<String> tableView, tableViewName;
- private CreateNewGameController gameController;
- private TextField filter;
- private ObservableList<String> players;
- @SuppressWarnings("unchecked")
- public StatisticsPane(StatisticsController controller) {
- filter = new TextField();
- filter.setPadding(Styling.PADDING);
- filter.setPromptText("Speler zoeken...");
- TableColumn nameColumn = new TableColumn<>("Naam");
- nameColumn.setCellValueFactory(new PropertyValueFactory<>("naam"));
- nameColumn.setMinWidth(100);
- nameColumn.setStyle("-fx-fill: white; -fx-background-color: grey; -fx-border-radius: 10 0 0 0;");
- TableColumn winColumn = new TableColumn<>("Win");
- winColumn.setCellValueFactory(new PropertyValueFactory<>("win"));
- winColumn.setMinWidth(100);
- winColumn.setStyle("-fx-fill: white; -fx-background-color: grey; -fx-border-radius: 0 0 0 0;");
- TableColumn lossColumn = new TableColumn<>("Lose");
- lossColumn.setCellValueFactory(new PropertyValueFactory<>("loss"));
- lossColumn.setMinWidth(100);
- lossColumn.setStyle("-fx-text-fill: white; -fx-background-color: grey");
- TableColumn worthColumn = new TableColumn<>("Waarde");
- worthColumn.setCellValueFactory(new PropertyValueFactory<>("diceworth"));
- worthColumn.setMinWidth(100);
- worthColumn.setStyle("-fx-text-fill: white; -fx-background-color: grey");
- TableColumn colorColumn = new TableColumn<>("Kleur");
- colorColumn.setCellValueFactory(new PropertyValueFactory<>("dicecolor"));
- colorColumn.setMinWidth(100);
- colorColumn.setStyle("-fx-fill: white; -fx-background-color: grey");
- TableColumn opponentColumn = new TableColumn<>("Tegenstander");
- opponentColumn.setCellValueFactory(new PropertyValueFactory<>("opponents"));
- opponentColumn.setMinWidth(120);
- opponentColumn.setStyle("-fx-fill: white; -fx-background-color: grey");
- tableView = new TableView<>();
- tableViewName = new TableView<>();
- tableView.setStyle("-fx-border-radius: 10 10 0 0; -fx-background-radius: 10 10 10 10;");
- tableView.getColumns().addAll(nameColumn, winColumn, lossColumn, worthColumn, colorColumn, opponentColumn);
- // tableViewName.setItems(getPlayer());
- VBox search = new VBox();
- search.setSpacing(10);
- search.getChildren().addAll(filter);
- VBox rootnode = new VBox(search, tableView);
- rootnode.setPadding(new Insets(30, 30, 30, 30));
- rootnode.setSpacing(20);
- rootnode.setBackground(new Background(new BackgroundFill(Color.WHITE, Styling.BORDER_RADIUS, null)));
- getChildren().add(rootnode);
- setAlignment(Pos.CENTER);
- setPadding(new Insets(20));
- rootnode.setStyle("-fx-border-radius:10 10 10 10");
- }
- }
- //public ObservableList<Player> getPlayer(){
- // players = FXCollections.observableArrayList(gameController.getUserNameList());
- //
- // return players;
- //}
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement