use of com.faforever.client.map.MapSize in project downlords-faf-client by FAForever.
the class CreateGameController method setSelectedMap.
private void setSelectedMap(MapBean newValue) {
JavaFxUtil.assertApplicationThread();
if (newValue == null) {
mapNameLabel.setText("");
return;
}
preferencesService.getPreferences().setLastMap(newValue.getFolderName());
preferencesService.storeInBackground();
Image largePreview = mapService.loadPreview(newValue.getFolderName(), PreviewSize.LARGE);
mapPreviewPane.setBackground(new Background(new BackgroundImage(largePreview, NO_REPEAT, NO_REPEAT, CENTER, new BackgroundSize(BackgroundSize.AUTO, BackgroundSize.AUTO, false, false, true, false))));
MapSize mapSize = newValue.getSize();
mapSizeLabel.setText(i18n.get("mapPreview.size", mapSize.getWidthInPixels(), mapSize.getHeightInPixels()));
mapNameLabel.setText(newValue.getDisplayName());
mapPlayersLabel.setText(i18n.number(newValue.getPlayers()));
mapDescriptionLabel.setText(Optional.ofNullable(newValue.getDescription()).map(Strings::emptyToNull).map(FaStrings::removeLocalizationTag).orElseGet(() -> i18n.get("map.noDescriptionAvailable")));
versionLabel.setText(newValue.getVersion().toString());
}
Aggregations