-
Notifications
You must be signed in to change notification settings - Fork 2
/
DlgAbout.java
60 lines (52 loc) · 2 KB
/
DlgAbout.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tappas;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Window;
import java.util.HashMap;
import java.util.Optional;
/**
*
* @author Hector del Risco - [email protected] & Pedro Salguero - [email protected]
*/
public class DlgAbout extends DlgBase {
public DlgAbout(Project project, Window window) {
super(project, window);
}
public HashMap<String, String> showAndWait() {
if(createDialog("About.fxml", "About tappAS", false, null)) {
// get control objects
TextArea txtInfo = (TextArea) scene.lookup("#txtInfo");
Label txtVersion = (Label) scene.lookup("#lblAboutVersion");
WebView web = (WebView) scene.lookup("#webCredits");
WebEngine engine = web.getEngine();;
// display app info
String info = app.getAppInfo();
txtInfo.setText(info);
txtVersion.setText("Version " + Tappas.APP_STRVER);
// get html file
String content = app.data.getFileContentFromResource("/tappas/resources/web/about.html");
if(content.isEmpty())
content = app.data.getFileContentFromResource("/tappas/resources/web/Help_NA.html");
// display contents
engine.loadContent(content);
// setup dialog event handlers
dialog.setResultConverter((ButtonType b) -> {
HashMap<String, String> params = null;
return null;
});
// process dialog
Optional<HashMap> result = dialog.showAndWait();
if(result.isPresent())
return result.get();
}
return null;
}
}