Class Dialog
java.lang.Object
fr.r1r0r0.deltaengine.tools.dialog.Dialog
public class Dialog
extends java.lang.Object
Utility class usable to show simple dialog alert
This class is a fork from the original class here : https://github.com/Airels/HeroManager/blob/master/src/main/java/fr/univ_amu/heromanager/utils/gui/Dialog.java
This class is a fork from the original class here : https://github.com/Airels/HeroManager/blob/master/src/main/java/fr/univ_amu/heromanager/utils/gui/Dialog.java
-
Field Summary
Fields Modifier and Type Field Description private javafx.scene.control.Alert
alert
private boolean
exceptionAlert
-
Constructor Summary
Constructors Constructor Description Dialog(DialogType dialogType, java.lang.String applicationName, java.lang.String title, java.lang.String text)
Constructor of this class, who allows to init desired dialogDialog(java.lang.String applicationName, java.lang.String message)
3rd constructor, used to create a busy wait dialogDialog(java.lang.String applicationName, java.lang.String title, java.lang.Exception e)
2nd constructor, used to show an error pop up with an exception. -
Method Summary
Modifier and Type Method Description void
close()
To close dialogprivate void
playSound()
Used to play Windows sound according to alert typevoid
show()
To show dialogvoid
showAndWait()
To show dialog and wait its closure by the userMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
alert
private javafx.scene.control.Alert alert -
exceptionAlert
private boolean exceptionAlert
-
-
Constructor Details
-
Dialog
public Dialog(DialogType dialogType, java.lang.String applicationName, java.lang.String title, java.lang.String text)Constructor of this class, who allows to init desired dialog- Parameters:
dialogType
- type of dialogapplicationName
- name of your applicationtitle
- title of the dialogtext
- text of the dialog
-
Dialog
public Dialog(java.lang.String applicationName, java.lang.String title, java.lang.Exception e)2nd constructor, used to show an error pop up with an exception. Print stack trace in standard output, and end program- Parameters:
applicationName
- name of your applicationtitle
- title of the dialoge
- exception to show
-
Dialog
public Dialog(java.lang.String applicationName, java.lang.String message)3rd constructor, used to create a busy wait dialog- Parameters:
applicationName
- name of your applicationmessage
- message to show
-
-
Method Details
-
show
public void show()To show dialog -
showAndWait
public void showAndWait()To show dialog and wait its closure by the user -
playSound
private void playSound()Used to play Windows sound according to alert type -
close
public void close()To close dialog
-