|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A graph model is an abstraction of a graph implementation and a registration point for GraphListeners. A graph model contains a root graph which in turn contains nodes, composite nodes (i.e. nodes that contain other nodes), and edges between nodes.
A graph model provides read-only access to a graph. The getRoot() method provides access to the root of a (possibly hierarchically nested) graph. Given that object, nodes() returns an iterator over that graphs contents, and inEdges() and outEdges() can be used to traverse edges. get/setVisited() are utility functions to help with graph traversals.
For read-write access to the graph, use the sub-interface MutableGraphModel.
| Method Summary | |
void |
addGraphListener(GraphListener l)
Add a graph listener to the model. |
boolean |
containsNode(java.lang.Object composite,
java.lang.Object node)
Return true if this graph or composite node contains the given node. |
void |
dispatchGraphEvent(GraphEvent e)
Send an graph event to all of the graph listeners. |
java.lang.Object |
getHead(java.lang.Object edge)
Return the head node of the given edge. |
int |
getNodeCount(java.lang.Object composite)
Return the number of nodes contained in this graph or composite node. |
java.lang.Object |
getParent(java.lang.Object node)
Return the parent graph of this node, return null if there is no parent. |
java.lang.Object |
getProperty(java.lang.Object o,
java.lang.String propertyName)
Return the property of the object associated with the given property name. |
java.lang.Object |
getRoot()
Return the root graph of this graph model. |
java.lang.Object |
getSemanticObject(java.lang.Object o)
Return the visual object corresponding to the given node, composite, or edge. |
java.lang.Object |
getTail(java.lang.Object edge)
Return the tail node of this edge. |
java.util.Iterator |
inEdges(java.lang.Object node)
Return an iterator over the in edges of this node. |
boolean |
isComposite(java.lang.Object o)
Return true if the given object is a composite node, i.e. it can contain children. |
boolean |
isDirected(java.lang.Object edge)
Return whether or not this edge is directed. |
boolean |
isEdge(java.lang.Object o)
Return true if the given object is an edge in this model. |
boolean |
isNode(java.lang.Object o)
Return true if the given object is a node in this model. |
java.util.Iterator |
nodes(java.lang.Object composite)
Provide an iterator over the nodes in the given graph or composite node. |
java.util.Iterator |
nodesAfterEdges(java.lang.Object composite)
Provide an iterator over the nodes that should be rendered after to the edges. |
java.util.Iterator |
nodesBeforeEdges(java.lang.Object composite)
Provide an iterator over the nodes that should be rendered prior to the edges. |
java.util.Iterator |
outEdges(java.lang.Object node)
Return an iterator over the out edges of this node. |
void |
removeGraphListener(GraphListener l)
Remove a graph listener from the model so that the listener will no longer be notified of changes to the graph. |
void |
setDispatchEnabled(boolean val)
Turn on/off all event dispatches from this graph model, for use in an inner-loop algorithm. |
void |
setProperty(java.lang.Object o,
java.lang.String propertyName,
java.lang.Object value)
Set the property of the object associated with the given property name. |
void |
setSemanticObject(java.lang.Object o,
java.lang.Object visual)
Set the semantic object corresponding to the given node, composite, or edge. |
| Method Detail |
public void addGraphListener(GraphListener l)
public boolean containsNode(java.lang.Object composite, java.lang.Object node)
public void dispatchGraphEvent(GraphEvent e)
setDispatchEnabled(boolean)public java.lang.Object getRoot()
public java.lang.Object getHead(java.lang.Object edge)
public int getNodeCount(java.lang.Object composite)
public java.lang.Object getParent(java.lang.Object node)
public java.lang.Object getTail(java.lang.Object edge)
public java.lang.Object getProperty(java.lang.Object o, java.lang.String propertyName)
public java.lang.Object getSemanticObject(java.lang.Object o)
public boolean isComposite(java.lang.Object o)
public boolean isDirected(java.lang.Object edge)
public boolean isEdge(java.lang.Object o)
public boolean isNode(java.lang.Object o)
public java.util.Iterator nodes(java.lang.Object composite)
public java.util.Iterator nodesBeforeEdges(java.lang.Object composite)
public java.util.Iterator nodesAfterEdges(java.lang.Object composite)
public java.util.Iterator inEdges(java.lang.Object node)
public java.util.Iterator outEdges(java.lang.Object node)
public void removeGraphListener(GraphListener l)
public void setDispatchEnabled(boolean val)
dispatchGraphEvent(GraphEvent)public void setProperty(java.lang.Object o, java.lang.String propertyName, java.lang.Object value)
public void setSemanticObject(java.lang.Object o, java.lang.Object visual)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||