|
@@ -72,6 +72,12 @@ public class Control {
|
|
|
|
|
|
public void addObject(Category cat, String obj, ArrayList<HolonElement> ele, String img) {
|
|
public void addObject(Category cat, String obj, ArrayList<HolonElement> ele, String img) {
|
|
categoryController.addNewHolonObject(cat, obj, ele, img);
|
|
categoryController.addNewHolonObject(cat, obj, ele, img);
|
|
|
|
+ try {
|
|
|
|
+ autoSave();
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ // TODO Auto-generated catch block
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void addTransformer(Category cat, String obj) {
|
|
public void addTransformer(Category cat, String obj) {
|
|
@@ -106,11 +112,6 @@ public class Control {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void autoSave() throws IOException {
|
|
|
|
- autoSaveController.increaseAutoSaveNr();
|
|
|
|
- storeController.writeSaveFile(autoPath+autoSaveController.getAutoSaveNr());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public void removeEdgesOnCanvas(CpsEdge edge) {
|
|
public void removeEdgesOnCanvas(CpsEdge edge) {
|
|
canvasController.removeEdgesOnCanvas(edge);
|
|
canvasController.removeEdgesOnCanvas(edge);
|
|
try {
|
|
try {
|
|
@@ -206,13 +207,25 @@ public class Control {
|
|
simulationManager.setCanvas(can);
|
|
simulationManager.setCanvas(can);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void autoSave() throws IOException {
|
|
|
|
+ autoSaveController.increaseAutoSaveNr();
|
|
|
|
+ storeController.writeSaveFile(autoPath+autoSaveController.getAutoSaveNr());
|
|
|
|
+ }
|
|
|
|
+
|
|
public String getUndoSave(){
|
|
public String getUndoSave(){
|
|
autoSaveController.decreaseAutoSaveNr();
|
|
autoSaveController.decreaseAutoSaveNr();
|
|
|
|
+ if(!new File(autoPath + (autoSaveController.getAutoSaveNr())).exists()){
|
|
|
|
+ autoSaveController.increaseAutoSaveNr();
|
|
|
|
+ }
|
|
return autoPath+(autoSaveController.getAutoSaveNr());
|
|
return autoPath+(autoSaveController.getAutoSaveNr());
|
|
}
|
|
}
|
|
|
|
|
|
public String getRedoSave(){
|
|
public String getRedoSave(){
|
|
autoSaveController.increaseAutoSaveNr();
|
|
autoSaveController.increaseAutoSaveNr();
|
|
|
|
+ if(!new File(autoPath+(autoSaveController.getAutoSaveNr())).exists()){
|
|
|
|
+ autoSaveController.decreaseAutoSaveNr();
|
|
|
|
+ }
|
|
return autoPath+(autoSaveController.getAutoSaveNr());
|
|
return autoPath+(autoSaveController.getAutoSaveNr());
|
|
}
|
|
}
|
|
|
|
|