public class GUIUtilities
extends java.lang.Object
Taken from our main project (methods have been removed).
| Constructor and Description |
|---|
GUIUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static javafx.scene.control.Button |
makeButton(java.lang.String name,
javafx.event.EventHandler<javafx.event.ActionEvent> handler)
Makes a button with a given name and event.
|
static javafx.scene.control.Slider |
makeSlider(javafx.beans.value.ChangeListener<java.lang.Number> listener,
double start,
double end,
double currVal)
Creates a new slider, setting all necessary intervals and locations.
|
static javafx.scene.control.Dialog |
popUp(java.lang.String title,
java.lang.String header) |
static java.io.File |
promptAndGetFile(javafx.stage.FileChooser.ExtensionFilter extension,
java.lang.String prompt)
Prompts a file chooser box for the user to choose a file with ONE
extension filter
|
static java.io.File |
promptAndGetFile(java.util.List<javafx.stage.FileChooser.ExtensionFilter> filters,
java.lang.String prompt)
Prompts a file chooser box for the user to choose a file with MULTIPLE
extension filters
|
static boolean |
showAlert(java.lang.String title,
java.lang.String header,
java.lang.String message,
javafx.scene.control.Alert.AlertType type)
Show an alert with a certain message and a given type.
|
static void |
showError(java.lang.String title,
java.lang.String message)
Show an error with a certain message.
|
public static boolean showAlert(java.lang.String title,
java.lang.String header,
java.lang.String message,
javafx.scene.control.Alert.AlertType type)
String - title: title of alert, could be nullString - header: header for the alert, could be nullString - message: longer message further describing the alert, could be
null (though all three above shouldn't be null at the same
time or the alert is useless)AlertType - type: type of alert to display, i.e. ERROR, INFORMATION,
CONFIRMATIONpublic static void showError(java.lang.String title,
java.lang.String message)
error - messagepublic static javafx.scene.control.Button makeButton(java.lang.String name,
javafx.event.EventHandler<javafx.event.ActionEvent> handler)
String - name: name of buttonEventHandler - handler: action/method to occur when button is pressedpublic static java.io.File promptAndGetFile(javafx.stage.FileChooser.ExtensionFilter extension,
java.lang.String prompt)
ExtensionFilter - extension: file extension that the user can choose from, all
others are not allowedString - prompt: prompt for the file chooser boxpublic static java.io.File promptAndGetFile(java.util.List<javafx.stage.FileChooser.ExtensionFilter> filters,
java.lang.String prompt)
List - filters: file extensions that the user can choose from, all
others are not allowedString - prompt: prompt for the file chooser boxpublic static javafx.scene.control.Slider makeSlider(javafx.beans.value.ChangeListener<java.lang.Number> listener,
double start,
double end,
double currVal)
ChangeListener - the changeImage the slider is listening to and event/method it calls when the changeImage occursstart - the start of the slider rangeend - the end of the slider rangeincr - the increment of the slider rangepublic static javafx.scene.control.Dialog popUp(java.lang.String title,
java.lang.String header)