Class FWSimFieldContainerGroup
java.lang.Object
net.simplace.sim.util.FWSimFieldContainerGroup
- All Implemented Interfaces:
FWSimFieldContainer
Combines several field containers (usually SimComponents) into one group that behaves like a single container, e.g.
to show a group of components as one node in the graph panel. The field maps of all members are merged, and the links
between members and other containers are redirected to the group. Variables cannot be added to or removed from a
group.
- Author:
- aenders
-
Constructor Summary
ConstructorsConstructorDescriptionFWSimFieldContainerGroup(List<FWSimFieldContainer> aContainerList, Collection<SimFieldLink> aSimLinkList, String aName, FWSimVariable.CONTENT_TYPE aContentType, int aOrderNumber) Creates a group. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariable(FWSimVariable<?> aVariable) Adds a variable to the field map.voidcheckCondition(Boolean aCheckResult, String aMessage) Checks a condition during initialisation and reports a failed check according to the check level of the session.HashMap<String, FWSimVariable<?>> Creates the variables of this container.org.jdom2.Elementorg.jdom2.ElementgetEditFormXML(boolean aEnabled) HashMap<String, FWSimVariable<?>> getName()intgetVariable(String aID) Searches the variable in the members in their order; a member that does not have the variable is skipped.booleanvoidremoveVariable(String aID) Removes a variable from the field map.org.jdom2.ElementCreates the XML configuration of this group for the LAP client: aconfigurationelement with asimgroupchild containing the group XML of all members.toString()org.jdom2.ElementtoXML()
-
Constructor Details
-
FWSimFieldContainerGroup
public FWSimFieldContainerGroup(List<FWSimFieldContainer> aContainerList, Collection<SimFieldLink> aSimLinkList, String aName, FWSimVariable.CONTENT_TYPE aContentType, int aOrderNumber) Creates a group. The members are sorted by their order number and their field maps are merged. Links that start or end at a member are copied and redirected to the group; links that do not touch the group are removed from the original link list.- Parameters:
aContainerList- the members of the groupaSimLinkList- all links between containersaName- name of the groupaContentType- content type of the groupaOrderNumber- position of the group in the order of execution
-
-
Method Details
-
createVariables
Description copied from interface:FWSimFieldContainerCreates the variables of this container. Called once when the container is set up.- Specified by:
createVariablesin interfaceFWSimFieldContainer- Returns:
- the variables, keyed by name
- See Also:
-
addVariable
Description copied from interface:FWSimFieldContainerAdds a variable to the field map.- Specified by:
addVariablein interfaceFWSimFieldContainer- Parameters:
aVariable- the variable to add- See Also:
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumberin interfaceFWSimFieldContainer- Returns:
- position of this container in the order of execution
- See Also:
-
getContentType
- Specified by:
getContentTypein interfaceFWSimFieldContainer- Returns:
- the content type of the variables of this container (e.g.
sys,mgm) - See Also:
-
getVariable
Searches the variable in the members in their order; a member that does not have the variable is skipped.- Specified by:
getVariablein interfaceFWSimFieldContainer- Parameters:
aID- id of the variable- Returns:
- the variable
- Throws:
SimFieldMissingException- the exception of the last member that failed, if no member has the variable- See Also:
-
removeVariable
Description copied from interface:FWSimFieldContainerRemoves a variable from the field map.- Specified by:
removeVariablein interfaceFWSimFieldContainer- Parameters:
aID- id of the variable- See Also:
-
getName
- Specified by:
getNamein interfaceFWSimFieldContainer- Returns:
- the name of the container
- See Also:
-
getOutputVariables
- Specified by:
getOutputVariablesin interfaceFWSimFieldContainer- Returns:
- the output variables of the field map
- See Also:
-
getInputVariables
- Specified by:
getInputVariablesin interfaceFWSimFieldContainer- Returns:
- the input variables of the field map
- See Also:
-
getFieldMap
- Specified by:
getFieldMapin interfaceFWSimFieldContainer- Returns:
- the whole field map as created in
FWSimFieldContainer.createVariables() - See Also:
-
toXML
public org.jdom2.Element toXML()- Specified by:
toXMLin interfaceFWSimFieldContainer- Returns:
- an XML element with all settings of this container
- See Also:
-
toGroupXML
public org.jdom2.Element toGroupXML()Creates the XML configuration of this group for the LAP client: aconfigurationelement with asimgroupchild containing the group XML of all members. All members must be SimComponents.- Returns:
- the configuration element
-
getFrequence
- Specified by:
getFrequencein interfaceFWSimFieldContainer- Returns:
- the frequency in which this container is called, or
nullif not applicable - See Also:
-
getCreateFormXML
public org.jdom2.Element getCreateFormXML()- Specified by:
getCreateFormXMLin interfaceFWSimFieldContainer- Returns:
- the XML form definition used by the GUI to create this container
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Specified by:
getEditFormXMLin interfaceFWSimFieldContainer- Parameters:
aEnabled- iffalse, the form fields are read-only- Returns:
- the XML form definition used by the GUI to edit the settings of this container
- See Also:
-
toString
-
getFieldContainers
- Returns:
- the members of the group, sorted by order number
-
getTransformedSimFieldLinks
- Returns:
- copies of the links that touch the group, redirected to the group
-
getOriginalSimFieldLinks
- Returns:
- the original links that touch the group
-
getVarMap
- Specified by:
getVarMapin interfaceFWSimFieldContainer- Returns:
- the var map this container belongs to
-
checkCondition
Description copied from interface:FWSimFieldContainerChecks a condition during initialisation and reports a failed check according to the check level of the session.- Specified by:
checkConditionin interfaceFWSimFieldContainer- Parameters:
aCheckResult- result of the check;falsemeans the condition is violatedaMessage- message describing the condition- See Also:
-
isConditionCheck
public boolean isConditionCheck()- Specified by:
isConditionCheckin interfaceFWSimFieldContainer- Returns:
trueif conditions are checked with the current check level of the session- See Also:
-