use of se.trixon.almond.util.fx.dialogs.about.AboutPane in project java-jotasync by trixon.
the class MainApp method initActions.
private void initActions() {
// DRAWER
// history
mHistoryAction = new Action(Dict.HISTORY.toString(), (ActionEvent event) -> {
mWorkbench.hideNavigationDrawer();
mWorkbench.openModule(mHistoryModule);
});
mHistoryAction.disabledProperty().bind(mManager.connectedProperty().not());
// options
mOptionsAction = new Action(Dict.OPTIONS.toString(), (ActionEvent event) -> {
mWorkbench.hideNavigationDrawer();
displayOptions();
});
// help
mHelpAction = new Action(Dict.HELP.toString(), (ActionEvent event) -> {
mWorkbench.hideNavigationDrawer();
SystemHelper.desktopBrowse("https://trixon.se/projects/jotasync/documentation/");
});
// about rsync
mAboutRsyncAction = new Action(String.format(Dict.ABOUT_S.toString(), "rsync"), (ActionEvent event) -> {
mWorkbench.hideNavigationDrawer();
try {
String aboutRsync = mManager.getServerCommander().getAboutRsync();
mWorkbench.showInformationDialog(String.format(Dict.ABOUT_S.toString(), "rsync"), aboutRsync, null);
} catch (RemoteException ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
}
});
mAboutRsyncAction.disabledProperty().bind(mManager.connectedProperty().not());
// about
mAboutAction = new Action(Dict.ABOUT.toString(), (ActionEvent event) -> {
mWorkbench.hideNavigationDrawer();
PomInfo pomInfo = new PomInfo(MainApp.class, "se.trixon", "jotasync");
AboutModel aboutModel = new AboutModel(SystemHelper.getBundle(getClass(), "about"), SystemHelperFx.getResourceAsImageView(MainApp.class, "logo.png"));
aboutModel.setAppVersion(pomInfo.getVersion());
AboutPane aboutPane = new AboutPane(aboutModel);
double scaledFontSize = FxHelper.getScaledFontSize();
Label appLabel = new Label(aboutModel.getAppName());
appLabel.setFont(new Font(scaledFontSize * 1.8));
Label verLabel = new Label(String.format("%s %s", Dict.VERSION.toString(), aboutModel.getAppVersion()));
verLabel.setFont(new Font(scaledFontSize * 1.2));
Label dateLabel = new Label(aboutModel.getAppDate());
dateLabel.setFont(new Font(scaledFontSize * 1.2));
VBox box = new VBox(appLabel, verLabel, dateLabel);
box.setAlignment(Pos.CENTER_LEFT);
box.setPadding(new Insets(0, 0, 0, 22));
BorderPane topBorderPane = new BorderPane(box);
topBorderPane.setLeft(aboutModel.getImageView());
topBorderPane.setPadding(new Insets(22));
BorderPane mainBorderPane = new BorderPane(aboutPane);
mainBorderPane.setTop(topBorderPane);
WorkbenchDialog dialog = WorkbenchDialog.builder(Dict.ABOUT.toString(), mainBorderPane, ButtonType.CLOSE).build();
mWorkbench.showDialog(dialog);
});
}
Aggregations