51 lines
1.1 KiB
Java
51 lines
1.1 KiB
Java
package app.model;
|
|
|
|
import javafx.scene.Scene;
|
|
|
|
/**
|
|
* Data model of the application.
|
|
*
|
|
* Contains a static reference to state that has to be accessed
|
|
* by multiple pieces in the application, including the primary scene.
|
|
*/
|
|
public class Model {
|
|
private static boolean fileIsSaved;
|
|
private static String activeFilePath;
|
|
private static String currentProjectPath;
|
|
private static ProgrammingLanguage currentProgrammingLanguage;
|
|
private static Scene scene;
|
|
|
|
public static String getActiveFilePath() {
|
|
return activeFilePath;
|
|
}
|
|
|
|
public static String getProjectPath() {
|
|
return currentProjectPath;
|
|
}
|
|
|
|
public static ProgrammingLanguage getLanguage() {
|
|
return currentProgrammingLanguage;
|
|
}
|
|
|
|
public static Scene getScene() {
|
|
return scene;
|
|
}
|
|
|
|
public static boolean getFileIsSaved() {
|
|
return fileIsSaved;
|
|
}
|
|
|
|
public static void setLanguage(ProgrammingLanguage language) {
|
|
Model.currentProgrammingLanguage = language;
|
|
}
|
|
|
|
public static void setScene(Scene scene) {
|
|
Model.scene = scene;
|
|
}
|
|
|
|
public static void setFileIsSaved(boolean fileIsSaved) {
|
|
Model.fileIsSaved = fileIsSaved;
|
|
}
|
|
|
|
}
|