public OptimizedVirtualCallStage(
      final JITWatchUI parent, final List<OptimizedVirtualCall> optimizedVirtualCalls) {
    initStyle(StageStyle.DECORATED);

    setOnCloseRequest(
        new EventHandler<WindowEvent>() {
          @Override
          public void handle(WindowEvent arg0) {
            parent.handleStageClosed(OptimizedVirtualCallStage.this);
          }
        });

    VBox vbox = new VBox();
    vbox.setPadding(new Insets(8));
    vbox.setSpacing(8);

    Scene scene =
        UserInterfaceUtil.getScene(vbox, JITWatchUI.WINDOW_WIDTH, JITWatchUI.WINDOW_HEIGHT);

    setTitle("Optimized Virtual Calls");

    tableView = VCallTableBuilder.buildTable(parent, optimizedVirtualCalls);

    vbox.getChildren().add(tableView);

    tableView.prefHeightProperty().bind(scene.heightProperty());

    setScene(scene);
    show();
  }
Exemple #2
0
  private Pane buildUpperArea() {

    Pane up = new Pane();
    up.prefHeightProperty().bind(this.heightProperty());
    up.prefWidthProperty().bind(this.widthProperty());

    TableView<DebateDetails> table = new TableView<DebateDetails>();
    table.prefHeightProperty().bind(up.heightProperty());
    table.prefWidthProperty().bind(up.widthProperty());

    final Label label = new Label("Debate Tournament");
    label.setFont(new Font("Arial", 20));

    table.setEditable(false);

    table.getChildrenUnmodifiable().clear();
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    TableColumn<DebateDetails, String> divCol = new TableColumn<DebateDetails, String>("Division");
    divCol.setCellValueFactory(new PropertyValueFactory<>("division"));

    TableColumn<DebateDetails, String> teamCountCol =
        new TableColumn<DebateDetails, String>("Team Count");
    teamCountCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("teamCount")));

    TableColumn<DebateDetails, String> debCountCol =
        new TableColumn<DebateDetails, String>("Debate Count");
    debCountCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("totalMatch")));

    TableColumn<DebateDetails, String> debCompCol =
        new TableColumn<DebateDetails, String>("Debates Completed ");
    debCompCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("matchCompleted")));

    TableColumn<DebateDetails, String> debRemCol =
        new TableColumn<DebateDetails, String>("Upcoming Debates");
    debRemCol.setCellValueFactory(new PropertyValueFactory<>(String.valueOf("matchRemaining")));

    final ObservableList<DebateDetails> data =
        FXCollections.observableArrayList(TeamManager.getDebateDetails());

    table.setItems(data);
    table.getColumns().add(divCol);
    table.getColumns().add(teamCountCol);
    table.getColumns().add(debCountCol);
    table.getColumns().add(debCompCol);
    table.getColumns().add(debRemCol);

    final VBox vbox = new VBox();
    vbox.setSpacing(5);
    vbox.setPadding(new Insets(10, 0, 0, 10));
    vbox.getChildren().addAll(label, table);
    up.getChildren().add(vbox);

    return up;
  }