use of com.faforever.client.theme.UiService 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);
}
use of com.faforever.client.theme.UiService in project downlords-faf-client by FAForever.
the class GamesTableController method initializeGameTable.
public void initializeGameTable(ObservableList<Game> games) {
SortedList<Game> sortedList = new SortedList<>(games);
sortedList.comparatorProperty().bind(gamesTable.comparatorProperty());
gamesTable.setPlaceholder(new Label(i18n.get("games.noGamesAvailable")));
gamesTable.setRowFactory(param1 -> gamesRowFactory());
gamesTable.setItems(sortedList);
applyLastSorting(gamesTable);
gamesTable.setOnSort(this::onColumnSorted);
sortedList.addListener((Observable observable) -> selectFirstGame());
selectFirstGame();
passwordProtectionColumn.setCellValueFactory(param -> param.getValue().passwordProtectedProperty());
passwordProtectionColumn.setCellFactory(param -> passwordIndicatorColumn());
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 -> Bindings.createObjectBinding(() -> new PlayerFill(param.getValue().getNumPlayers(), param.getValue().getMaxPlayers()), param.getValue().numPlayersProperty(), param.getValue().maxPlayersProperty()));
playersColumn.setCellFactory(param -> playersCell());
ratingColumn.setCellValueFactory(param -> new SimpleObjectProperty<>(new RatingRange(param.getValue().getMinRating(), param.getValue().getMaxRating())));
ratingColumn.setCellFactory(param -> ratingTableCell());
hostColumn.setCellValueFactory(param -> param.getValue().hostProperty());
hostColumn.setCellFactory(param -> new StringCell<>(String::toString));
modsColumn.setCellValueFactory(this::modCell);
modsColumn.setCellFactory(param -> new StringCell<>(String::toString));
gamesTable.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> selectedGame.set(newValue)));
}
Aggregations