forked from ConesaLab/tappAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DlgContact.java
57 lines (49 loc) · 1.9 KB
/
DlgContact.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
/*
* 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.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 DlgContact extends DlgBase {
public DlgContact(Project project, Window window) {
super(project, window);
}
public HashMap<String, String> showAndWait() {
if(createDialog("Contact.fxml", "Contact with tappAS' team", false, null)) {
// get control objects
Label txtVersion = (Label) scene.lookup("#lblAboutVersion");
WebView web = (WebView) scene.lookup("#webContact");
WebEngine engine = web.getEngine();
// display app info
String info = app.getAppInfo();
txtVersion.setText("Version " + Tappas.APP_STRVER);
// get html file
String content = app.data.getFileContentFromResource("/tappas/resources/web/contact.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;
}
}