use of javafx.scene.control.DialogPane in project jabref by JabRef.
the class DocumentViewerView method show.
@Override
public void show() {
FXDialog dialog = new FXDialog(AlertType.INFORMATION, Localization.lang("Document viewer"), false);
DialogPane dialogPane = (DialogPane) this.getView();
// Remove button bar at bottom
dialogPane.getChildren().removeIf(node -> node instanceof ButtonBar);
dialog.setDialogPane(dialogPane);
dialog.setResizable(true);
dialog.show();
}
use of javafx.scene.control.DialogPane in project TagLauncher_3 by ammarx.
the class Launcher_Main_Controller method launchMineCraft.
@FXML
private void launchMineCraft(ActionEvent event) {
if (username.getText().equals("")) {
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Minecraft Launcher - Error");
alert.setHeaderText("A username is required.");
alert.setContentText("Please create a username prior to starting Minecraft.");
alert.initStyle(StageStyle.UTILITY);
DialogPane dialogPane = alert.getDialogPane();
dialogPane.getStylesheets().add("taglauncher_3/css/purple.css");
alert.show();
return;
}
Launcher_Settings.playerUsername = username.getText();
Launcher_Settings.playerVersion = version.getValue().toString();
Launcher_Settings.userSettingsSave();
options.setDisable(true);
launch.setDisable(true);
version.setDisable(true);
username.setDisable(true);
new Thread(() -> loadPlayerAvatar()).start();
tagapi_3.API_Interface API = new tagapi_3.API_Interface();
ExecutorService executor = Executors.newCachedThreadPool();
executor.submit(() -> {
// add server
List ip = new ArrayList(API.getServersIPList());
if (!ip.contains(Launcher_Settings.serverIP) || ip.isEmpty()) {
API.addServerToServersDat(Launcher_Settings.serverName, Launcher_Settings.serverIP);
}
API.downloadProfile((String) username.getText());
API.syncVersions();
if (!Launcher_Settings.fastStartUp) {
// NOT faststartup
API.downloadMinecraft((String) version.getValue(), false);
}
API.setMinMemory(Integer.parseInt(Launcher_Settings.ramAllocationMin));
API.setMemory(Integer.parseInt(Launcher_Settings.ramAllocationMax));
API.setHeight(Integer.parseInt(Launcher_Settings.resolutionHeight));
API.setWidth(Integer.parseInt(Launcher_Settings.resolutionWidth));
if (!Launcher_Settings.javaPath.equals("")) {
API.setJavaPath(Launcher_Settings.javaPath);
}
if (!Launcher_Settings.jvmArguments.equals("")) {
API.setJVMArgument(Launcher_Settings.jvmArguments);
}
if (!Launcher_Settings.playerUsername.equals("")) {
API.setVersionData("Hi " + Launcher_Settings.playerUsername + "!");
} else {
API.setVersionData("#AmmarBless");
}
Boolean nettyPatch = Launcher_Settings.bypassBlacklist;
if (Launcher_Settings.fastStartUp) {
API.runMinecraft(username.getText(), (String) version.getValue(), false, nettyPatch);
} else {
API.runMinecraft(username.getText(), (String) version.getValue(), true, nettyPatch);
}
return null;
});
executor.shutdown();
Thread t = new Thread(() -> {
while (true) {
try {
if (Launcher_Settings.showDebugStatus == true) {
Platform.runLater(() -> {
launcherStatus.setText(API.getLog());
});
} else {
if (API.getLog().startsWith("[dl] DOWNLOADING...")) {
Platform.runLater(() -> {
launcherStatus.setText("Status: Checking installed " + Launcher_Settings.playerVersion + " files.");
});
}
if (API.getLog().startsWith("[rl] KEY:")) {
Platform.runLater(() -> {
launcherStatus.setText("Status: Preparing to start Minecraft.");
});
}
if (API.getLog().startsWith("[rl] Starting")) {
Platform.runLater(() -> {
launcherStatus.setText("Status: Starting Minecraft " + Launcher_Settings.playerVersion + ".");
});
}
}
Thread.sleep(10);
if (API.getLog().equals("[rl] Minecraft Initialized!")) {
Launcher_Settings.playerUsername = username.getText();
Launcher_Settings.playerVersion = version.getValue().toString();
Launcher_Settings.userSettingsSave();
if (Launcher_Settings.keepLauncherOpen == false) {
Platform.runLater(() -> {
launcherStatus.setText("Status: Minecraft started, now closing launcher. Have fun!");
});
API.dumpLogs();
System.exit(0);
} else {
new Thread(() -> checkLatestVersion()).start();
}
return;
} else if (API.getLog().equals("[el] Minecraft Corruption found!")) {
Platform.runLater(() -> {
// STATUS status.setText(API.getLog());
launcherStatus.setText("Status: Error. Minecraft file corruption detected!");
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Minecraft Launcher - Error");
alert.setHeaderText("Version: " + (String) version.getValue() + " failed to initialize!");
alert.setContentText("The game failed to initialize as data corruption \nwas found! Press re-Download game with \n*Force Download* checked in the options menu.");
alert.initStyle(StageStyle.UTILITY);
DialogPane dialogPane = alert.getDialogPane();
dialogPane.getStylesheets().add("taglauncher_3/css/purple.css");
alert.showAndWait();
API.dumpLogs();
username.setDisable(false);
options.setDisable(false);
launch.setDisable(false);
version.setDisable(false);
});
return;
}
} catch (Exception e) {
}
}
});
t.start();
}
use of javafx.scene.control.DialogPane in project TagLauncher_3 by ammarx.
the class Launcher_Options_Controller method mc_launcherVersion.
@FXML
private void mc_launcherVersion(MouseEvent event) {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.getDialogPane().getChildren().stream().filter(node -> node instanceof Label).forEach(node -> ((Label) node).setMinHeight(Region.USE_PREF_SIZE));
alert.setTitle("Minecraft Launcher - Credits");
alert.setHeaderText("So long, and thanks for all the fish.");
alert.initStyle(StageStyle.UTILITY);
DialogPane dialogPane = alert.getDialogPane();
dialogPane.getStylesheets().add("taglauncher_3/css/purple.css");
alert.setContentText("" + "Minotar.net: API used for the Avatars.\n" + "Mojang: A little thing called Minecraft.\n" + "maxd @ Github: Great dark Modena theme.\n" + "Ammar_Ahmad: The brains behind the code.\n" + "Chalkie: Pressed 'compile' that one time.\n\n" + "© TagCraftMC.com & TerraPrimal.com\n");
alert.show();
}
use of javafx.scene.control.DialogPane in project FinalCrypt by ron-from-nl.
the class GUIFX method cipherInfoLabelClicked.
// ================================================= END UPDATE PROGRESS ===========================================================
@FXML
private void cipherInfoLabelClicked(MouseEvent event) {
Alert alert = new Alert(AlertType.INFORMATION);
// Style the Alert
DialogPane dialogPane = alert.getDialogPane();
dialogPane.getStylesheets().add(getClass().getResource("myInfoAlerts.css").toExternalForm());
dialogPane.getStyleClass().add("myDialog");
alert.setTitle("Information Dialog");
alert.setHeaderText("What is your secret Cipher file?");
alert.setResizable(true);
String infotext = new String();
infotext = "Any personal photo or video can be your cipher file.\r\n";
infotext += "FinalCrypt de/encrypts your files with your cipher file.\r\n";
infotext += "Data in your cipher file is like a huge binary password.\r\n";
infotext += "\r\n";
infotext += "Keep backups of your cipher file and keep it SECRET!\r\n";
infotext += "Without cipher file you can NEVER decrypt your data!\r\n";
infotext += "\r\n";
infotext += "==================================\r\n";
infotext += "\r\n";
infotext += "Best practice is a cipher file of at least 1 MB in size\r\n";
infotext += "Don't keep cipher files on your computer for too long\r\n";
infotext += "to prevent someone or something copying of it.\r\n";
infotext += "\r\n";
infotext += "Encryption / Decryption (advanced explanation):\r\n";
infotext += "\r\n";
infotext += "Your cipher bit patterns negate your file bit patterns.\r\n";
infotext += "\r\n";
infotext += " Encrypt Decrypt\r\n";
infotext += "Data byte: 00000011 = 3 ╭─> 00000110 = 6\r\n";
infotext += "Ciph byte: 00000101 = 5 │ 00000101 = 5\r\n";
infotext += "Encr byte: 00000110 = 6 ─╯ 00000011 = 3\r\n\r\n";
// infotext += " \r\n";
alert.setContentText(infotext);
alert.showAndWait();
}
use of javafx.scene.control.DialogPane in project FinalCrypt by ron-from-nl.
the class GUIFX method introAlert.
public Alert introAlert(AlertType type, String title, String headerText, String message, String optOutMessage, Consumer<Boolean> optOutAction, ButtonType... buttonTypes) {
Alert alert = new Alert(type);
alert.getDialogPane().applyCss();
Node graphic = alert.getDialogPane().getGraphic();
DialogPane dialogPane = new DialogPane() {
@Override
protected Node createDetailsButton() {
CheckBox checkbox = new CheckBox();
checkbox.setText(optOutMessage);
checkbox.setOnAction(e -> optOutAction.accept(checkbox.isSelected()));
return checkbox;
}
};
dialogPane.getStylesheets().add(getClass().getResource("myInfoAlerts.css").toExternalForm());
dialogPane.getStyleClass().add("myDialog");
alert.setDialogPane(dialogPane);
alert.getDialogPane().getButtonTypes().addAll(buttonTypes);
alert.getDialogPane().setContentText(message);
alert.getDialogPane().setExpandableContent(new Group());
alert.getDialogPane().setExpanded(true);
alert.getDialogPane().setGraphic(graphic);
alert.setTitle(title);
alert.setHeaderText(headerText);
return alert;
}
Aggregations