uci.gef.demo
Class SamplePort

java.lang.Object
  |
  +--uci.gef.NetPrimitive
        |
        +--uci.gef.NetPort
              |
              +--uci.gef.demo.SamplePort
Direct Known Subclasses:
SamplePort2

public class SamplePort
extends NetPort
implements Serializable

An example subclass of NetPort for the Example application. As part of the example I constrain the ports to only be on SampleNodes and only connect to SamplePorts.

See Also:
BasicApplication, Serialized Form

Fields inherited from class uci.gef.NetPort
_edges, _parent, DEFAULT_EDGE_CLASS
 
Fields inherited from class uci.gef.NetPrimitive
_changeSup, _highlight
 
Constructor Summary
SamplePort(NetNode parent)
          Construct a new SamplePort as a port of the given NetNode.
 
Method Summary
 boolean canConnectTo(GraphModel gm, Object anotherPort)
          Add the constraint that SamplePort's can only be connected to other ports of the same type.
protected  Class defaultEdgeClass(NetPort otherPort)
           
 
Methods inherited from class uci.gef.NetPort
addEdge, dispose, getEdges, getParent, getParentEdge, getParentNode, makeEdgeFor, postConnect, postDisconnect, removeEdge
 
Methods inherited from class uci.gef.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
 

Constructor Detail

SamplePort

public SamplePort(NetNode parent)
Construct a new SamplePort as a port of the given NetNode. This example includes the constraint that SamplePort's can only be part of SampleNode's.
Method Detail

defaultEdgeClass

protected Class defaultEdgeClass(NetPort otherPort)
Overrides:
defaultEdgeClass in class NetPort

canConnectTo

public boolean canConnectTo(GraphModel gm,
                            Object anotherPort)
Add the constraint that SamplePort's can only be connected to other ports of the same type.
Overrides:
canConnectTo in class NetPort