|
||||||||||
| 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.DefaultGraphModel
public class DefaultGraphModel
This interface provides a facade to a net-level representation. Similiar in concept to the Swing class TreeModel. This implementation of GraphModel uses the GEF classes NetList, NetNode, NetPort, and NetEdge. If you implement your own GraphModel, you can use your own application-specific classes.
NetList,
NetNode,
NetPort,
NetEdge,
AdjacencyListGraphModel,
Serialized Form| Constructor Summary | |
|---|---|
DefaultGraphModel()
|
|
DefaultGraphModel(ConnectionConstrainer cc)
|
|
DefaultGraphModel(NetList nl)
|
|
| Method Summary | |
|---|---|
void |
addEdge(java.lang.Object edge)
Add the given edge to the graph, if valid. |
void |
addNode(java.lang.Object node)
Add the given node to the graph, if valid. |
void |
addNodeRelatedEdges(java.lang.Object node)
Add existing edges that are related to the node. |
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 |
canChangeConnectedNode(java.lang.Object newNode,
java.lang.Object oldNode,
java.lang.Object edge)
Return true if the connection to the old node can be rerouted to the new node. |
boolean |
canConnect(java.lang.Object srcPort,
java.lang.Object destPort)
Return true if the two given ports can be connected by a kind of edge to be determined by the ports. |
boolean |
canDragNode(java.lang.Object node)
Return true if dragging the given object is a valid in this graph |
void |
changeConnectedNode(java.lang.Object newNode,
java.lang.Object oldNode,
java.lang.Object edge,
boolean isSource)
Reroutes the connection to the old node to be connected to the new node. |
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 |
connect(java.lang.Object srcPort,
java.lang.Object destPort,
java.lang.Class edgeClass)
Contruct and add a new edge of the given kind |
java.lang.Object |
connect(java.lang.Object srcPort,
java.lang.Object destPort,
java.lang.Object edgeType)
Contruct and add a new edge of the given kind The default is to assume the edge type is a Class. |
protected java.lang.Object |
connectInternal(NetPort s,
NetPort d,
NetEdge e)
Asks the given edge to attempt to connect itself to the given ports. |
java.lang.Object |
createNode(java.lang.String name,
java.util.Hashtable args)
Return a valid node in this graph |
void |
dragNode(java.lang.Object node)
Create a new node based on the given one and add it to the graph. |
java.lang.Object |
getDestPort(java.lang.Object edge)
Return the other end of an edge |
java.util.List |
getEdges()
Return all edges in the graph |
java.util.Collection |
getEdges(java.util.Collection c)
Return all nodes in the graph |
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.Collection |
getNodes(java.util.Collection c)
Return all nodes in the graph |
java.util.List |
getOutEdges(java.lang.Object port)
Return all edges going from given port |
java.lang.Object |
getOwner(java.lang.Object port)
Return the node or edge that owns the given port |
java.util.Collection |
getPorts(java.util.Collection c,
java.lang.Object nodeOrEdge)
Return all ports on node or edge |
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 |
void |
removeAll()
Remove all nodes and edges to reset the graph. |
void |
removeAllEdges()
Remove all the edges from the graph. |
void |
removeAllNodes()
Remove all the nodes from the graph. |
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, canConnect, canConnect, connect, containsEdge, containsEdgePort, containsNode, containsNodePort, containsPort, fireEdgeAdded, fireEdgeRemoved, fireGraphChanged, fireNodeAdded, fireNodeRemoved, getConnectionConstrainer, getGraphListeners, isEnclosable, removeFig, removeGraphEventListener, setConnectionConstrainer, setSaveAction |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultGraphModel()
public DefaultGraphModel(ConnectionConstrainer cc)
public DefaultGraphModel(NetList nl)
| Method Detail |
|---|
public java.util.List getNodes()
getNodes in interface GraphModelpublic java.util.List getEdges()
getEdges in interface GraphModelpublic java.util.List getPorts(java.lang.Object nodeOrEdge)
getPorts in interface GraphModelpublic java.util.Collection getNodes(java.util.Collection c)
public java.util.Collection getEdges(java.util.Collection c)
public java.util.Collection getPorts(java.util.Collection c,
java.lang.Object nodeOrEdge)
public java.lang.Object getOwner(java.lang.Object port)
getOwner in interface BaseGraphModelpublic java.util.List getInEdges(java.lang.Object port)
getInEdges in interface GraphModelpublic java.util.List getOutEdges(java.lang.Object port)
getOutEdges in interface GraphModelpublic java.lang.Object getSourcePort(java.lang.Object edge)
getSourcePort in interface BaseGraphModelpublic java.lang.Object getDestPort(java.lang.Object edge)
getDestPort in interface BaseGraphModel
public java.lang.Object createNode(java.lang.String name,
java.util.Hashtable args)
createNode in interface MutableGraphModelcreateNode in class MutableGraphSupportpublic boolean canAddNode(java.lang.Object node)
canAddNode in interface MutableGraphModelpublic boolean canAddEdge(java.lang.Object edge)
canAddEdge in interface MutableGraphModelpublic void removeNode(java.lang.Object node)
removeNode in interface MutableGraphModelremoveNode in class MutableGraphSupportpublic boolean canDragNode(java.lang.Object node)
canDragNode in interface MutableGraphModelcanDragNode in class MutableGraphSupportpublic void addNode(java.lang.Object node)
addNode in interface MutableGraphModeladdNode in class MutableGraphSupportpublic void addEdge(java.lang.Object edge)
addEdge in interface MutableGraphModeladdEdge in class MutableGraphSupportpublic void addNodeRelatedEdges(java.lang.Object node)
MutableGraphModel
addNodeRelatedEdges in interface MutableGraphModelpublic void removeEdge(java.lang.Object edge)
removeEdge in interface MutableGraphModelremoveEdge in class MutableGraphSupportpublic void removeAllNodes()
removeAllNodes in class MutableGraphSupportpublic void removeAllEdges()
removeAllEdges in class MutableGraphSupportpublic void removeAll()
removeAll in class MutableGraphSupportpublic void dragNode(java.lang.Object node)
MutableGraphSupport
dragNode in interface MutableGraphModeldragNode in class MutableGraphSupport
public boolean canConnect(java.lang.Object srcPort,
java.lang.Object destPort)
canConnect in interface MutableGraphModel
public java.lang.Object connect(java.lang.Object srcPort,
java.lang.Object destPort)
connect in interface MutableGraphModel
public java.lang.Object connect(java.lang.Object srcPort,
java.lang.Object destPort,
java.lang.Object edgeType)
connect in interface MutableGraphModelconnect in class MutableGraphSupport
public java.lang.Object connect(java.lang.Object srcPort,
java.lang.Object destPort,
java.lang.Class edgeClass)
connect in interface MutableGraphModel
protected java.lang.Object connectInternal(NetPort s,
NetPort d,
NetEdge e)
s - source portd - destination porte - edge
public boolean canChangeConnectedNode(java.lang.Object newNode,
java.lang.Object oldNode,
java.lang.Object edge)
canChangeConnectedNode in interface MutableGraphModelcanChangeConnectedNode in class MutableGraphSupport
public void changeConnectedNode(java.lang.Object newNode,
java.lang.Object oldNode,
java.lang.Object edge,
boolean isSource)
changeConnectedNode in interface MutableGraphModelchangeConnectedNode in class MutableGraphSupport
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||