added jfxinfodialog class
* added jfxinfodialog class * code clean up
This commit is contained in:
parent
61e02f6ac1
commit
9e3b553851
|
@ -1,3 +1,4 @@
|
||||||
/application/
|
/application/
|
||||||
/cloudControllerInstances/
|
/cloudControllerInstances/
|
||||||
/datatypes/
|
/datatypes/
|
||||||
|
/UIElements/
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,56 @@
|
||||||
|
package UIElements;
|
||||||
|
|
||||||
|
import com.jfoenix.controls.JFXButton;
|
||||||
|
import com.jfoenix.controls.JFXDialog;
|
||||||
|
import com.jfoenix.controls.JFXDialogLayout;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import javafx.scene.layout.StackPane;
|
||||||
|
import javafx.scene.text.Text;
|
||||||
|
|
||||||
|
public class JFXInfoDialog {
|
||||||
|
|
||||||
|
private String headingText;
|
||||||
|
private String bodyText;
|
||||||
|
private String dialogBtnStyle;
|
||||||
|
private int dialogWidth;
|
||||||
|
private int dialogHeigh;
|
||||||
|
private Pane pane;
|
||||||
|
|
||||||
|
public JFXInfoDialog(String headingText, String bodyText, String dialogBtnStyle, int dialogWidth, int dialogHeigh, Pane pane) {
|
||||||
|
this.headingText = headingText;
|
||||||
|
this.bodyText = bodyText;
|
||||||
|
this.dialogBtnStyle = dialogBtnStyle;
|
||||||
|
this.dialogWidth = dialogWidth;
|
||||||
|
this.dialogHeigh = dialogHeigh;
|
||||||
|
this.pane = pane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
JFXDialogLayout content = new JFXDialogLayout();
|
||||||
|
content.setHeading(new Text(headingText));
|
||||||
|
content.setBody(new Text(bodyText));
|
||||||
|
content.setPrefSize(dialogWidth, dialogHeigh);
|
||||||
|
StackPane stackPane = new StackPane();
|
||||||
|
stackPane.autosize();
|
||||||
|
JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
|
||||||
|
JFXButton button = new JFXButton("Okay");
|
||||||
|
button.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handle(ActionEvent event) {
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
|
||||||
|
button.setPrefHeight(32);
|
||||||
|
button.setStyle(dialogBtnStyle);
|
||||||
|
content.setActions(button);
|
||||||
|
pane.getChildren().add(stackPane);
|
||||||
|
AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
|
||||||
|
AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
}
|
|
@ -62,6 +62,7 @@ import com.jfoenix.controls.JFXTreeTableColumn;
|
||||||
import com.jfoenix.controls.JFXTreeTableView;
|
import com.jfoenix.controls.JFXTreeTableView;
|
||||||
import com.jfoenix.transitions.hamburger.HamburgerBackArrowBasicTransition;
|
import com.jfoenix.transitions.hamburger.HamburgerBackArrowBasicTransition;
|
||||||
|
|
||||||
|
import UIElements.JFXInfoDialog;
|
||||||
import datatypes.CourseTableDataType;
|
import datatypes.CourseTableDataType;
|
||||||
import datatypes.SmmdbApiDataType;
|
import datatypes.SmmdbApiDataType;
|
||||||
import datatypes.UIROMDataType;
|
import datatypes.UIROMDataType;
|
||||||
|
@ -733,28 +734,12 @@ public class MainWindowController {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void aboutBtnAction(){
|
void aboutBtnAction(){
|
||||||
JFXDialogLayout content= new JFXDialogLayout();
|
String headingText = "cemu_UI";
|
||||||
content.setHeading(new Text("cemu_UI"));
|
String bodyText = "cemu_UI by @Seil0 \nVersion: " + version + " (" + buildNumber + ") \"" + versionName + "\" \n"
|
||||||
content.setBody(new Text("cemu_UI by @Seil0 \nVersion: "+version+" ("+buildNumber+") \""+versionName+"\" \nThis Application is made with free Software\nwww.kellerkinder.xyz"));
|
+ "This Application is made with free Software\n"
|
||||||
content.setPrefSize(350, 170);
|
+ "www.kellerkinder.xyz";
|
||||||
StackPane stackPane = new StackPane();
|
JFXInfoDialog aboutDialog = new JFXInfoDialog(headingText, bodyText, dialogBtnStyle, 350, 170, main.pane);
|
||||||
stackPane.autosize();
|
aboutDialog.show();
|
||||||
JFXDialog dialog =new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
|
|
||||||
JFXButton button=new JFXButton("Okay");
|
|
||||||
button.setOnAction(new EventHandler<ActionEvent>(){
|
|
||||||
@Override
|
|
||||||
public void handle(ActionEvent event){
|
|
||||||
dialog.close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
|
|
||||||
button.setPrefHeight(32);
|
|
||||||
button.setStyle(dialogBtnStyle);
|
|
||||||
content.setActions(button);
|
|
||||||
main.pane.getChildren().add(stackPane);
|
|
||||||
AnchorPane.setTopAnchor(stackPane, (main.pane.getHeight()-content.getPrefHeight())/2);
|
|
||||||
AnchorPane.setLeftAnchor(stackPane, (main.pane.getWidth()-content.getPrefWidth())/2);
|
|
||||||
dialog.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
|
Loading…
Reference in New Issue