12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package ui.controller;
- import ui.model.IdCounter;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.util.LinkedList;
- import classes.Category;
- import classes.CpsObject;
- import Interfaces.CategoryListener;
- import ui.model.Model;
- import ui.view.GUI;
- public class Control {
-
- public enum command {
- CATEGORY, OBJECT
- }
-
- private IdCounter iD;
- private Model model;
- private ActionListener actionListener;
- private final CategoryController categoryController;
-
- public Control(Model model, IdCounter id){
- this.model = model;
- this.iD = id;
- this.categoryController = new CategoryController(model, id);
- }
-
-
-
-
- ////////// Operations for Categories and Objects ///////////
- public void addNewCategory(String catName){
- categoryController.addNewCategory(catName);
- }
-
- public void addNewObject(Category cat, String name){
- categoryController.addNewHolonObject(cat, name);
- }
-
- public void addNewTransformer(Category cat, String name){
- categoryController.addNewHolonTransformer(cat, name);
- }
-
- public void addNewSwitch(Category cat, String name){
- categoryController.addNewHolonSwitch(cat, name);
- }
-
- public Category searchCategory(String name) {
-
- return categoryController.searchCatNode(name);
- }
-
- public void initListener(CategoryListener catLis) {
- categoryController.addCatListener(catLis);
- }
-
- public void deleteCategory(String catName){
- categoryController.deleteCategory(catName);
- }
-
- public void deleteObjectInCat(String toDelete, String deleteIn){
- categoryController.deleteObjectInCat(toDelete, deleteIn);
- }
-
-
- ////////// etc
- /**
- * Getter for Model
- * @return
- */
- public Model getModel() {
- return model;
- }
-
-
-
- }
|