Cytoscape 3.0.1 API

org.cytoscape.event
Interface CyListener

All Known Subinterfaces:
AboutToRemoveEdgesListener, AboutToRemoveEdgeViewsListener, AboutToRemoveNodesListener, AboutToRemoveNodeViewsListener, AddedEdgesListener, AddedEdgeViewsListener, AddedNodesListener, AddedNodeViewsListener, ColumnCreatedListener, ColumnDeletedListener, ColumnNameChangedListener, CyShutdownListener, CyStartListener, CytoPanelComponentSelectedListener, CytoPanelStateChangedListener, FitContentListener, FitSelectedListener, GroupAboutToBeDestroyedListener, GroupAboutToBeRemovedListener, GroupAboutToCollapseListener, GroupAddedListener, GroupAddedToNetworkListener, GroupCollapsedListener, GroupEdgesAddedListener, GroupEdgesRemovedListener, GroupNodesAddedListener, GroupNodesRemovedListener, NetworkAboutToBeDestroyedListener, NetworkAddedListener, NetworkDestroyedListener, NetworkViewAboutToBeDestroyedListener, NetworkViewAddedListener, NetworkViewDestroyedListener, PreferencesUpdatedListener, PropertyUpdatedListener, RemovedEdgesListener, RemovedNodesListener, RenderingEngineAddedListener, RowsCreatedListener, RowsSetListener, SessionAboutToBeSavedListener, SessionLoadedListener, SessionSavedListener, SetCurrentNetworkListener, SetCurrentNetworkViewListener, SetCurrentRenderingEngineListener, SetCurrentVisualStyleListener, SetNetworkPointerListener, SetSelectedNetworksListener, SetSelectedNetworkViewsListener, TableAboutToBeDeletedListener, TableAddedListener, TableDeletedListener, TablePrivacyChangedListener, TableTitleChangedListener, UnsetNetworkPointerListener, UpdateNetworkPresentationListener, VisualMappingFunctionChangedListener, 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.


Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.