}
//if action is called from TopMenuBar
else
{
//open dialog
NeighborhoodQueryParamWithEntitiesDialog dialog = new NeighborhoodQueryParamWithEntitiesDialog(main);
options = dialog.open(options);
if ( !options.isCancel() )
{
options.setCancel(true);
}
else
{
return;
}
//if cancel is not pressed, begin running algorithm
ArrayList<physicalEntity> addedEntities = dialog.getAddedEntities();
Set<GraphObject> sourceSet =
main.getRootGraph().getRelatedStates(addedEntities);
main.getRootGraph().replaceComplexMembersWithComplexes(sourceSet);