|
@@ -53,6 +53,7 @@ public class Control {
|
|
this.consoleController = new ConsoleController(MODEL);
|
|
this.consoleController = new ConsoleController(MODEL);
|
|
autoPath = System.getProperty("user.home") + "/HolonGUI/Autosave/";
|
|
autoPath = System.getProperty("user.home") + "/HolonGUI/Autosave/";
|
|
File dest = new File(autoPath);
|
|
File dest = new File(autoPath);
|
|
|
|
+ deleteDirectory(dest);
|
|
dest.mkdirs();
|
|
dest.mkdirs();
|
|
try {
|
|
try {
|
|
autoSave();
|
|
autoSave();
|
|
@@ -62,6 +63,20 @@ public class Control {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void deleteDirectory(File path) {
|
|
|
|
+ if (path.exists()) {
|
|
|
|
+ File[] files = path.listFiles();
|
|
|
|
+ for (int i = 0; i < files.length; i++) {
|
|
|
|
+ if (files[i].isDirectory()) {
|
|
|
|
+ deleteDirectory(files[i]);
|
|
|
|
+ } else {
|
|
|
|
+ files[i].delete();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ path.delete();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Operations for searching */
|
|
/* Operations for searching */
|
|
|
|
|
|
public CpsObject searchByID(int ID) {
|
|
public CpsObject searchByID(int ID) {
|
|
@@ -313,7 +328,7 @@ public class Control {
|
|
public void addTextToConsole(String text, Color color, int p, boolean bold, boolean italic, boolean nl) {
|
|
public void addTextToConsole(String text, Color color, int p, boolean bold, boolean italic, boolean nl) {
|
|
consoleController.addTextToConsole(text, color, p, bold, italic, nl);
|
|
consoleController.addTextToConsole(text, color, p, bold, italic, nl);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Print Text on the console in black and font size 12
|
|
* Print Text on the console in black and font size 12
|
|
*
|
|
*
|
|
@@ -330,14 +345,14 @@ public class Control {
|
|
public void clearConsole() {
|
|
public void clearConsole() {
|
|
consoleController.clearConsole();
|
|
consoleController.clearConsole();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @return sets the timerSpeed
|
|
* @return sets the timerSpeed
|
|
*/
|
|
*/
|
|
public void setTimerSpeed(int t) {
|
|
public void setTimerSpeed(int t) {
|
|
globalController.setTimerSpeed(t);
|
|
globalController.setTimerSpeed(t);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param isSimulation
|
|
* @param isSimulation
|
|
* boolean for for isSimulation
|
|
* boolean for for isSimulation
|