use of org.phoenicis.javafx.views.common.TextWithStyle in project phoenicis by PhoenicisOrg.
the class AboutPanel method populate.
private void populate() {
this.title = new TextWithStyle(tr("About"), "title");
this.aboutGrid = new GridPane();
this.aboutGrid.getStyleClass().add("grid");
this.aboutGrid.setHgap(20);
this.aboutGrid.setVgap(10);
this.nameDescription = new TextWithStyle(tr("Name:"), "captionTitle");
this.nameLabel = new Label(buildInformation.getApplicationName());
this.versionDescription = new TextWithStyle(tr("Version:"), "captionTitle");
this.versionLabel = new Label(buildInformation.getApplicationVersion());
this.gitRevisionDescription = new TextWithStyle(tr("Git Revision:"), "captionTitle");
this.gitRevisionHyperlink = new Hyperlink(buildInformation.getApplicationGitRevision());
this.gitRevisionHyperlink.setOnAction(event -> {
try {
URI uri = new URI("https://github.com/PhoenicisOrg/phoenicis/commit/" + buildInformation.getApplicationGitRevision());
opener.open(uri);
} catch (URISyntaxException e) {
e.printStackTrace();
}
});
this.buildTimestampDescription = new TextWithStyle(tr("Build Timestamp:"), "captionTitle");
this.buildTimestampLabel = new Label(buildInformation.getApplicationBuildTimestamp());
this.aboutGrid.add(nameDescription, 0, 0);
this.aboutGrid.add(nameLabel, 1, 0);
this.aboutGrid.add(versionDescription, 0, 1);
this.aboutGrid.add(versionLabel, 1, 1);
this.aboutGrid.add(gitRevisionDescription, 0, 2);
this.aboutGrid.add(gitRevisionHyperlink, 1, 2);
this.aboutGrid.add(buildTimestampDescription, 0, 3);
this.aboutGrid.add(buildTimestampLabel, 1, 3);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project phoenicis by PhoenicisOrg.
the class UserInterfacePanel method populate.
private void populate() {
this.title = new TextWithStyle(tr("User Interface Settings"), "title");
this.themeGrid = new GridPane();
this.themeGrid.getStyleClass().add("grid");
this.themeGrid.setHgap(20);
this.themeGrid.setVgap(10);
// Change Theme
this.themeTitle = new TextWithStyle(tr("Theme:"), "captionTitle");
this.themes = new ComboBox<>();
this.themes.getItems().setAll(Themes.all());
this.themes.setValue(Themes.fromShortName(javaFxSettingsManager.getTheme()).orElse(Themes.DEFAULT));
this.themes.setOnAction(event -> {
this.handleThemeChange();
this.save();
});
// View Script Sources
this.showScriptSource = new CheckBox();
this.showScriptSource.setSelected(javaFxSettingsManager.isViewScriptSource());
this.showScriptSource.setOnAction(event -> this.save());
this.showScriptDescription = new Label(tr("Select, if you want to view the source repository of the scripts"));
// Scale UI
this.scale = new Slider(8, 16, javaFxSettingsManager.getScale());
this.scaleDescription = new Label(tr("Scale the user interface."));
this.scale.valueProperty().addListener((observableValue, oldValue, newValue) -> {
this.pause.setOnFinished(event -> {
getScene().getRoot().setStyle(String.format("-fx-font-size: %.2fpt;", newValue));
this.save();
});
this.pause.playFromStart();
});
// restore default
ToggleButton restoreDefault = new ToggleButton(tr("Restore defaults (requires restart)"));
restoreDefault.setOnAction(event -> {
this.javaFxSettingsManager.restoreDefault();
});
this.themeGrid.add(themeTitle, 0, 0);
this.themeGrid.add(themes, 1, 0);
this.themeGrid.add(showScriptSource, 0, 1);
this.themeGrid.add(showScriptDescription, 1, 1);
this.themeGrid.add(scale, 0, 2);
this.themeGrid.add(scaleDescription, 1, 2);
this.themeGrid.add(restoreDefault, 0, 3);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project phoenicis 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 phoenicis 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);
}
Aggregations