api

## Class CpsAPI

- java.lang.Object
- - api.CpsAPI

    public class CpsAPI
    extends java.lang.Object

Api Class for the Cps Controller.

Author:
  Gruppe14

### Constructor Summary

Constructors
Constructor and Description
`CpsAPI(Control cont)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `consolePrint(java.lang.String text)` prints a given text on the console.
`void` `consolePrint(java.lang.String text, java.awt.Color color, int p, boolean bold, boolean italic, boolean nl)` prints a given text on the console with more details.
`java.util.ArrayList<CpsEdge>` `getAllEdges()` Reutn all Edges on the Canvas in no specific order.
`java.util.ArrayList<HolonObject>` `getAllHolonObjects()` Return all Holon Objects on the Canvas in no specific order.
`java.util.ArrayList<AbstractCpsObject>` `getAllObjOnCanvas()` Return all Objects on the Canvas in no Specific order.
`java.util.ArrayList<HolonSwitch>` `getAllSwitches()` Return all Swtiches on the Canvas in no specific order.
`java.util.ArrayList<SubNet>` `getSubNets()` a SubNet contains all Components.
`void` `resetBorderColor(AbstractCpsObject toReset)` resets the bordercolor of given object to default (white).
`void` `resetBorderColorForAll()` resets the bordercolor for all objects on canvas.
`void` `setBorderColorForMultObj(java.util.ArrayList<AbstractCpsObject> objects, java.awt.Color color)` changes the borderColor for all objects in List to given color.
`void` `setBorderColorForObj(AbstractCpsObject toChange, java.awt.Color color)` changes the border color of given object to given color.

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

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

### Constructor Detail

#### CpsAPI

    public CpsAPI(Control cont)

Constructor.

Parameters:
  `cont` - Controller

### Method Detail

#### getSubNets

    public java.util.ArrayList<SubNet> getSubNets()

a SubNet contains all Components.

Returns:
  all SubNets on Canvas

#### getAllObjOnCanvas

    public java.util.ArrayList<AbstractCpsObject> getAllObjOnCanvas()

Return all Objects on the Canvas in no Specific order.

Returns:
  all Objects on Canvas in no specific order

#### getAllEdges

    public java.util.ArrayList<CpsEdge> getAllEdges()

Reutn all Edges on the Canvas in no specific order.

Returns:
  all Edges on Canvas

#### getAllSwitches

    public java.util.ArrayList<HolonSwitch> getAllSwitches()

Return all Swtiches on the Canvas in no specific order.

Returns:
  all Switches on Canvas.

#### getAllHolonObjects

    public java.util.ArrayList<HolonObject> getAllHolonObjects()

Return all Holon Objects on the Canvas in no specific order.

Returns:
  all Holon Objects

#### consolePrint

    public void consolePrint(java.lang.String text)

prints a given text on the console.

Parameters:
  `text` - Text

#### consolePrint

    public void consolePrint(java.lang.String text,
                             java.awt.Color color,
                             int p,
                             boolean bold,
                             boolean italic,
                             boolean nl)

prints a given text on the console with more details.

Parameters:
  `text` - the text that will be printed
  `color` - the color the text will have
  `p` - font size
  `bold` - true or false
  `italic` - true or false
  `nl` - new line after text

#### setBorderColorForObj

    public void setBorderColorForObj(AbstractCpsObject toChange,
                                     java.awt.Color color)

changes the border color of given object to given color.

Parameters:
  `toChange` - CpsObject
  `color` - Color

#### setBorderColorForMultObj

    public void setBorderColorForMultObj(java.util.ArrayList<AbstractCpsObject> objects,
                                         java.awt.Color color)

changes the borderColor for all objects in List to given color.

Parameters:
  `objects` - AttayList of CpsObject
  `color` - Color

#### resetBorderColor

    public void resetBorderColor(AbstractCpsObject toReset)

resets the bordercolor of given object to default (white).

Parameters:
  `toReset` - CpsObject

#### resetBorderColorForAll

    public void resetBorderColorForAll()

resets the bordercolor for all objects on canvas.