use of javafx.scene.text.Text in project POL-POM-5 by PlayOnLinux.
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 GridPane toolsContentPane = new GridPane();
toolsContentPane.getStyleClass().add("grid");
Button openTerminal = new Button(tr("Open a terminal"));
openTerminal.getStyleClass().addAll("wineToolButton", "openTerminal");
openTerminal.setOnMouseClicked(e -> {
this.lockAll();
winePrefixContainerController.openTerminalInPrefix(container);
this.unlockAll();
});
GridPane.setHalignment(openTerminal, HPos.CENTER);
this.lockableElements.add(openTerminal);
toolsContentPane.add(openTerminal, 0, 0);
toolsContentPane.add(wineToolCaption(tr("Open a terminal")), 0, 1);
Button createShortcut = new Button();
createShortcut.getStyleClass().addAll("wineToolButton", "openTerminal");
createShortcut.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.createShortcut(container, file.getName(), file.getName(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
}
this.unlockAll();
});
GridPane.setHalignment(createShortcut, HPos.CENTER);
this.lockableElements.add(createShortcut);
toolsContentPane.add(createShortcut, 1, 0);
toolsContentPane.add(wineToolCaption(tr("Create shortcut")), 1, 1);
Button runExecutable = new Button();
runExecutable.getStyleClass().addAll("wineToolButton", "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.runInPrefix(container, file.getAbsolutePath(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
}
});
GridPane.setHalignment(runExecutable, HPos.CENTER);
this.lockableElements.add(runExecutable);
toolsContentPane.add(runExecutable, 2, 0);
toolsContentPane.add(wineToolCaption(tr("Run executable")), 2, 1);
toolsPane.getChildren().addAll(toolsContentPane);
toolsContentPane.getColumnConstraints().addAll(new ColumnConstraintsWithPercentage(25), new ColumnConstraintsWithPercentage(25), new ColumnConstraintsWithPercentage(25), new ColumnConstraintsWithPercentage(25));
this.setContent(toolsPane);
}
use of javafx.scene.text.Text in project POL-POM-5 by PlayOnLinux.
the class WinePrefixContainerWineToolsTab method wineToolCaption.
private Text wineToolCaption(String caption) {
final Text text = new TextWithStyle(caption, "wineToolCaption");
GridPane.setHalignment(text, HPos.CENTER);
GridPane.setValignment(text, VPos.CENTER);
lockableElements.add(text);
return text;
}
use of javafx.scene.text.Text in project Retrospector by NonlinearFruit.
the class AchievementManager method getDisplay.
public Node getDisplay() {
VBox box = new VBox();
box.setAlignment(Pos.CENTER);
Text title = new Text(achievement.getTitle());
title.setFont(Font.font(20));
Text desc = new Text(achievement.getDescription());
ProgressBar bar = new ProgressBar(achievement.getProgress() * 1.0 / 100);
box.getChildren().add(title);
box.getChildren().add(image);
if (achievement.isUnlocked())
box.getChildren().add(desc);
else
box.getChildren().add(bar);
return box;
}
use of javafx.scene.text.Text in project Retrospector by NonlinearFruit.
the class AchievementTabController method update.
public void update() {
achievementPane.getChildren().clear();
header.getChildren().clear();
List<Node> list = new ArrayList<>();
// Header Vars
int first = 0;
int second = 0;
int third = 0;
int locked = 0;
// Achievement Pane
for (Achievement achievement : AchievementFactory.getAchievements()) {
list.add(new AchievementManager(achievement).getDisplay());
if (!achievement.isUnlocked()) {
locked++;
continue;
}
switch(achievement.getTier()) {
case 3:
third++;
break;
case 2:
second++;
break;
case 1:
first++;
break;
default:
locked++;
}
}
// Achievement Display
achievementPane.getChildren().addAll(list);
// Header Display
header.getChildren().add(new Text(first + " "));
header.getChildren().add(AchievementManager.trophyize(headerImage, 1, headerSize));
header.getChildren().add(new Text("\t" + second + " "));
header.getChildren().add(AchievementManager.trophyize(headerImage, 2, headerSize));
header.getChildren().add(new Text("\t" + third + " "));
header.getChildren().add(AchievementManager.trophyize(headerImage, 3, headerSize));
header.getChildren().add(new Text("\t" + locked + " "));
header.getChildren().add(AchievementManager.trophyize(AchievementManager.lockedImage, 0, headerSize));
}
use of javafx.scene.text.Text in project Retrospector by NonlinearFruit.
the class InfoBlipAccumulator method getInfo.
public VBox getInfo() {
// Setup
VBox box = new VBox();
calc();
// Stats
box.getChildren().addAll(new Text(media + " Media"), new Text(reviews + " Review(s)"), new Text(facts + " Fact(s)"), new Text(users + " User(s)"), new Text(days + " Days"), new Text(titles + " Titles"), new Text(creators + " Creators"), new Text(singles + " Single(s)"), new Text(minis + " Mini(s)"), new Text(series + " Serie(s)"), new Text(String.format("%.2f", perMonth) + " / Month"), new Text(String.format("%.2f", aveCurrent) + " ± " + String.format("%.2f", sdCurrent) + " Current"), new Text(String.format("%.2f", aveAll) + " ± " + String.format("%.2f", sdAll) + " All"));
return box;
}
Aggregations