public void drawNet(PetriNetModelProcessor processor)
{
for (Iterator<AbstractPetriNetElementModel> iter = processor.getElementContainer().getRootElements().iterator(); iter.hasNext();)
{
AbstractPetriNetElementModel element = (AbstractPetriNetElementModel) iter.next();
GroupModel group = groupName(element, (element.getNameModel()));
// The combination of element and element name plus all additional
// cells (resources) is in general not ungroupable
group.setUngroupable(false);
if (element.getType() == AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE ||
element.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE ||
element.getType() == AbstractPetriNetElementModel.SUBP_TYPE)
{
// Restore display of trigger element if present
if (((TransitionModel) element).hasTrigger())
{
ParentMap pm = new ParentMap();
pm.addEntry(((TransitionModel) element).getToolSpecific().getTrigger(), group);
HashMap<GroupModel, AttributeMap> hm = new HashMap<GroupModel, AttributeMap>();
hm.put(group, group.getAttributes());
getModel().insert(new Object[] { ((TransitionModel) element).getToolSpecific().getTrigger() }, hm, null, pm, null);
}
// Restore display of associated resource if present
if (((TransitionModel) element).hasResource())
{
ParentMap pm = new ParentMap();
pm.addEntry(((TransitionModel) element).getToolSpecific().getTransResource(), group);
HashMap<GroupModel, AttributeMap> hm = new HashMap<GroupModel, AttributeMap>();
hm.put(group, group.getAttributes());
getModel().insert(new Object[] { ((TransitionModel) element).getToolSpecific().getTransResource() }, hm, null, pm, null);
}
}
getGraphLayoutCache().insertGroup(group, new Object[] { element, ((AbstractPetriNetElementModel) element).getNameModel() });
}