|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.graph.MutableGraphSupport
org.tigris.gef.graph.presentation.AdjacencyListGraphModel
This class is an example of an alternative way to implement MutableGraphModel. Needs-more-work: this code has not been used or tested.
DefaultGraphModel
,
Serialized FormField Summary | |
protected java.util.Vector |
_edges
|
protected java.util.Vector |
_nodes
|
static java.lang.String |
UNLABELED
|
Fields inherited from class org.tigris.gef.graph.MutableGraphSupport |
_graphListeners |
Constructor Summary | |
AdjacencyListGraphModel()
|
Method Summary | |
void |
addEdge(java.lang.Object edge)
Add the given edge to the graph, if valid. |
java.lang.Object |
addLabeledEdge(java.lang.Object srcPort,
java.lang.Object destPort,
java.lang.Object label)
|
void |
addNode(java.lang.Object node)
Add the given node to the graph, if valid. |
boolean |
canAddEdge(java.lang.Object edge)
Return true if the given object is a valid edge in this graph |
boolean |
canAddNode(java.lang.Object node)
Return true if the given object is a valid node in this graph |
boolean |
canConnect(java.lang.Object srcNode,
java.lang.Object destNode)
Return true if the two given ports can be connected by a kind of edge to be determined by the ports. |
java.lang.Object |
connect(java.lang.Object srcPort,
java.lang.Object destPort)
Contruct and add a new edge of a kind determined by the ports. |
java.lang.Object |
getDestPort(java.lang.Object edge)
Return the other end of an edge |
java.lang.Object |
getEdgeLabel(java.lang.Object edge)
|
java.util.Vector |
getEdges()
Return all nodes in the graph |
java.util.Vector |
getEdgesLabeled(java.lang.Object label)
|
java.util.Vector |
getInEdges(java.lang.Object port)
Return all edges going to given port |
java.util.Vector |
getNodes()
Return all nodes in the graph |
java.util.Vector |
getOutEdges(java.lang.Object port)
Return all edges going from given port |
abstract java.lang.Object |
getOwner(java.lang.Object port)
Return the node or edge that owns the given port |
abstract java.util.Vector |
getPorts(java.lang.Object nodeOrEdge)
Return all ports on node or edge |
java.lang.Object |
getSourcePort(java.lang.Object edge)
Return one end of an edge |
boolean |
OK()
|
void |
removeEdge(java.lang.Object edge)
Remove the given edge from the graph. |
void |
removeNode(java.lang.Object node)
Remove the given node from the graph. |
Methods inherited from class org.tigris.gef.graph.MutableGraphSupport |
addGraphEventListener, canChangeConnectedNode, canConnect, canDragNode, changeConnectedNode, connect, containsEdge, containsEdgePort, containsNode, containsNodePort, containsPort, createNode, dragNode, fireEdgeAdded, fireEdgeRemoved, fireGraphChanged, fireNodeAdded, fireNodeRemoved, getGraphListeners, removeGraphEventListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.tigris.gef.graph.MutableGraphModel |
addNodeRelatedEdges |
Field Detail |
public static java.lang.String UNLABELED
protected java.util.Vector _nodes
protected java.util.Vector _edges
Constructor Detail |
public AdjacencyListGraphModel()
Method Detail |
public boolean OK()
public java.util.Vector getNodes()
GraphModel
getNodes
in interface GraphModel
public java.util.Vector getEdges()
GraphModel
getEdges
in interface GraphModel
public abstract java.util.Vector getPorts(java.lang.Object nodeOrEdge)
GraphModel
getPorts
in interface GraphModel
public abstract java.lang.Object getOwner(java.lang.Object port)
BaseGraphModel
getOwner
in interface BaseGraphModel
public java.lang.Object getSourcePort(java.lang.Object edge)
BaseGraphModel
getSourcePort
in interface BaseGraphModel
public java.lang.Object getDestPort(java.lang.Object edge)
BaseGraphModel
getDestPort
in interface BaseGraphModel
public java.util.Vector getInEdges(java.lang.Object port)
GraphModel
getInEdges
in interface GraphModel
public java.util.Vector getOutEdges(java.lang.Object port)
GraphModel
getOutEdges
in interface GraphModel
public boolean canAddNode(java.lang.Object node)
MutableGraphModel
canAddNode
in interface MutableGraphModel
public boolean canAddEdge(java.lang.Object edge)
MutableGraphModel
canAddEdge
in interface MutableGraphModel
public void addNode(java.lang.Object node)
MutableGraphModel
addNode
in interface MutableGraphModel
public void addEdge(java.lang.Object edge)
MutableGraphModel
addEdge
in interface MutableGraphModel
public void removeNode(java.lang.Object node)
MutableGraphModel
removeNode
in interface MutableGraphModel
public void removeEdge(java.lang.Object edge)
MutableGraphModel
removeEdge
in interface MutableGraphModel
public boolean canConnect(java.lang.Object srcNode, java.lang.Object destNode)
MutableGraphModel
canConnect
in interface MutableGraphModel
public java.lang.Object connect(java.lang.Object srcPort, java.lang.Object destPort)
MutableGraphModel
connect
in interface MutableGraphModel
public java.lang.Object getEdgeLabel(java.lang.Object edge)
public java.lang.Object addLabeledEdge(java.lang.Object srcPort, java.lang.Object destPort, java.lang.Object label)
public java.util.Vector getEdgesLabeled(java.lang.Object label)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |