* @return
*/
public static AbstractPetriNetElementModel createModelElement(CreationMap map)
{
AbstractPetriNetElementModel modElement = null;
if (map.getId() != null)
{
try
{
// Check basetype of Element
if (map.getType() == AbstractPetriNetElementModel.PLACE_TYPE)
{
// Creating a new ModelElement with
modElement = new PlaceModel(map);
// Tokens
if (map.getTokens() > 0)
((PlaceModel) modElement).setTokens(map.getTokens());
} else if (map.getType() == AbstractPetriNetElementModel.SUBP_TYPE)
{
/* CREATING A SUBPROCESS */
modElement = new SubProcessModel(map);
} else if (map.getType() == AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE && map.getOperatorType() == -1)
{
/* CREATING A SIMPLE TRANSITION */
modElement = new TransitionModel(map);
} else if (map.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
{
/* CREATING A AALST TRANSITION */
switch (map.getOperatorType())
{
case OperatorTransitionModel.XOR_SPLIT_TYPE:
modElement = new XORSplitOperatorTransitionModel(map);
break;
case OperatorTransitionModel.XOR_JOIN_TYPE:
modElement = new XORJoinOperatorTransitionModel(map);
break;
case OperatorTransitionModel.XOR_SPLITJOIN_TYPE:
modElement = new XORSplitJoinOperatorTransitionModel(map);
break;
case OperatorTransitionModel.AND_SPLIT_TYPE:
modElement = new ANDSplitOperatorTransitionModel(map);
break;
case OperatorTransitionModel.AND_JOIN_TYPE:
modElement = new ANDJoinOperatorTransitionModel(map);
break;
case OperatorTransitionModel.AND_SPLITJOIN_TYPE:
modElement = new ANDSplitJoinOperatorTransitionModel(map);
break;
case OperatorTransitionModel.ANDJOIN_XORSPLIT_TYPE:
modElement = new ANDJoinXORSplitOperatorTransitionModel(map);
break;
case OperatorTransitionModel.XORJOIN_ANDSPLIT_TYPE:
modElement = new XORJoinANDSplitOperatorTransitionModel(map);
break;
default:
LoggerManager.error(Constants.CORE_LOGGER, "Unknown Operator Type (" + map.getOperatorType() + ")");
}
// modElement.setId(id);
// create inital simple trans
((OperatorTransitionModel) modElement).addNewSimpleTrans();
// ((OperatorTransitionModel)
// modElement).setInitalSimpleTrans(simpleTrans);
}
if (modElement != null)
{
// add the DefaultPort as child to the DefaultGraphCell
PortCell port = new PortCell();
modElement.add(port);
}
return modElement;
} catch (Exception ee)
{