|
@@ -20,7 +20,9 @@ public class Control {
|
|
|
|
|
|
private iDCounter ID;
|
|
|
private Model MODEL;
|
|
|
+
|
|
|
private ActionListener actionListener;
|
|
|
+
|
|
|
private final CategoryController categoryController;
|
|
|
private final ObjectController objectController;
|
|
|
private final CanvasController canvasController;
|
|
@@ -30,10 +32,10 @@ public class Control {
|
|
|
this.ID = id;
|
|
|
this.categoryController = new CategoryController(model, id);
|
|
|
this.objectController = new ObjectController(model);
|
|
|
- this.canvasController = new CanvasController(id, model);
|
|
|
+ this.canvasController = new CanvasController(model, id);
|
|
|
}
|
|
|
|
|
|
- ////////// Operations for Categories and Objects ///////////
|
|
|
+ /* Operations for Categories and Objects */
|
|
|
public void addNewCategory(String catName) {
|
|
|
categoryController.addNewCategory(catName);
|
|
|
}
|
|
@@ -66,19 +68,25 @@ public class Control {
|
|
|
public void deleteObjectInCat(String toDelete, String deleteIn) {
|
|
|
categoryController.deleteObjectInCat(toDelete, deleteIn);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- ///////// Operations for Canvas /////////////
|
|
|
+
|
|
|
+ /* Operations for Canvas */
|
|
|
public void addObject(CpsObject object) {
|
|
|
- canvasController.addObject(object);
|
|
|
+ canvasController.addObjectIntoCanvas(object);
|
|
|
}
|
|
|
|
|
|
- public void setSelectedObjectID(int id){
|
|
|
+ public void setSelectedObjectID(int id) {
|
|
|
objectController.setSelectedObjectID(id);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //////// Operations for Objects and Elements //////////
|
|
|
+
|
|
|
+ /* Operations for Objects and Elements */
|
|
|
+ public void addNewElementIntoCanvasObjects(String objName, String eleName, int amount, float energy) {
|
|
|
+ objectController.addNewElementIntoCanvasObject(objName, eleName, amount, energy);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void addNewElementIntoCategoryObject(String catName, String objName, String eleName, int amount,
|
|
|
+ float energy) {
|
|
|
+ objectController.addNewElementIntoCategoryObject(catName, objName, eleName, amount, energy);
|
|
|
+ }
|
|
|
|
|
|
////////// etc
|
|
|
/**
|