|
@@ -1,5 +1,6 @@
|
|
|
package ui.controller;
|
|
|
|
|
|
+import java.awt.Point;
|
|
|
import java.awt.event.ActionListener;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
@@ -12,6 +13,8 @@ import classes.CpsNode;
|
|
|
import classes.CpsObject;
|
|
|
import classes.HolonElement;
|
|
|
import classes.HolonObject;
|
|
|
+import classes.HolonSwitch;
|
|
|
+import classes.Position;
|
|
|
import ui.model.Model;
|
|
|
import ui.view.MyCanvas;
|
|
|
|
|
@@ -65,16 +68,16 @@ public class Control {
|
|
|
public CpsObject searchCategoryObject(String category, String object) {
|
|
|
return multiPurposeController.searchCatObj(multiPurposeController.searchCat(category), object);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public Category searchCategory(String cat) {
|
|
|
return multiPurposeController.searchCat(cat);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void resetCategorys(){
|
|
|
+ public void resetCategorys() {
|
|
|
categoryController.initCategories();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void addCategory(String cat) {
|
|
|
categoryController.addNewCategory(cat);
|
|
|
}
|
|
@@ -175,7 +178,7 @@ public class Control {
|
|
|
public void deleteElementCanvas(HolonObject obj, HolonElement ele) {
|
|
|
objectController.deleteElement(obj, ele);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void setClipboardObjects(ArrayList<CpsObject> list) {
|
|
|
MODEL.setClipboradObjects(list);
|
|
|
}
|
|
@@ -223,8 +226,8 @@ public class Control {
|
|
|
private void autoSave() throws IOException {
|
|
|
autoSaveController.increaseAutoSaveNr();
|
|
|
storeController.writeCanvasFile(autoPath + autoSaveController.getAutoSaveNr());
|
|
|
- if(autoSaveController.allowed()){
|
|
|
- new File(autoPath + (autoSaveController.getAutoSaveNr()-globalController.getNumbersOfSaves())).delete();
|
|
|
+ if (autoSaveController.allowed()) {
|
|
|
+ new File(autoPath + (autoSaveController.getAutoSaveNr() - globalController.getNumbersOfSaves())).delete();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -244,6 +247,18 @@ public class Control {
|
|
|
return autoPath + (autoSaveController.getAutoSaveNr());
|
|
|
}
|
|
|
|
|
|
+ public void copyObjects() {
|
|
|
+ canvasController.copyObjects();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void pasteObjects(Point point) {
|
|
|
+ canvasController.pasteObjects(point);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void cutObjects() {
|
|
|
+ canvasController.cutObjects();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* Getter for Model
|
|
|
*
|