//if action is called from PopupMenu
if (useSelection)
{
//open dialog
GoIQueryParamDialog dialog = new GoIQueryParamDialog(this.main);
options = dialog.open(options);
//Return if Cancel was pressed
if ( !options.isCancel() )
{
options.setCancel(true);
}
else
{
return;
}
//Get Selected Nodes in graph
sourceNodes = getSelectedNodes();
}
//if action is called from TopMenuBar
else
{
//open dialog
GoIQueryParamWithEntitiesDialog dialog =
new GoIQueryParamWithEntitiesDialog(main);
options = dialog.open(options);
if ( !options.isCancel() )
{
options.setCancel(true);
}
else
{
return;
}
//Get added entities to the list
ArrayList<EntityHolder> addedEntities = dialog.getAddedEntities();
//Get the states of added entities.
Set<Node> sourceSet =
main.getRootGraph().getRelatedStates(addedEntities);