classes

## Class AbstractCpsObject

- java.lang.Object
- - classes.AbstractCpsObject

Direct Known Subclasses:
  CpsNode, HolonObject, HolonSwitch, HolonTransformer

    public abstract class AbstractCpsObject
    extends java.lang.Object

The abstract class "CpsObject" represents any possible object in the system (except Edges). The representation of any object contains following variables: see description of variables

Author:
  Gruppe14

### Constructor Summary

Constructors
Constructor and Description
`AbstractCpsObject(AbstractCpsObject obj)` Constructor for a new CpsObject with an unique ID (This constructor correspond to the interaction between the Categories and Canvas)--> actually the "new" Object is a copy.
`AbstractCpsObject(java.lang.String objName)` Constructor for a CpsObejct with an unique ID.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addConnection(CpsEdge toConnect)` Add a new connection to the selected Object.
`java.util.ArrayList<java.lang.Integer>` `addPseudoTag()` add a pseudo tag.
`void` `addTag(int tag)` For internal purpose (energy flow).
`java.awt.Color` `getBorderColor()` Get the color of the border.
`java.util.ArrayList<CpsEdge>` `getConnectedTo()` List of all existing connections.
`java.util.ArrayList<CpsEdge>` `getConnections()` List of all existing connections.
`int` `getID()` Getter of the unique ID.
`java.lang.String` `getImage()` Get the path of the image for the selected Object.
`java.lang.String` `getName()` Getter for the user-defined name (no unique).
`java.lang.String` `getObjName()` Getter for the type of the Object.
`Position` `getPosition()` Get the actual position of the Object.
`java.util.ArrayList<java.lang.Integer>` `getPseudoTags()` Get the pseudo tags.
`java.lang.String` `getSav()` For save purpose.
`java.util.ArrayList<java.lang.Integer>` `getTag()` Get the actual tags.
`void` `resetTags()` Rest the tags to Null.
`void` `setBorderColor(java.awt.Color c)` Set the Border Color of this CpsObject.
`void` `setConnections(java.util.ArrayList<CpsEdge> arrayList)` Set a new ArrayList of connections (Update).
`void` `setID(int id)` Set the ID to a new one.
`void` `setImage(java.lang.String image)` Set the path of the image.
`void` `setName(java.lang.String name)` Set the name.
`void` `setObjName(java.lang.String objName)` Set the type of Object.
`void` `setPosition(int x, int y)` Set the position of the Object in the canvas.
`void` `setPosition(Position pos)` Set the position of the Object in the canvas.
`void` `setPseudoTags(java.util.ArrayList<java.lang.Integer> tags)` For internal purpose (energy flow).
`void` `setSav(java.lang.String sav)` For save purpose.
`void` `setTags(java.util.ArrayList<java.lang.Integer> tags)` For internal purpose (energy flow).

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

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

### Constructor Detail

#### AbstractCpsObject

    public AbstractCpsObject(java.lang.String objName)

Constructor for a CpsObejct with an unique ID.

Parameters:
  `objName` - of the Object

#### AbstractCpsObject

    public AbstractCpsObject(AbstractCpsObject obj)

Constructor for a new CpsObject with an unique ID (This constructor correspond to the interaction between the Categories and Canvas)--> actually the "new" Object is a copy.

Parameters:
  `obj` - Object to be copied

### Method Detail

#### getObjName

    public java.lang.String getObjName()

Getter for the type of the Object.

Returns:
  String

#### setObjName

    public void setObjName(java.lang.String objName)

Set the type of Object.

Parameters:
  `objName` - String

#### getName

    public java.lang.String getName()

Getter for the user-defined name (no unique).

Returns:
  String

#### setName

    public void setName(java.lang.String name)

Set the name.

Parameters:
  `name` - String

#### getID

    public int getID()

Getter of the unique ID.

Returns:
  int

#### setID

    public void setID(int id)

Set the ID to a new one.

Parameters:
  `id` - the iD to set

#### getImage

    public java.lang.String getImage()

Get the path of the image for the selected Object.

Returns:
  String

#### setImage

    public void setImage(java.lang.String image)

Set the path of the image.

Parameters:
  `image` - the Image to set

#### getConnections

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

List of all existing connections.

Returns:
  the connections ArrayList

#### setConnections

    public void setConnections(java.util.ArrayList<CpsEdge> arrayList)

Set a new ArrayList of connections (Update).

Parameters:
  `arrayList` - the connections to set

#### getConnectedTo

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

List of all existing connections.

Returns:
  the connections ArrayList

#### addConnection

    public void addConnection(CpsEdge toConnect)

Add a new connection to the selected Object.

Parameters:
  `toConnect` - Edge

#### setPosition

    public void setPosition(Position pos)

Set the position of the Object in the canvas.

Parameters:
  `pos` - Coordinates

#### setPosition

    public void setPosition(int x,
                            int y)

Set the position of the Object in the canvas.

Parameters:
  `x` - X-Coord
  `y` - Y-Coord

#### getPosition

    public Position getPosition()

Get the actual position of the Object.

Returns:
  Position Position of this Object

#### getSav

    public java.lang.String getSav()

For save purpose.

Returns:
  the stored

#### setSav

    public void setSav(java.lang.String sav)

For save purpose.

Parameters:
  `sav` - the stored to set

#### getBorderColor

    public java.awt.Color getBorderColor()

Get the color of the border.

Returns:
  the BorderColor

#### setBorderColor

    public void setBorderColor(java.awt.Color c)

Set the Border Color of this CpsObject.

Parameters:
  `c` - the BorderColor

#### addTag

    public void addTag(int tag)

For internal purpose (energy flow).

Parameters:
  `tag` - for internal purpose

#### getTag

    public java.util.ArrayList<java.lang.Integer> getTag()

Get the actual tags.

Returns:
  ArrayList

#### resetTags

    public void resetTags()

Rest the tags to Null.

#### setTags

    public void setTags(java.util.ArrayList<java.lang.Integer> tags)

For internal purpose (energy flow).

Parameters:
  `tags` - for internal purpose

#### setPseudoTags

    public void setPseudoTags(java.util.ArrayList<java.lang.Integer> tags)

For internal purpose (energy flow).

Parameters:
  `tags` - for internal purpose

#### getPseudoTags

    public java.util.ArrayList<java.lang.Integer> getPseudoTags()

Get the pseudo tags.

Returns:
  ArrayList

#### addPseudoTag

    public java.util.ArrayList<java.lang.Integer> addPseudoTag()

add a pseudo tag.

Returns:
  ArrayList