use of com.faforever.client.game.MapPreviewTableCell in project downlords-faf-client by FAForever.
the class LiveReplayController method initializeGameTable.
private void initializeGameTable(ObservableList<Game> games) {
SortedList<Game> sortedList = new SortedList<>(games);
sortedList.comparatorProperty().bind(liveReplayControllerRoot.comparatorProperty());
mapPreviewColumn.setCellFactory(param -> new MapPreviewTableCell(uiService));
mapPreviewColumn.setCellValueFactory(param -> Bindings.createObjectBinding(() -> mapService.loadPreview(param.getValue().getMapFolderName(), PreviewSize.SMALL), param.getValue().mapFolderNameProperty()));
gameTitleColumn.setCellValueFactory(param -> param.getValue().titleProperty());
gameTitleColumn.setCellFactory(param -> new StringCell<>(title -> title));
playersColumn.setCellValueFactory(param -> param.getValue().numPlayersProperty());
playersColumn.setCellFactory(param -> new StringCell<>(number -> i18n.number(number.intValue())));
hostColumn.setCellValueFactory(param -> param.getValue().hostProperty());
hostColumn.setCellFactory(param -> new StringCell<>(String::toString));
modsColumn.setCellValueFactory(this::modCell);
modsColumn.setCellFactory(param -> new StringCell<>(String::toString));
watchColumn.setCellValueFactory(param -> new SimpleObjectProperty<>(param.getValue()));
watchColumn.setCellFactory(param -> new NodeTableCell<>(this::watchReplayButton));
liveReplayControllerRoot.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> selectedGame.set(newValue)));
liveReplayControllerRoot.setItems(games);
}
Aggregations