ui.controller

## Class CategoryController

- java.lang.Object
- - ui.controller.CategoryController

    public class CategoryController
    extends java.lang.Object

Controller for the Categories.

Author:
  Gruppe14

### Constructor Summary

Constructors
Constructor and Description
`CategoryController(Model model, MultiPurposeController mp)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addCategory(Category category)` Adds Category into Model if a Category with the same name already exists Add Category_+1.
`void` `addCategoryListener(CategoryListener catLis)` Init the CategoryListener.
`void` `addNewCategory(java.lang.String name)` Adds New Category into Model.
`void` `addNewHolonObject(Category category, java.lang.String object, java.util.ArrayList<HolonElement> elements, java.lang.String image)` Add new Holon Object to a Category.
`void` `addNewHolonSwitch(Category cat, java.lang.String objName, java.lang.String image)` Add new Holon Switch.
`void` `addNewHolonTransformer(Category cat, java.lang.String objName, java.lang.String image)` Add new Holon Transformer.
`void` `addObject(Category category, AbstractCpsObject object)` Add Object into a Category.
`void` `deleteCategory(java.lang.String category)` delete a given Category.
`void` `deleteObject(java.lang.String category, java.lang.String obj)` Delete an Object from a Category.
`void` `initCategories()` init default category and objects.
`void` `notifyCatListeners()` notifies all listeners about changes in the Categories.
`void` `removeCategory(Category c)` remove a Category from Model.
`void` `removeObject(Category category, AbstractCpsObject cps)` Removes an Object from a Category.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CategoryController

    public CategoryController(Model model,
                              MultiPurposeController mp)

Constructor.

Parameters:
  `model` - the Model
  `mp` - the MultiPurposeController

### Method Detail

#### initCategories

    public void initCategories()

init default category and objects.

#### addCategory

    public void addCategory(Category category)

Adds Category into Model if a Category with the same name already exists Add Category_+1.

Parameters:
  `category` - the new Category

#### addNewCategory

    public void addNewCategory(java.lang.String name)

Adds New Category into Model.

Parameters:
  `name` - Bezeichnung der neuen Kategorie

#### removeCategory

    public void removeCategory(Category c)

remove a Category from Model.

Parameters:
  `c` - Category

#### deleteCategory

    public void deleteCategory(java.lang.String category)

delete a given Category.

Parameters:
  `category` - the Category

#### addObject

    public void addObject(Category category,
                          AbstractCpsObject object)

Add Object into a Category.

Parameters:
  `category` - Category
  `object` - Object

#### addNewHolonObject

    public void addNewHolonObject(Category category,
                                  java.lang.String object,
                                  java.util.ArrayList<HolonElement> elements,
                                  java.lang.String image)

Add new Holon Object to a Category.

Parameters:
  `category` - Category
  `object` - New Object Name
  `elements` - Array of Elements
  `image` - the image Path

#### addNewHolonTransformer

    public void addNewHolonTransformer(Category cat,
                                       java.lang.String objName,
                                       java.lang.String image)

Add new Holon Transformer.

Parameters:
  `cat` - Category
  `objName` - New Object Name
  `image` - the image Path

#### addNewHolonSwitch

    public void addNewHolonSwitch(Category cat,
                                  java.lang.String objName,
                                  java.lang.String image)

Add new Holon Switch.

Parameters:
  `cat` - Category
  `objName` - New Object Name
  `image` - the Image Path

#### removeObject

    public void removeObject(Category category,
                             AbstractCpsObject cps)

Removes an Object from a Category.

Parameters:
  `category` - Category
  `cps` - the Object

#### deleteObject

    public void deleteObject(java.lang.String category,
                             java.lang.String obj)

Delete an Object from a Category.

Parameters:
  `category` - the Category
  `obj` - the Object

#### addCategoryListener

    public void addCategoryListener(CategoryListener catLis)

Init the CategoryListener.

Parameters:
  `catLis` - the CategoryListener

#### notifyCatListeners

    public void notifyCatListeners()

notifies all listeners about changes in the Categories.