Package JavaFX
Class Utils
- java.lang.Object
-
- JavaFX.Utils
-
public class Utils extends java.lang.ObjectUtilities class. It wraps some useful methods that are used by two or more classes.- Author:
- Leonardo-Rocha
-
-
Field Summary
Fields Modifier and Type Field Description private static java.io.FileconfigFileprivate static java.io.FileOutputStreamfileOutputStreamprivate static intlastValidIndexprivate static java.util.Propertiespropertiesprivate static java.lang.StringPROPERTIES_PATHstatic java.util.Map<java.lang.String,java.io.File>recentFiles
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
Modifier and Type Method Description static voidaddFileToProperties(java.io.File newFile)Add a new file to configuration file.static voidconfigCanvasResize(javafx.stage.Stage primaryStage, javafx.scene.canvas.Canvas canvas)Config canvas automatic resize according to root size.static voidcreatePropertiesFile(java.util.Map<java.lang.String,java.io.File> mapToSave)Write the files path to a .properties.static java.util.Map<java.lang.String,java.io.File>readPropertiesFile()Read the properties file.
-
-
-
Field Detail
-
PROPERTIES_PATH
private static final java.lang.String PROPERTIES_PATH
- See Also:
- Constant Field Values
-
properties
private static java.util.Properties properties
-
configFile
private static java.io.File configFile
-
fileOutputStream
private static java.io.FileOutputStream fileOutputStream
-
recentFiles
public static java.util.Map<java.lang.String,java.io.File> recentFiles
-
lastValidIndex
private static int lastValidIndex
-
-
Method Detail
-
configCanvasResize
public static void configCanvasResize(javafx.stage.Stage primaryStage, javafx.scene.canvas.Canvas canvas)Config canvas automatic resize according to root size.- Parameters:
primaryStage- stage reference.canvas- reference of the cangas to config automatic resize.
-
createPropertiesFile
public static void createPropertiesFile(java.util.Map<java.lang.String,java.io.File> mapToSave)
Write the files path to a .properties.- Parameters:
mapToSave- map of files to save on the .properties.
-
readPropertiesFile
public static java.util.Map<java.lang.String,java.io.File> readPropertiesFile()
Read the properties file.- Returns:
- a map containing the name and the path of the files.
-
addFileToProperties
public static void addFileToProperties(java.io.File newFile) throws java.io.IOExceptionAdd a new file to configuration file.- Parameters:
newFile- file reference to be added.- Throws:
java.io.IOException- if an error occurs during file writing.
-
-