Set<Node> sourceNodes = new HashSet<Node>();
Set<Node> targetNodes = new HashSet<Node>();
//open dialog
PoIQueryParamWithEntitiesDialog dialog = new PoIQueryParamWithEntitiesDialog(main);
options = dialog.open(options);
if ( !options.isCancel() )
{
options.setCancel(true);
}
else
{
return;
}
//Get added source entities.
ArrayList<physicalEntity> sourceAddedEntities =
dialog.getSourceAddedEntities();
//Get the states of added entities.
Set<GraphObject> sourceSet =
main.getRootGraph().getRelatedStates(sourceAddedEntities);
//Replace any complex member with its corresponding complex.
main.getRootGraph().replaceComplexMembersWithComplexes(sourceSet);
for (GraphObject go : sourceSet)
{
if (go instanceof Node)
{
sourceNodes.add((Node) go);
}
}
//Get added target entities.
ArrayList<physicalEntity> targetAddedEntities =
dialog.getTargetAddedEntities();
//Get the states of added entities.
Set<GraphObject> targetSet =
main.getRootGraph().getRelatedStates(targetAddedEntities);