ui.model

## Class Model

- java.lang.Object
- - ui.model.Model

    public class Model
    extends java.lang.Object

The Class Model is the class where everything is saved. All changes made to the Data is managed via a controller.

Author:
  Gruppe14

### Constructor Summary

Constructors
Constructor and Description
`Model()` Constructor for the model.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addEdgeOnCanvas(CpsEdge edge)` Adds an Edge to The Canvas.
`int` `getAutoSaveNr()` Returns the auto save Number.
`java.util.ArrayList<Category>` `getCategories()` Returns all Categories.
`java.util.List<CategoryListener>` `getCategoryListeners()` Returns the CategorieListener.
`java.util.HashMap<java.lang.String,java.lang.Integer>` `getCgIdx()` Returns the Categorie Index.
`java.util.ArrayList<AbstractCpsObject>` `getClipboradObjects()` Returns all Objects in the Clipboard.
`Console` `getConsole()` Returns the Console.
`int` `getCurIteration()` Returns cURiTERATION.
`java.util.HashMap<java.lang.Integer,java.lang.Integer>` `getCvsObjIdx()` Returns the CanvasObject Index.
`java.util.ArrayList<CpsEdge>` `getEdgesOnCanvas()` Get all Edges on the Canvas.
`boolean` `getIsSimulation()` Returns the Simulation state (true = simulation, false = modeling).
`int` `getIterations()` Returns ITERATIONS.
`int` `getNumberOfSaves()` Returns the Number of Saves.
`java.util.List<ObjectListener>` `getObjectListeners()` Returns the ObjectListener.
`java.util.ArrayList<AbstractCpsObject>` `getObjectsOnCanvas()` Returns all Objects on the Canvas.
`int` `getScale()` Returns the sCale (Scale for the Images).
`int` `getScaleDiv2()` Returns sCALEdIV2 (The Scale divided by 2).
`AbstractCpsObject` `getSelectedCpsObject()` Returns the Selected Cps Object.
`java.util.ArrayList<AbstractCpsObject>` `getSelectedCpsObjects()` Returns all selected Objects on the Canvas.
`CpsEdge` `getSelectedEdge()` Returns the selected Edge.
`HolonElement` `getSelectedHolonElement()` Returns the Selected Holon Element.
`int` `getSelectedObjectID()` Returns the ID of the selected Object 0 = no Object is selected.
`int` `getTimerSpeed()` get the Interval in ms between each Iteration.
`void` `removeEdgesOnCanvas(CpsEdge edge)` Remove an edge from the Canvas.
`void` `setAutoSaveNr(int autoSaveNr)` Sets the auto save Number.
`void` `setCategories(java.util.ArrayList<Category> categories)` Sets all Categories.
`void` `setCategoryListeners(java.util.LinkedList<CategoryListener> linkedList)` Sets the CategorieListener.
`void` `setCgIdx(java.util.HashMap<java.lang.String,java.lang.Integer> cgIdx)` Sets the Categorie Index.
`void` `setClipboradObjects(java.util.ArrayList<AbstractCpsObject> c)` Sets the ClipboardObjects.
`void` `setConsole(Console console)` Sets the console.
`void` `setCurIteration(int curIT)` sets the current Iteration.
`void` `setCvsObjIdx(java.util.HashMap<java.lang.Integer,java.lang.Integer> cvsObjIdx)` Sets the CanvasObject Index.
`void` `setEdgesOnCanvas(java.util.ArrayList<CpsEdge> arrayList)` Sets the edges on the Canvas.
`void` `setIsSimulation(boolean isSimulation)` Sets the Simulation state (true = simulation, false = modeling).
`void` `setNumberOfSaves(int numberOfSaves)` Set the Number of Saves.
`void` `setObjectListeners(java.util.LinkedList<ObjectListener> linkedList)` Sets the ObjectListener.
`void` `setObjectsOnCanvas(java.util.ArrayList<AbstractCpsObject> objectsOnCanvas)` Sets all Objects on the Canvas.
`void` `setScale(int scale)` Sets the Image Scale.
`void` `setSelectedCpsObject(AbstractCpsObject selectedCpsObject)` Set the Selected Objecs.
`void` `setSelectedEdge(CpsEdge edge)` Set the selected Edge.
`void` `setSelectedHolonElement(HolonElement selectedHolonElement)` Sets the Selecte HolonElement.
`void` `setSelectedObjectID(int id)` Set the ID of the selected Object 0 = no Object is selected.
`void` `setTimerSpeed(int t)` Sets the Interval in ms between each Iteration.
`java.lang.String` `toStringCat()` Transform the Arraylist of categories into a string of all objectName with a separation (',') between each name.

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

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

### Constructor Detail

#### Model

    public Model()

Constructor for the model. It initializes the categories and objectsOnCanvas by default values. Listeners are also initialized by default values.

### Method Detail

#### getCategories

    public java.util.ArrayList<Category> getCategories()

Returns all Categories.

Returns:
  the categories

#### setCategories

    public void setCategories(java.util.ArrayList<Category> categories)

Sets all Categories.

Parameters:
  `categories` - the categories to set

#### toStringCat

    public java.lang.String toStringCat()

Transform the Arraylist of categories into a string of all objectName with a separation (',') between each name.

Returns:
  String of all names separeted by ','

#### getObjectsOnCanvas

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

Returns all Objects on the Canvas.

Returns:
  the objectsOnCanvas

#### setObjectsOnCanvas

    public void setObjectsOnCanvas(java.util.ArrayList<AbstractCpsObject> objectsOnCanvas)

Sets all Objects on the Canvas.

Parameters:
  `objectsOnCanvas` - the objectsOnCanvas to set

#### getEdgesOnCanvas

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

Get all Edges on the Canvas.

Returns:
  the objectsOnCanvas

#### addEdgeOnCanvas

    public void addEdgeOnCanvas(CpsEdge edge)

Adds an Edge to The Canvas.

Parameters:
  `edge` - the edgesOnCanvas to add

#### removeEdgesOnCanvas

    public void removeEdgesOnCanvas(CpsEdge edge)

Remove an edge from the Canvas.

Parameters:
  `edge` - the edge to remove

#### setEdgesOnCanvas

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

Sets the edges on the Canvas.

Parameters:
  `arrayList` - the edgesOnCanvas to set

#### getObjectListeners

    public java.util.List<ObjectListener> getObjectListeners()

Returns the ObjectListener.

Returns:
  the objectListeners

#### setObjectListeners

    public void setObjectListeners(java.util.LinkedList<ObjectListener> linkedList)

Sets the ObjectListener.

Parameters:
  `linkedList` - the objectListeners to set

#### getCategoryListeners

    public java.util.List<CategoryListener> getCategoryListeners()

Returns the CategorieListener.

Returns:
  the categoryListeners

#### setCategoryListeners

    public void setCategoryListeners(java.util.LinkedList<CategoryListener> linkedList)

Sets the CategorieListener.

Parameters:
  `linkedList` - the categoryListeners to set

#### setSelectedObjectID

    public void setSelectedObjectID(int id)

Set the ID of the selected Object 0 = no Object is selected.

Parameters:
  `id` - the ID

#### getSelectedObjectID

    public int getSelectedObjectID()

Returns the ID of the selected Object 0 = no Object is selected.

Returns:
  ID

#### getSelectedCpsObject

    public AbstractCpsObject getSelectedCpsObject()

Returns the Selected Cps Object.

Returns:
  selected Cps Object

#### setSelectedCpsObject

    public void setSelectedCpsObject(AbstractCpsObject selectedCpsObject)

Set the Selected Objecs.

Parameters:
  `selectedCpsObject` - Objects that are selected

#### getSelectedCpsObjects

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

Returns all selected Objects on the Canvas.

Returns:
  The selected Objects

#### getSelectedHolonElement

    public HolonElement getSelectedHolonElement()

Returns the Selected Holon Element.

Returns:
  selected Holon Element

#### setSelectedHolonElement

    public void setSelectedHolonElement(HolonElement selectedHolonElement)

Sets the Selecte HolonElement.

Parameters:
  `selectedHolonElement` - that is Selected

#### getScale

    public int getScale()

Returns the sCale (Scale for the Images).

Returns:
  sCALE

#### getScaleDiv2

    public int getScaleDiv2()

Returns sCALEdIV2 (The Scale divided by 2).

Returns:
  sCALEdIV2

#### setScale

    public void setScale(int scale)

Sets the Image Scale.

Parameters:
  `scale` - for the image

#### getIterations

    public int getIterations()

Returns ITERATIONS.

Returns:
  ITERATIONS

#### setCurIteration

    public void setCurIteration(int curIT)

sets the current Iteration.

Parameters:
  `curIT` - the current Iteration

#### getCurIteration

    public int getCurIteration()

Returns cURiTERATION.

Returns:
  cURiTERATION

#### setSelectedEdge

    public void setSelectedEdge(CpsEdge edge)

Set the selected Edge.

Parameters:
  `edge` - that is selected

#### getSelectedEdge

    public CpsEdge getSelectedEdge()

Returns the selected Edge.

Returns:
  selectedEdge

#### getCgIdx

    public java.util.HashMap<java.lang.String,java.lang.Integer> getCgIdx()

Returns the Categorie Index.

Returns:
  the cgIdx

#### setCgIdx

    public void setCgIdx(java.util.HashMap<java.lang.String,java.lang.Integer> cgIdx)

Sets the Categorie Index.

Parameters:
  `cgIdx` - the cgIdx to set

#### getCvsObjIdx

    public java.util.HashMap<java.lang.Integer,java.lang.Integer> getCvsObjIdx()

Returns the CanvasObject Index.

Returns:
  the cvsObjIdx

#### setCvsObjIdx

    public void setCvsObjIdx(java.util.HashMap<java.lang.Integer,java.lang.Integer> cvsObjIdx)

Sets the CanvasObject Index.

Parameters:
  `cvsObjIdx` - the cvsObjIdx to set

#### setAutoSaveNr

    public void setAutoSaveNr(int autoSaveNr)

Sets the auto save Number.

Parameters:
  `autoSaveNr` - the auto save number

#### getAutoSaveNr

    public int getAutoSaveNr()

Returns the auto save Number.

Returns:
  the auto save Number

#### getNumberOfSaves

    public int getNumberOfSaves()

Returns the Number of Saves.

Returns:
  the numberOfSaves

#### setNumberOfSaves

    public void setNumberOfSaves(int numberOfSaves)

Set the Number of Saves.

Parameters:
  `numberOfSaves` - the numberOfSaves to set

#### setClipboradObjects

    public void setClipboradObjects(java.util.ArrayList<AbstractCpsObject> c)

Sets the ClipboardObjects.

Parameters:
  `c` - Array of Objects

#### getClipboradObjects

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

Returns all Objects in the Clipboard.

Returns:
  Objects in the Clipboard

#### setConsole

    public void setConsole(Console console)

Sets the console.

Parameters:
  `console` - the console

#### getConsole

    public Console getConsole()

Returns the Console.

Returns:
  console the console

#### setTimerSpeed

    public void setTimerSpeed(int t)

Sets the Interval in ms between each Iteration.

Parameters:
  `t` - speed for the Iterations

#### getTimerSpeed

    public int getTimerSpeed()

get the Interval in ms between each Iteration.

Returns:
  timerSpeed speed for the Iterations

#### setIsSimulation

    public void setIsSimulation(boolean isSimulation)

Sets the Simulation state (true = simulation, false = modeling).

Parameters:
  `isSimulation` - boolean for for isSimulation

#### getIsSimulation

    public boolean getIsSimulation()

Returns the Simulation state (true = simulation, false = modeling).

Returns:
  isSimulation boolean for for isSimulation