public class FilteredGraphListener extends ForwardingGraphListener
GraphListener
which filters events to be forwarded
to an ObservableGraphDelegate
. Instances of this class
only keep a WeakReference
to their delegates. If
that Reference has been cleared when an event is received, this
listener will remove itself as a listener of the
Graph
which sent the event. Because of this, it is
necessary for the Graph
which is using this listener
to maintain a strong reference to the
ObservableGraphDelegate
.Constructor and Description |
---|
FilteredGraphListener(org.apache.commons.collections.Predicate nodePredicate,
org.apache.commons.collections.Predicate edgePredicate,
ObservableGraphDelegate observableDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
edgeAdded(GraphEvent event)
Invoked when an edge has been added to the
Graph . |
void |
edgeRemoved(GraphEvent event)
Invoked when an edge has been removed from the
Graph . |
void |
nodeAdded(GraphEvent event)
Invoked when a node has been added to the
Graph . |
void |
nodeRemoved(GraphEvent event)
Invoked when a node has been removed from the
Graph . |
checkDelegate, fireEdgeAdded, fireEdgeRemoved, fireNodeAdded, fireNodeRemoved
public FilteredGraphListener(org.apache.commons.collections.Predicate nodePredicate, org.apache.commons.collections.Predicate edgePredicate, ObservableGraphDelegate observableDelegate)
public void nodeAdded(GraphEvent event)
GraphListener
Graph
.nodeAdded
in interface GraphListener
nodeAdded
in class ForwardingGraphListener
public void nodeRemoved(GraphEvent event)
GraphListener
Graph
.nodeRemoved
in interface GraphListener
nodeRemoved
in class ForwardingGraphListener
public void edgeAdded(GraphEvent event)
GraphListener
Graph
.edgeAdded
in interface GraphListener
edgeAdded
in class ForwardingGraphListener
public void edgeRemoved(GraphEvent event)
GraphListener
Graph
.edgeRemoved
in interface GraphListener
edgeRemoved
in class ForwardingGraphListener
See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.