use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PhoenicisOrg.
the class WinePrefixContainerDisplayTab method populate.
private void populate() {
final VBox displayPane = new VBox();
final Text title = new TextWithStyle(tr("Display settings"), TITLE_CSS_CLASS);
displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
displayPane.getChildren().add(title);
final GridPane displayContentPane = new GridPane();
displayContentPane.getStyleClass().add("grid");
final ComboBox<UseGLSL> glslComboBox = new ComboBox<>();
glslComboBox.setMaxWidth(Double.MAX_VALUE);
glslComboBox.setValue(container.getUseGlslValue());
glslComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(glslComboBox, UseGLSL.class);
displayContentPane.add(new TextWithStyle(tr("GLSL support"), CAPTION_TITLE_CSS_CLASS), 0, 0);
displayContentPane.add(glslComboBox, 1, 0);
final ComboBox<DirectDrawRenderer> directDrawRendererComboBox = new ComboBox<>();
directDrawRendererComboBox.setMaxWidth(Double.MAX_VALUE);
directDrawRendererComboBox.setValue(container.getDirectDrawRenderer());
directDrawRendererComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(directDrawRendererComboBox, DirectDrawRenderer.class);
displayContentPane.add(new TextWithStyle(tr("Direct Draw Renderer"), CAPTION_TITLE_CSS_CLASS), 0, 1);
displayContentPane.add(directDrawRendererComboBox, 1, 1);
final ComboBox<VideoMemorySize> videoMemorySizeComboBox = new ComboBox<>();
videoMemorySizeComboBox.setMaxWidth(Double.MAX_VALUE);
videoMemorySizeComboBox.setValue(container.getVideoMemorySize());
videoMemorySizeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItemsVideoMemorySize(videoMemorySizeComboBox);
displayContentPane.add(new TextWithStyle(tr("Video memory size"), CAPTION_TITLE_CSS_CLASS), 0, 2);
displayContentPane.add(videoMemorySizeComboBox, 1, 2);
final ComboBox<OffscreenRenderingMode> offscreenRenderingModeComboBox = new ComboBox<>();
offscreenRenderingModeComboBox.setMaxWidth(Double.MAX_VALUE);
offscreenRenderingModeComboBox.setValue(container.getOffscreenRenderingMode());
offscreenRenderingModeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(offscreenRenderingModeComboBox, OffscreenRenderingMode.class);
displayContentPane.add(new TextWithStyle(tr("Offscreen rendering mode"), CAPTION_TITLE_CSS_CLASS), 0, 3);
displayContentPane.add(offscreenRenderingModeComboBox, 1, 3);
final ComboBox<RenderTargetModeLock> renderTargetModeLockComboBox = new ComboBox<>();
renderTargetModeLockComboBox.setMaxWidth(Double.MAX_VALUE);
renderTargetModeLockComboBox.setValue(container.getRenderTargetModeLock());
renderTargetModeLockComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(renderTargetModeLockComboBox, RenderTargetModeLock.class);
displayContentPane.add(new TextWithStyle(tr("Render target lock mode"), CAPTION_TITLE_CSS_CLASS), 0, 4);
displayContentPane.add(renderTargetModeLockComboBox, 1, 4);
final ComboBox<Multisampling> multisamplingComboBox = new ComboBox<>();
multisamplingComboBox.setMaxWidth(Double.MAX_VALUE);
multisamplingComboBox.setValue(container.getMultisampling());
multisamplingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(multisamplingComboBox, Multisampling.class);
displayContentPane.add(new TextWithStyle(tr("Multisampling"), CAPTION_TITLE_CSS_CLASS), 0, 5);
displayContentPane.add(multisamplingComboBox, 1, 5);
final ComboBox<StrictDrawOrdering> strictDrawOrderingComboBox = new ComboBox<>();
strictDrawOrderingComboBox.setMaxWidth(Double.MAX_VALUE);
strictDrawOrderingComboBox.setValue(container.getStrictDrawOrdering());
strictDrawOrderingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(strictDrawOrderingComboBox, StrictDrawOrdering.class);
displayContentPane.add(new TextWithStyle(tr("Strict Draw Ordering"), CAPTION_TITLE_CSS_CLASS), 0, 6);
displayContentPane.add(strictDrawOrderingComboBox, 1, 6);
final ComboBox<AlwaysOffscreen> alwaysOffscreenComboBox = new ComboBox<>();
alwaysOffscreenComboBox.setMaxWidth(Double.MAX_VALUE);
alwaysOffscreenComboBox.setValue(container.getAlwaysOffscreen());
alwaysOffscreenComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(alwaysOffscreenComboBox, AlwaysOffscreen.class);
displayContentPane.add(new TextWithStyle(tr("Always Offscreen"), CAPTION_TITLE_CSS_CLASS), 0, 7);
displayContentPane.add(alwaysOffscreenComboBox, 1, 7);
Region spacer = new Region();
GridPane.setHgrow(spacer, Priority.ALWAYS);
displayContentPane.add(spacer, 2, 0);
displayPane.getChildren().addAll(displayContentPane);
this.setContent(displayPane);
lockableElements.addAll(Arrays.asList(glslComboBox, directDrawRendererComboBox, offscreenRenderingModeComboBox, renderTargetModeLockComboBox, multisamplingComboBox, strictDrawOrderingComboBox, alwaysOffscreenComboBox, videoMemorySizeComboBox));
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PhoenicisOrg.
the class WinePrefixContainerInformationTab method populate.
private void populate() {
final VBox informationPane = new VBox();
final Text title = new TextWithStyle(tr("Information"), TITLE_CSS_CLASS);
informationPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
informationPane.getChildren().add(title);
final GridPane informationContentPane = new GridPane();
informationContentPane.getStyleClass().add("grid");
informationContentPane.add(new TextWithStyle(tr("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0);
Label name = new Label(container.getName());
name.setWrapText(true);
informationContentPane.add(name, 1, 0);
informationContentPane.add(new TextWithStyle(tr("Path:"), CAPTION_TITLE_CSS_CLASS), 0, 1);
Label path = new Label(container.getPath());
path.setWrapText(true);
informationContentPane.add(path, 1, 1);
informationContentPane.add(new TextWithStyle(tr("Installed shortcuts:"), CAPTION_TITLE_CSS_CLASS), 0, 2);
Label installedShortcuts = new Label(container.getInstalledShortcuts().stream().map(shortcutDTO -> shortcutDTO.getInfo().getName()).collect(Collectors.joining("; ")));
installedShortcuts.setWrapText(true);
informationContentPane.add(installedShortcuts, 1, 2);
informationContentPane.add(new TextWithStyle(tr("Wine version:"), CAPTION_TITLE_CSS_CLASS), 0, 3);
Label version = new Label(container.getVersion());
version.setWrapText(true);
informationContentPane.add(version, 1, 3);
informationContentPane.add(new TextWithStyle(tr("Wine architecture:"), CAPTION_TITLE_CSS_CLASS), 0, 4);
Label architecture = new Label(container.getArchitecture());
architecture.setWrapText(true);
informationContentPane.add(architecture, 1, 4);
informationContentPane.add(new TextWithStyle(tr("Wine distribution:"), CAPTION_TITLE_CSS_CLASS), 0, 5);
Label distribution = new Label(container.getDistribution());
distribution.setWrapText(true);
informationContentPane.add(distribution, 1, 5);
Region spacer = new Region();
spacer.setPrefHeight(20);
VBox.setVgrow(spacer, Priority.NEVER);
// changing engine does not work currently
// disabled combobox to avoid confusion of users
/*ComboBox<EngineVersionDTO> changeEngineComboBox = new ComboBox<EngineVersionDTO>(
FXCollections.observableList(engineVersions));
changeEngineComboBox.setConverter(new StringConverter<EngineVersionDTO>() {
@Override
public String toString(EngineVersionDTO object) {
return object.getVersion();
}
@Override
public EngineVersionDTO fromString(String string) {
return engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(string))
.findFirst().get();
}
});
changeEngineComboBox.getSelectionModel().select(engineVersions.stream()
.filter(engineVersion -> engineVersion.getVersion().equals(container.getVersion())).findFirst().get());*/
Button deleteButton = new Button(tr("Delete container"));
deleteButton.setOnMouseClicked(event -> this.onDeletePrefix.accept(container));
informationPane.getChildren().addAll(informationContentPane, spacer, /*changeEngineComboBox,*/
deleteButton);
this.setContent(informationPane);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PhoenicisOrg.
the class WinePrefixContainerInputTab method populate.
private void populate() {
final VBox inputPane = new VBox();
final Text title = new TextWithStyle(tr("Input settings"), TITLE_CSS_CLASS);
inputPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
inputPane.getChildren().add(title);
final GridPane inputContentPane = new GridPane();
inputContentPane.getStyleClass().add("grid");
final ComboBox<MouseWarpOverride> mouseWarpOverrideComboBox = new ComboBox<>();
mouseWarpOverrideComboBox.setValue(container.getMouseWarpOverride());
addItems(mouseWarpOverrideComboBox, MouseWarpOverride.class);
inputContentPane.add(new TextWithStyle(tr("Mouse Warp Override"), CAPTION_TITLE_CSS_CLASS), 0, 0);
inputContentPane.add(mouseWarpOverrideComboBox, 1, 0);
inputContentPane.getColumnConstraints().addAll(new ColumnConstraintsWithPercentage(30), new ColumnConstraintsWithPercentage(70));
inputPane.getChildren().addAll(inputContentPane);
this.setContent(inputPane);
lockableElements.add(mouseWarpOverrideComboBox);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PhoenicisOrg.
the class WinePrefixContainerToolsTab method populate.
private void populate() {
final VBox toolsPane = new VBox();
final Text title = new TextWithStyle(tr("Tools"), TITLE_CSS_CLASS);
toolsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
toolsPane.getChildren().add(title);
final TilePane toolsContentPane = new TilePane();
toolsContentPane.setPrefColumns(3);
toolsContentPane.getStyleClass().add("grid");
Button runExecutable = new Button(tr("Run executable"));
runExecutable.getStyleClass().addAll("toolButton", "runExecutable");
runExecutable.setOnMouseClicked(event -> {
this.lockAll();
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle(tr("Choose executable"));
File file = fileChooser.showOpenDialog(this.getContent().getScene().getWindow());
if (file != null) {
winePrefixContainerController.runInContainer(container, file.getAbsolutePath(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
}
});
this.lockableElements.add(runExecutable);
toolsContentPane.getChildren().add(runExecutable);
toolsPane.getChildren().addAll(toolsContentPane);
this.setContent(toolsPane);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PhoenicisOrg.
the class WinePrefixContainerWineToolsTab method populate.
private void populate(ApplicationDTO engineTools) {
final VBox toolsPane = new VBox();
final Text title = new TextWithStyle(tr("Wine tools"), TITLE_CSS_CLASS);
toolsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
toolsPane.getChildren().add(title);
final TilePane toolsContentPane = new TilePane();
toolsContentPane.setPrefColumns(3);
toolsContentPane.getStyleClass().add("grid");
for (ScriptDTO tool : engineTools.getScripts()) {
Button toolButton = new Button(tool.getScriptName());
toolButton.getStyleClass().addAll("toolButton");
toolButton.setStyle("-fx-background-image: url('" + tool.getIcon() + "');");
toolButton.setOnMouseClicked(event -> {
this.lockAll();
this.engineToolsManager.runTool(container.getEngine(), container.getName(), tool.getId(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
this.lockableElements.add(toolButton);
toolsContentPane.getChildren().add(toolButton);
}
toolsPane.getChildren().add(toolsContentPane);
this.setContent(toolsPane);
}
Aggregations