|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.graph.presentation.NetPrimitive
org.tigris.gef.graph.presentation.NetPort
This class models a port in our underlying connected graph model. A port is place on a node where an edge can connect. For example, the power socket in a wall, ot the power cord socket on the back of a computer. This class is used by the DefaultGraphModel. You can also define your own GraphModel that uses your own application-specific objects as ports.
Field Summary | |
protected java.util.Vector |
_edges
The NetEdges that are connected to this port. |
protected java.lang.Object |
_parent
The NetNode that this port is a part of. |
static java.lang.String |
DEFAULT_EDGE_CLASS
|
Fields inherited from class org.tigris.gef.graph.presentation.NetPrimitive |
_changeSup, _highlight |
Constructor Summary | |
NetPort(java.lang.Object parent)
Construct a new NetPort with the given parent node and no arcs. |
Method Summary | |
void |
addEdge(NetEdge edge)
Add an edge to the list of edge connected to this port. |
boolean |
canConnectTo(GraphModel gm,
java.lang.Object anotherPort)
Reply true if this port can legally be connected to the given port. |
protected java.lang.Class |
defaultEdgeClass(NetPort otherPort)
reply the java Class to be used to make new arcs. |
void |
dispose()
Remove this port from the underlying connected graph model and dispose all arcs connected to it. |
java.util.Vector |
getEdges()
Reply a vector of NetEdges that are connected here. |
java.lang.String |
getId()
|
java.lang.Object |
getParent()
|
NetEdge |
getParentEdge()
|
NetNode |
getParentNode()
Reply the NetNode that owns this port. |
NetEdge |
makeEdgeFor(NetPort otherPort)
reply a new NetEdge from this port to the given NetPort. |
void |
postConnect(GraphModel gm,
java.lang.Object otherPort)
Application specific hook that is called after a successful connection. |
void |
postDisconnect(GraphModel gm,
java.lang.Object otherPort)
Application specific hook that is called after a disconnection. |
void |
removeEdge(NetEdge edge)
Remove an edge from the list of edge connected to this port. |
Methods inherited from class org.tigris.gef.graph.presentation.NetPrimitive |
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getHighlight, removePropertyChangeListener, setHighlight |
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.GraphPortHooks |
addPropertyChangeListener, removePropertyChangeListener, setHighlight |
Field Detail |
public static java.lang.String DEFAULT_EDGE_CLASS
protected java.util.Vector _edges
protected java.lang.Object _parent
Constructor Detail |
public NetPort(java.lang.Object parent)
Method Detail |
public java.lang.String getId()
getId
in class NetPrimitive
public NetNode getParentNode()
public NetEdge getParentEdge()
public java.lang.Object getParent()
public java.util.Vector getEdges()
public void addEdge(NetEdge edge)
public void removeEdge(NetEdge edge)
public void dispose()
dispose
in interface GraphPortHooks
public void postConnect(GraphModel gm, java.lang.Object otherPort)
postConnect
in interface GraphPortHooks
public void postDisconnect(GraphModel gm, java.lang.Object otherPort)
postDisconnect
in interface GraphPortHooks
protected java.lang.Class defaultEdgeClass(NetPort otherPort)
public NetEdge makeEdgeFor(NetPort otherPort)
public boolean canConnectTo(GraphModel gm, java.lang.Object anotherPort)
canConnectTo
in interface GraphPortHooks
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |