|
||||||||||
| 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
public abstract class 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 Form| Field Summary | |
|---|---|
protected java.util.Vector |
_edges
|
protected java.util.Vector |
_nodes
|
static java.lang.String |
UNLABELED
|
| 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.List |
getEdges()
Return all nodes in the graph |
java.util.Vector |
getEdgesLabeled(java.lang.Object label)
|
java.util.List |
getInEdges(java.lang.Object port)
Return all edges going to given port |
java.util.List |
getNodes()
Return all nodes in the graph |
java.util.List |
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.List |
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.tigris.gef.graph.MutableGraphModel |
|---|
addNodeRelatedEdges, connect |
| 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.List getNodes()
GraphModel
getNodes in interface GraphModelpublic java.util.List getEdges()
GraphModel
getEdges in interface GraphModelpublic abstract java.util.List getPorts(java.lang.Object nodeOrEdge)
GraphModel
getPorts in interface GraphModelpublic abstract java.lang.Object getOwner(java.lang.Object port)
BaseGraphModel
getOwner in interface BaseGraphModelpublic java.lang.Object getSourcePort(java.lang.Object edge)
BaseGraphModel
getSourcePort in interface BaseGraphModelpublic java.lang.Object getDestPort(java.lang.Object edge)
BaseGraphModel
getDestPort in interface BaseGraphModelpublic java.util.List getInEdges(java.lang.Object port)
GraphModel
getInEdges in interface GraphModelpublic java.util.List getOutEdges(java.lang.Object port)
GraphModel
getOutEdges in interface GraphModelpublic boolean canAddNode(java.lang.Object node)
MutableGraphModel
canAddNode in interface MutableGraphModelpublic boolean canAddEdge(java.lang.Object edge)
MutableGraphModel
canAddEdge in interface MutableGraphModelpublic void addNode(java.lang.Object node)
MutableGraphSupport
addNode in interface MutableGraphModeladdNode in class MutableGraphSupportpublic void addEdge(java.lang.Object edge)
MutableGraphSupport
addEdge in interface MutableGraphModeladdEdge in class MutableGraphSupportpublic void removeNode(java.lang.Object node)
MutableGraphModel
removeNode in interface MutableGraphModelremoveNode in class MutableGraphSupportpublic void removeEdge(java.lang.Object edge)
MutableGraphSupport
removeEdge in interface MutableGraphModelremoveEdge in class MutableGraphSupport
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 MutableGraphModelpublic 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 | |||||||||