1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- package ui.controller;
- import ui.model.Category;
- import ui.model.IdCounter;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- 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.searchNode(name);
- }
-
- public void initListener(CategoryListener catLis) {
- categoryController.addCatListener(catLis);
- }
-
-
-
-
-
- ////////// etc
- /**
- * Getter for Model
- * @return
- */
- public Model getModel() {
- return model;
- }
-
-
-
- }
|