org.tigris.gef.graph
Interface GraphPortHooks

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
NetPort, PortData, PortPower, SamplePort, SamplePort2

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 deleteFromModel()
           
 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

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

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


postDisconnect

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

void addPropertyChangeListener(java.beans.PropertyChangeListener l)

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener l)

setHighlight

void setHighlight(boolean b)

deleteFromModel

void deleteFromModel()