private void saveModelElementContainer(NetType iNet, ModelElementContainer elementContainer){
Iterator<AbstractPetriNetElementModel> root2Iter = elementContainer.getRootElements().iterator();
while (root2Iter.hasNext())
{
AbstractPetriNetElementModel currentModel = (AbstractPetriNetElementModel) root2Iter.next();
/* ##### PLACES ##### */
if (currentModel.getType() == AbstractPetriNetElementModel.PLACE_TYPE)
{
initPlace(iNet.addNewPlace(), (PlaceModel) currentModel);
}
/* ##### NORMAL TRANSITION ##### */
else if (currentModel.getType() == AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE)
{
initTransition(iNet.addNewTransition(), (TransitionModel) currentModel, null);
}
/* ##### SUB TRANSITION ##### */
else if (currentModel.getType() == AbstractPetriNetElementModel.SUBP_TYPE)
{
initTransition(iNet.addNewTransition(), (TransitionModel) currentModel, null);
}
/* ##### OPERATOR TRANSITION ##### */
else if (currentModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
{
OperatorTransitionModel operatorModel = (OperatorTransitionModel) currentModel;
Iterator<AbstractPetriNetElementModel> simpleTransIter = operatorModel.getSimpleTransContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE).values().iterator();
while (simpleTransIter.hasNext())
{
AbstractPetriNetElementModel simpleTransModel = (AbstractPetriNetElementModel) simpleTransIter.next();
if (simpleTransModel != null
&& operatorModel.getSimpleTransContainer().getElementById(simpleTransModel.getId()).getType() == AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE)
{
initTransition(iNet.addNewTransition(), (TransitionModel) operatorModel.getSimpleTransContainer().getElementById(simpleTransModel.getId()), operatorModel);
}
}
if (operatorModel.getCenterPlace() != null)
{
initPlace(iNet.addNewPlace(), operatorModel.getCenterPlace());
}
}
}
/* ##### ARCS ##### */
this.arcCounter = 0;
Set<AbstractPetriNetElementModel> connectedTransitions = new HashSet<AbstractPetriNetElementModel>();
Iterator<String> arcIter = elementContainer.getArcMap().keySet().iterator();
while (arcIter.hasNext())
{
ArcModel currentArc = elementContainer.getArcById(arcIter.next());
AbstractPetriNetElementModel currentTargetModel = (AbstractPetriNetElementModel) elementContainer.getElementById(currentArc.getTargetId());
AbstractPetriNetElementModel currentSourceModel = (AbstractPetriNetElementModel) elementContainer.getElementById(currentArc.getSourceId());
if (currentTargetModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
connectedTransitions.add(currentTargetModel);
else if (currentSourceModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
connectedTransitions.add(currentSourceModel);
else
{
initArc(iNet.addNewArc(), currentArc, null);
}