CategoryControl.java 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package ui.controller;
  2. import java.util.ArrayList;
  3. import com.sun.glass.ui.View;
  4. import ui.model.*;
  5. import ui.view.*;
  6. public class CategoryControl{
  7. private IdCounter id;
  8. private Model model;
  9. private GUI view;
  10. public CategoryControl(Model model, GUI view, IdCounter id){
  11. this.id = id;
  12. this.model = model;
  13. this.view = view;
  14. initCategories();
  15. }
  16. /**
  17. * initialisiert alle Standart Kategorien und Objekte
  18. */
  19. public void initCategories(){
  20. Category energy = new Category("Energy");
  21. Category building = new Category("Building");
  22. Category component = new Category("Component");
  23. HolonObject powerp = new HolonObject("Power Plant");
  24. HolonObject house = new HolonObject("House");
  25. HolonObject transformer = new HolonObject("Transformer");
  26. HolonObject sw = new HolonObject("Switch");
  27. energy.addObject(powerp);
  28. building.addObject(house);
  29. component.addObject(transformer);
  30. component.addObject(sw);
  31. model.addCategory(energy);
  32. model.addCategory(building);
  33. model.addCategory(component);
  34. }
  35. /**
  36. * läd die Kategorien und Objekte in die View
  37. */
  38. public void loadCategories(){
  39. //ArrayList<Category> category = m.getCategories();
  40. // for (Category c : category) {
  41. //
  42. // }
  43. }
  44. }