use of org.cytoscape.event.CyEvent in project cytoscape-impl by cytoscape.
the class CyApplicationManagerImpl method handleEvent.
@Override
public void handleEvent(final NetworkAboutToBeDestroyedEvent event) {
final CyNetwork toBeDestroyed = event.getNetwork();
final List<CyEvent<?>> eventsToFire = new ArrayList<>();
synchronized (lock) {
logger.debug("NetworkAboutToBeDestroyedEvent: " + toBeDestroyed + ". Current: " + currentNetwork);
if (toBeDestroyed.equals(currentNetwork)) {
internalSetCurrentNetwork(null, eventsToFire);
}
}
fireEvents(eventsToFire);
}
use of org.cytoscape.event.CyEvent in project cytoscape-impl by cytoscape.
the class CyApplicationManagerImpl method handleEvent.
@Override
public void handleEvent(final NetworkViewAboutToBeDestroyedEvent event) {
final CyNetworkView toBeDestroyed = event.getNetworkView();
final List<CyEvent<?>> eventsToFire = new ArrayList<>();
synchronized (lock) {
logger.debug("NetworkViewAboutToBeDestroyedEvent: " + toBeDestroyed + ". Current: " + currentNetworkView);
if (toBeDestroyed.equals(currentNetworkView)) {
internalSetCurrentNetworkView(null, eventsToFire);
}
// TODO: Do we need to fire an event? Most listeners that care
// would just listen for NetworkViewAboutToBeDestroyedEvent.
selectedNetworkViews.removeAll(Collections.singletonList(toBeDestroyed));
}
fireEvents(eventsToFire);
}
Aggregations