Class BrickSave

java.lang.Object
com.example.brickpaint.BrickSave

public abstract class BrickSave extends Object
Handles saving a snapshot image of a JavaFX Node with user created or predefined files
Author:
matde
  • Field Details

    • savePath

      public static final String savePath
  • Constructor Details

    • BrickSave

      public BrickSave()
  • Method Details

    • saveImageFromNode

      public static void saveImageFromNode(javafx.scene.Node node, File file, org.apache.logging.log4j.Logger logger, String Name)
      Takes a snapshot of a Node and saves it to the specified file
      Parameters:
      node - The Node from which to take a screenshot of
      file - The File to save the image to
      Name - The name of the node/file being saved
      logger - The logger to log the save operation to
    • saveImageASFromNode

      public static File saveImageASFromNode(javafx.scene.Node node, String Name, org.apache.logging.log4j.Logger logger)
      Takes a snapshot of a Node and saves it to a file created by the user. Will open the file explorer and initially name the file based off the Name
      Parameters:
      node - The node from which to take a screenshot of
      Name - Optional path string from which to initially name the new file with
      logger - The logger to log the save operation to
      Returns:
      returns file that image was saved to, else returns null
    • changeExtension

      public static File changeExtension(File f, String newExtension)
      Helper function that will modify the extension of a file
      Parameters:
      f - File to Modify
      newExtension - The extension the file should be changed to
      Returns:
      The renamed file