//if action is called from PopupMenu
if (useSelection)
{
//open dialog
CommonStreamQueryParamDialog dialog =
new CommonStreamQueryParamDialog(this.main);
options = dialog.open(options);
//Return if Cancel was pressed
if ( !options.isCancel() )
{
options.setCancel(true);
}
else
{
return;
}
//Get Selected Nodes in graph
sourceNodesSet = getSelectedNodes();
//Common Stream Query
stream = new LocalCommonStreamQuery(sourceNodesSet,
options.isDownstream(),
options.getLengthLimit());
}
//if action is called from TopMenuBar
else
{
//open dialog
CommonStreamQueryParamWithEntitiesDialog dialog =
new CommonStreamQueryParamWithEntitiesDialog(main);
options = dialog.open(options);
if ( !options.isCancel() )
{
options.setCancel(true);
}
else
{
return;
}
//Get added entities from dialog
ArrayList<EntityHolder> addedEntities = dialog.getAddedEntities();
//States of each entity
Set<Set<Node>> sourceStatesSet = new LinkedHashSet<Set<Node>>();
//for each entity