|
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenixst.plexus.util.ForwardingGraphListener
public class ForwardingGraphListener
A GraphListener which forwards events 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 Summary | |
|---|---|
ForwardingGraphListener(ObservableGraphDelegate observableDelegate)
|
|
| Method Summary | |
|---|---|
protected boolean |
checkDelegate(GraphEvent event)
Returns true only if the Reference has not been
cleared and the delegate currently has listeners. |
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. |
protected void |
fireEdgeAdded(Graph.Edge edge)
|
protected void |
fireEdgeRemoved(Graph.Edge edge)
|
protected void |
fireNodeAdded(Object node)
|
protected void |
fireNodeRemoved(Object node)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ForwardingGraphListener(ObservableGraphDelegate observableDelegate)
| Method Detail |
|---|
protected final boolean checkDelegate(GraphEvent event)
true only if the Reference has not been
cleared and the delegate currently has listeners. If
the Reference has been cleared, then this listener is removed
as a listener from the source of the event before returning
false. This method should be called by any
public method of this class prior to performing any actual
work.
protected final void fireNodeAdded(Object node)
protected final void fireNodeRemoved(Object node)
protected final void fireEdgeAdded(Graph.Edge edge)
protected final void fireEdgeRemoved(Graph.Edge edge)
public void nodeAdded(GraphEvent event)
GraphListenerGraph.
nodeAdded in interface GraphListenerpublic void nodeRemoved(GraphEvent event)
GraphListenerGraph.
nodeRemoved in interface GraphListenerpublic void edgeAdded(GraphEvent event)
GraphListenerGraph.
edgeAdded in interface GraphListenerpublic void edgeRemoved(GraphEvent event)
GraphListenerGraph.
edgeRemoved in interface GraphListener
|
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||