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, NetworkViewChangedListener, NetworkViewDestroyedListener, PreferencesUpdatedListener, PropertyUpdatedListener, RemovedEdgesListener, RemovedNodesListener, RenderingEngineAddedListener, RowsCreatedListener, RowsSetListener, SelectedVisualStyleSwitchedListener, SessionAboutToBeSavedListener, SessionLoadedListener, SessionSavedListener, SetCurrentNetworkListener, SetCurrentNetworkViewListener, SetCurrentRenderingEngineListener, SetNetworkPointerListener, SetSelectedNetworksListener, SetSelectedNetworkViewsListener, TableAboutToBeDeletedListener, TableAddedListener, TableDeletedListener, UnsetNetworkPointerListener, UpdateNetworkPresentationListener, VisualStyleAboutToBeRemovedListener, VisualStyleAddedListener, 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.
Copyright 2011 Cytoscape Consortium. All rights reserved.