Interface CyListener

All Known Subinterfaces:
AboutToRemoveColumnViewListener, AboutToRemoveEdgesListener, AboutToRemoveEdgeViewsListener, AboutToRemoveNodesListener, AboutToRemoveNodeViewsListener, AboutToRemoveRowViewsListener, AddedColumnViewListener, AddedEdgesListener, AddedEdgeViewsListener, AddedNodesListener, AddedNodeViewsListener, AddedRowViewsListener, AppsFinishedStartingListener, ColumnAssociatedVisualStyleSetListener, ColumnCreatedListener, ColumnDeletedListener, ColumnNameChangedListener, ColumnVisualStyleSetListener, CyShutdownListener, CyShutdownRequestedListener, CyStartListener, CytoPanelComponentSelectedListener, CytoPanelStateChangedListener, EquationFunctionAddedListener, EquationFunctionRemovedListener, FitContentListener, FitSelectedListener, GroupAboutToBeDestroyedListener, GroupAboutToBeRemovedListener, GroupAboutToCollapseListener, GroupAddedListener, GroupAddedToNetworkListener, GroupCollapsedListener, GroupEdgesAddedListener, GroupEdgesRemovedListener, GroupNodesAddedListener, GroupNodesRemovedListener, NetworkAboutToBeDestroyedListener, NetworkAddedListener, NetworkDestroyedListener, NetworkViewAboutToBeDestroyedListener, NetworkViewAddedListener, NetworkViewDestroyedListener, PreferencesUpdatedListener, PropertyUpdatedListener, RemovedEdgesListener, RemovedNodesListener, RenderingEngineAddedListener, RowsCreatedListener, RowsDeletedListener, RowsSetListener, SelectedNodesAndEdgesListener, SessionAboutToBeLoadedListener, SessionAboutToBeSavedListener, SessionLoadCancelledListener, SessionLoadedListener, SessionSaveCancelledListener, SessionSavedListener, SetCurrentNetworkListener, SetCurrentNetworkViewListener, SetCurrentRenderingEngineListener, SetCurrentTableListener, SetCurrentVisualStyleListener, SetNetworkPointerListener, SetSelectedNetworksListener, SetSelectedNetworkViewsListener, TableAboutToBeDeletedListener, TableAddedListener, TableDeletedListener, TablePrivacyChangedListener, TableTitleChangedListener, TableViewAboutToBeDestroyedListener, TableViewAddedListener, TableViewChangedListener, TableViewDestroyedListener, UnsetNetworkPointerListener, UpdateNetworkPresentationListener, ViewChangedListener, VisualMappingFunctionChangedListener, VisualPropertyDependencyChangedListener, VisualStyleAboutToBeRemovedListener, VisualStyleAddedListener, VisualStyleChangedListener, VisualStyleSetListener
All Known Implementing Classes:
AbstractViewUpdater

public interface CyListener
The basic interface that any class interested in a particular type of event should implement.

Any class implementing this interface must implement the method:

public void handleEvent(ZZZ e);

where ZZZ extends CyEvent.

Unfortunately, we can't parameterize this because Java doesn't verify generic types, meaning a class could only implement ONE instance of this interface, something that doesn't work for us. And so we leave it to convention.

Instead of the customary strategy of registering events with the objects that fire the events, listeners should register themselves as services with the OSGi ServiceRegistry. The event producers will simply query the ServiceRegistry to search for Listeners for the type of events they fire.

It would be fantastic if we could specify one listener interface that differentiated itself by a parameterized type, but that doesn't appear possible with Java. That means users are either must register as different listeners or handle different event types in the handleEvent method.


Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.

Module: event-api

To use this in your app, include the following dependency in your POM:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>event-api</artifactId>
</dependency>