ui.controller

## Class ObjectController

- java.lang.Object
- - ui.controller.ObjectController

-     public class ObjectController
      extends java.lang.Object

  Controller for Objects.
  Author:
    Gruppe14

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addElement(HolonObject object, HolonElement element)` Adds Element into a Object.
    `void` | `addElementIntoCanvasObject(HolonObject object, HolonElement element)` Adds Element into a Object on the Canvas.
    `void` | `addElementIntoCategoryObject(java.lang.String category, java.lang.String object, HolonElement element)` Add Element into a Object in Category.
    `void` | `addNewElementIntoCanvasObject(int id, java.lang.String element, int amount, float energy)` Add a new Element into a Object on the Canvas.
    `void` | `addNewElementIntoCategoryObject(java.lang.String category, java.lang.String object, java.lang.String element, int amount, float energy)` Add a new Element into a Object in Category.
    `void` | `addSelectedObject(AbstractCpsObject obj)` add an Object to selectedObject.
    `void` | `deleteElement(HolonObject obj, HolonElement ele)` deletes a Element from a given Object.
    `void` | `deleteElementInCanvas(int id, int eleid)` deletes a Element from a given Canvas Object.
    `void` | `deleteElementInCategory(java.lang.String cat, java.lang.String obj, java.lang.String ele)` deletes a Element from a given Category Object.
    `void` | `deleteSelectedObject(AbstractCpsObject obj)` deletes a selectedObject.
    `void` | `initHolonElements()` init default Power supply of the Power Plant.
    `void` | `setClipboardObjects(java.util.ArrayList<AbstractCpsObject> list)` sets clipBoardObjects.
    `void` | `setSelectedObjectID(int id)` Returns the ID of the selected Object 0 = no Object is selected.

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

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

- - ### Constructor Detail

    - #### ObjectController

          public ObjectController(Model model,
                                  MultiPurposeController mp)

      Constructor.
      Parameters:
        `model` - Model
        `mp` - MultiPurposeController

  - ### Method Detail

    - #### initHolonElements

          public void initHolonElements()

      init default Power supply of the Power Plant.

    - #### addElement

          public void addElement(HolonObject object,
                                 HolonElement element)

      Adds Element into a Object.
      Parameters:
        `object` - the Object
        `element` - the Element

    - #### addElementIntoCanvasObject

          public void addElementIntoCanvasObject(HolonObject object,
                                                 HolonElement element)

      Adds Element into a Object on the Canvas.
      Parameters:
        `object` - the Object
        `element` - the Element

    - #### addNewElementIntoCanvasObject

          public void addNewElementIntoCanvasObject(int id,
                                                    java.lang.String element,
                                                    int amount,
                                                    float energy)

      Add a new Element into a Object on the Canvas.
      Parameters:
        `id` - the Object ID
        `element` - the Name of the Element
        `amount` - the Amount
        `energy` - the Energy

    - #### addElementIntoCategoryObject

          public void addElementIntoCategoryObject(java.lang.String category,
                                                   java.lang.String object,
                                                   HolonElement element)

      Add Element into a Object in Category.
      Parameters:
        `category` - the Category
        `object` - the Object
        `element` - the Element

    - #### addNewElementIntoCategoryObject

          public void addNewElementIntoCategoryObject(java.lang.String category,
                                                      java.lang.String object,
                                                      java.lang.String element,
                                                      int amount,
                                                      float energy)

      Add a new Element into a Object in Category.
      Parameters:
        `category` - the Category
        `object` - the Object
        `element` - the Element Name
        `energy` - the Energy
        `amount` - the amount

    - #### deleteElement

          public void deleteElement(HolonObject obj,
                                    HolonElement ele)

      deletes a Element from a given Object.
      Parameters:
        `obj` - the Oject
        `ele` - the Element

    - #### deleteSelectedObject

          public void deleteSelectedObject(AbstractCpsObject obj)

      deletes a selectedObject.
      Parameters:
        `obj` - Cpsobject

    - #### addSelectedObject

          public void addSelectedObject(AbstractCpsObject obj)

      add an Object to selectedObject.
      Parameters:
        `obj` - AbstractCpsobject

    - #### deleteElementInCanvas

          public void deleteElementInCanvas(int id,
                                            int eleid)

      deletes a Element from a given Canvas Object.
      Parameters:
        `id` - the ID
        `eleid` - the Element ID

    - #### deleteElementInCategory

          public void deleteElementInCategory(java.lang.String cat,
                                              java.lang.String obj,
                                              java.lang.String ele)

      deletes a Element from a given Category Object.
      Parameters:
        `cat` - the Category
        `obj` - the Object
        `ele` - the Element

    - #### setSelectedObjectID

          public void setSelectedObjectID(int id)

      Returns the ID of the selected Object 0 = no Object is selected.
      Parameters:
        `id` - the ID of the selected Object

    - #### setClipboardObjects

          public void setClipboardObjects(java.util.ArrayList<AbstractCpsObject> list)

      sets clipBoardObjects.
      Parameters:
        `list` - of CpsObjects