Class SimulationTreeNode
- java.lang.Object
- 
- de.unistuttgart.informatik.fius.icge.ui.SimulationTreeNode
 
- 
 public class SimulationTreeNode extends Object A SimulationTreeNode is a data container used to build the simulation tree which is shown in the entity sidebar to allow the user to see and easily select entities in the simulation.- Version:
- 1.0
- Author:
- Tobias Wältken
 
- 
- 
Constructor SummaryConstructors Constructor Description SimulationTreeNode(String elementId, String displayText, String textureId)Default constructor for leaf nodesSimulationTreeNode(String elementId, String displayText, String textureId, boolean isLeaf)This constructor can be used to create non leaf nodes as well as leaf nodes.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappendChild(SimulationTreeNode node)Appends a child node to this nodebooleanequals(Object obj)voidforEachChild(Consumer<SimulationTreeNode> lamda)Runs a function for each added child node with the child node as a parameterList<SimulationTreeNode>getChildren()StringgetDisplayText()Getter for the display text which is the name of the entity which is displayed to the user.StringgetElementId()Getter for the element id the non visible string to better identify the selected entity.StringgetTextureId()Getter for the texture id the identifier of the texture which is rendered infront of the display text.booleanhasChildren()Function to check if the node has children.inthashCode()booleanisLeaf()This checks if node is a leaf node.booleanremoveChild(SimulationTreeNode node)Removes a child node from this nodeStringtoString()
 
- 
- 
- 
Constructor Detail- 
SimulationTreeNodepublic SimulationTreeNode(String elementId, String displayText, String textureId) Default constructor for leaf nodes- Parameters:
- elementId- A non visible id used to better identify the slected entity.
- displayText- The name of the entity which is displayed to the user.
- textureId- The id of the texture which is rendered infront of the display text.
 
 - 
SimulationTreeNodepublic SimulationTreeNode(String elementId, String displayText, String textureId, boolean isLeaf) This constructor can be used to create non leaf nodes as well as leaf nodes.- Parameters:
- elementId- A non visible id used to better identify the slected entity.
- displayText- The name of the entity which is displayed to the user.
- textureId- The id of the texture which is rendered infront of the display text.
- isLeaf- This indicates if node is a leaf node or not.
 
 
- 
 - 
Method Detail- 
getElementIdpublic String getElementId() Getter for the element id the non visible string to better identify the selected entity.- Returns:
- Returns a String
 
 - 
getDisplayTextpublic String getDisplayText() Getter for the display text which is the name of the entity which is displayed to the user.- Returns:
- Returns a String
 
 - 
getTextureIdpublic String getTextureId() Getter for the texture id the identifier of the texture which is rendered infront of the display text.- Returns:
- Returns a String
 
 - 
isLeafpublic boolean isLeaf() This checks if node is a leaf node.- Returns:
- Returns true if noe is a leaf node
 
 - 
hasChildrenpublic boolean hasChildren() Function to check if the node has children.- Returns:
- Returns false if it has no childen.
 
 - 
appendChildpublic boolean appendChild(SimulationTreeNode node) Appends a child node to this node- Parameters:
- node- The node to append
- Returns:
- Returns true if action was successfull
 
 - 
removeChildpublic boolean removeChild(SimulationTreeNode node) Removes a child node from this node- Parameters:
- node- The node to remove
- Returns:
- Returns true if the given node was a child node
 
 - 
getChildrenpublic List<SimulationTreeNode> getChildren() - Returns:
- a list of all children
 
 - 
forEachChildpublic void forEachChild(Consumer<SimulationTreeNode> lamda) Runs a function for each added child node with the child node as a parameter- Parameters:
- lamda- The function to run on every child node
 
 
- 
 
-