|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbeowulf.model.graph.AbstractGraphModel
This abstract class defines event handling procedures common to all of its
implementors. This is simply another level of abstraction, and allows
another class to provide all of the implementation details on the actual
operation of the graph. Certain rules must be followed by its subclasses to
ensure that events are delivered to the approrpriate listeners. These rules
are largely limited to calling the appropriate fireXXXX method after the
occurrance of a certain GraphEvent.
| Field Summary | |
protected EventListenerList |
listenerList
This list contains references to all interested listeners. |
| Constructor Summary | |
AbstractGraphModel()
|
|
| Method Summary | |
abstract void |
addEdge(Edge edge)
This method will add a new edge to the graph. |
abstract void |
addEdge(Object sourceValue,
Object destinationValue,
Object cost)
This method will add a new edge to the graph. |
void |
addGraphListener(GraphListener l)
This method adds a GraphListener as an interested listener of events to this Graph. |
abstract void |
addNode(Object value)
This method adds a new node to the graph, and associates the parameter as the value of the node. |
protected void |
fireEdgeAdded(Object source,
Object value)
This method must be called by all subclasses after a edge is added to the Graph. |
protected void |
fireEdgeRemoved(Object source,
Object value)
This method must be called by all subclasses after a edge is removed from the Graph. |
protected void |
fireNodeAdded(Object source,
Object value)
This method must be called by all subclasses after a node is added to the Graph. |
protected void |
fireNodeRemoved(Object source,
Object value)
This method must be called by all subclasses after a node is removed from the Graph. |
GraphListener[] |
getGraphListeners()
Returns an array of all the graph listeners registered on this AbstractGraphModel. |
EventListener[] |
getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListeners upon this model. |
abstract Object |
removeEdge(Edge toRemove)
This method will remove the edge from the graph. |
abstract Object |
removeEdge(Object sourceValue,
Object destinationValue,
Object cost)
This method will remove the edge with the indicated source and destination values from the graph. |
void |
removeGraphListener(GraphListener l)
This method removes the GraphListener as an interestd listener of events to this Graph. |
abstract void |
removeNode(Object value)
Given a node's value, this method will find and remove that node, and any associated edges from the graph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface beowulf.model.graph.GraphModel |
getEdgeCount, getEdges, getEdgesFrom, getEdgesFromTo, getEdgesTo, getNodeCount, getNodes, getUseDotEquals, isDirected, isSimple, toString |
| Field Detail |
protected transient EventListenerList listenerList
| Constructor Detail |
public AbstractGraphModel()
| Method Detail |
public void addGraphListener(GraphListener l)
addGraphListener in interface GraphModell - The graph listener to add.public void removeGraphListener(GraphListener l)
removeGraphListener in interface GraphModell - The graph listener to remove.
protected void fireNodeAdded(Object source,
Object value)
source - The graph on which the even occurred.value - The value of the node that was added.
protected void fireNodeRemoved(Object source,
Object value)
source - The graph on which the even occurred.value - The value of the node that was removed.
protected void fireEdgeAdded(Object source,
Object value)
source - The graph on which the even occurred.value - The value of the edge that was added.
protected void fireEdgeRemoved(Object source,
Object value)
source - The graph on which the even occurred.value - The value of the edge that was removed.public GraphListener[] getGraphListeners()
AbstractGraphModel.
GraphListeners, or an empty
array if no graph listeners are currently registeredpublic EventListener[] getListeners(Class listenerType)
FooListeners upon this model.
FooListeners are registered using the
addFooListener method.
You can specify the listenerType argument with a class
literal, such as FooListener.class. For example,
you can query a list model m for its list data listeners
with the following code:
GraphListener[] gls = (GraphListener[])(m.getListeners(GraphListener.class));If no such listeners exist, this method returns an empty array.
listenerType - the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListeners on this model, or an empty array if
no such listeners have been added
ClassCastException - if listenerType doesn't
specify a class or interface that implements
java.util.EventListenerpublic abstract void removeNode(Object value)
value - The value of the node to be removed.public abstract void addNode(Object value)
value - The value of the node to be added.public abstract Object removeEdge(Edge toRemove)
toRemove - The edge to be removed.
public abstract Object removeEdge(Object sourceValue,
Object destinationValue,
Object cost)
sourceValue - The value of the source node of the edge.destinationValue - The value of the destination node of the edge.cost - The cost of the edge to be removed.
public abstract void addEdge(Object sourceValue,
Object destinationValue,
Object cost)
sourceValue - The value of the source node of the new edge.destinationValue - The value of the destination node of the new
edge.cost - The cost of the new edge.public abstract void addEdge(Edge edge)
edge - The edge to be added to the graph.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||