Class Methods

java.lang.Object
it.univr.wordautomata.utils.Methods

public class Methods extends Object
Methods used in the application
  • Constructor Details

    • Methods

      public Methods()
  • Method Details

    • loadFonts

      public static void loadFonts(String... fileNames)
      Loads the fonts from the given file names.
      Parameters:
      fileNames - the file names of the fonts to load
    • loadAndSetController

      public 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.
      Parameters:
      path - the path of the FXML file
      n - the node to set the controller of
    • getLoader

      public static javafx.fxml.FXMLLoader getLoader(String fxml)
      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

      public static boolean existsState(String label, State state)
      Checks if a given state exists.
      Parameters:
      label - the label of the state to check
      state - the state to check
      Returns:
      true if the state exists, false otherwise
    • existsTransitionFromVertex

      public static boolean existsTransitionFromVertex(String state, String transition)
      Checks if a transition exists from a given state.
      Parameters:
      state - the state to check
      transition - the transition to check
      Returns:
      true if a transition exists from the given state, false otherwise
    • existsTransitionToVertex

      public static boolean existsTransitionToVertex(String state, String transition)
      Checks if a transition exists to a given state.
      Parameters:
      state - the state to check
      transition - the transition to check
      Returns:
      true if a transition exists to the given state, false otherwise
    • openLink

      public static void openLink(String url)
      Opens the given link.
      Parameters:
      url - the link to open
    • openModalLink

      public static void openModalLink(String url)
      Shows the given link in a modal dialog.
      Parameters:
      url - the link to show
    • getResource

      public static File getResource(Class<?> className, String folder, String name)