use of com.faforever.client.vault.map.MapPreviewTableCellController in project downlords-faf-client by FAForever.
the class ReplayVaultController method mapCellFactory.
private TableCell<Replay, MapBean> mapCellFactory(TableColumn<Replay, MapBean> column) {
MapPreviewTableCellController controller = uiService.loadFxml("theme/vault/map/map_preview_table_cell.fxml");
final ImageView imageView = controller.getRoot();
TableCell<Replay, MapBean> cell = new TableCell<Replay, MapBean>() {
@Override
protected void updateItem(MapBean map, boolean empty) {
super.updateItem(map, empty);
if (empty || map == null) {
setText(null);
setGraphic(null);
} else {
imageView.setImage(mapService.loadPreview(map.getFolderName(), PreviewSize.SMALL));
setGraphic(imageView);
setText(map.getDisplayName());
}
}
};
cell.setGraphic(imageView);
return cell;
}
Aggregations