Package it.univr.wordautomata.utils
Class Methods
java.lang.Object
it.univr.wordautomata.utils.Methods
Methods used in the application
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.scene.control.ContextMenu
buildContextMenu
(javafx.scene.Node node) Builds a context menu for the given node.static boolean
existsState
(String label, State state) Checks if a given state exists.static boolean
existsTransitionFromVertex
(String state, String transition) Checks if a transition exists from a given state.static boolean
existsTransitionToVertex
(String state, String transition) Checks if a transition exists to a given state.static javafx.fxml.FXMLLoader
Returns the FXMLLoader of the given FXML file.static File
getResource
(Class<?> className, String folder, String name) static void
loadAndSetController
(String path, javafx.scene.Node n) Loads the FXML file from the given path and sets the controller of the given node.static void
Loads the fonts from the given file names.static void
Opens the given link.static void
openModalLink
(String url) Shows the given link in a modal dialog.static void
save()
Shows the save dialog.static void
saveAs()
Shows the save as dialog.static void
setIcon
(javafx.stage.Stage stage) Sets the icon of the given stage.
-
Constructor Details
-
Methods
public Methods()
-
-
Method Details
-
loadFonts
Loads the fonts from the given file names.- Parameters:
fileNames
- the file names of the fonts to load
-
loadAndSetController
Loads the FXML file from the given path and sets the controller of the given node.- Parameters:
path
- the path of the FXML filen
- the node to set the controller of
-
getLoader
Returns the FXMLLoader of the given FXML file.- Parameters:
fxml
- the name of the FXML file- Returns:
- the FXMLLoader of the given FXML file
-
setIcon
public static void setIcon(javafx.stage.Stage stage) Sets the icon of the given stage.- Parameters:
stage
- the stage to set the icon of
-
buildContextMenu
public static javafx.scene.control.ContextMenu buildContextMenu(javafx.scene.Node node) Builds a context menu for the given node.- Parameters:
node
- the node to build the context menu for- Returns:
- the context menu for the given node
-
save
public static void save()Shows the save dialog. -
saveAs
public static void saveAs()Shows the save as dialog. -
existsState
Checks if a given state exists.- Parameters:
label
- the label of the state to checkstate
- the state to check- Returns:
- true if the state exists, false otherwise
-
existsTransitionFromVertex
Checks if a transition exists from a given state.- Parameters:
state
- the state to checktransition
- the transition to check- Returns:
- true if a transition exists from the given state, false otherwise
-
existsTransitionToVertex
Checks if a transition exists to a given state.- Parameters:
state
- the state to checktransition
- the transition to check- Returns:
- true if a transition exists to the given state, false otherwise
-
openLink
Opens the given link.- Parameters:
url
- the link to open
-
openModalLink
Shows the given link in a modal dialog.- Parameters:
url
- the link to show
-
getResource
-