org.tigris.gef.graph
Interface GraphPortHooks

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
NetPort

public interface GraphPortHooks
extends java.io.Serializable

A set of methods that ports in a GraphModel may implement. If the objects you use to represent ports implement this interface, they will get the appropriate calls. NetPort implements these.

See Also:
NetPort

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 boolean canConnectTo(GraphModel gm, java.lang.Object anotherPort)
          Reply true if this port can legally be connected to the given port.
 void dispose()
           
 void postConnect(GraphModel gm, java.lang.Object edge)
          Application specific hook that is called after a successful connection.
 void postDisconnect(GraphModel gm, java.lang.Object edge)
          Application specific hook that is called after a disconnection.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void setHighlight(boolean b)
           
 

Method Detail

canConnectTo

public boolean canConnectTo(GraphModel gm,
                            java.lang.Object anotherPort)
Reply true if this port can legally be connected to the given port. Subclasses may implement this to reflect application specific connection constraints. By default, each port just defers that decision to its parent NetNode. By convention, your implementation should return false if super.canConnectTo() would return false (i.e., deeper subclasses get more constrained). I don't know if that is a good convention.


postConnect

public void postConnect(GraphModel gm,
                        java.lang.Object edge)
Application specific hook that is called after a successful connection.


postDisconnect

public void postDisconnect(GraphModel gm,
                           java.lang.Object edge)
Application specific hook that is called after a disconnection. (for now, all disconnections are assumed legal).


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

setHighlight

public void setHighlight(boolean b)

dispose

public void dispose()