org.tigris.gef.demo
Class SamplePort2

java.lang.Object
  extended by org.tigris.gef.graph.presentation.NetPrimitive
      extended by org.tigris.gef.graph.presentation.NetPort
          extended by org.tigris.gef.demo.SamplePort
              extended by org.tigris.gef.demo.SamplePort2
All Implemented Interfaces:
java.io.Serializable, GraphPortHooks

public class SamplePort2
extends SamplePort
implements java.io.Serializable

An example subclass of NetPort for the BasicApplication application.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tigris.gef.graph.presentation.NetPort
DEFAULT_EDGE_CLASS
 
Fields inherited from class org.tigris.gef.graph.presentation.NetPrimitive
_changeSup, _highlight
 
Constructor Summary
SamplePort2(NetNode parent)
          Construct a new SamplePort2 as a port of the given NetNode.
 
Method Summary
 boolean canConnectTo(GraphModel gm, java.lang.Object anotherPort)
          Add the constraint that SamplePort2's can only be connected to other ports of the same type.
protected  java.lang.Class defaultEdgeClass(NetPort otherPort)
          reply the java Class to be used to make new arcs.
 
Methods inherited from class org.tigris.gef.graph.presentation.NetPort
addEdge, deleteFromModel, getEdges, getId, getParent, getParentEdge, getParentNode, makeEdgeFor, postConnect, postDisconnect, removeEdge
 
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
 

Constructor Detail

SamplePort2

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

Method Detail

defaultEdgeClass

protected java.lang.Class defaultEdgeClass(NetPort otherPort)
Description copied from class: NetPort
reply the java Class to be used to make new arcs. This is a utility function called from NetPort#makeEdgeFor

Overrides:
defaultEdgeClass in class SamplePort

canConnectTo

public boolean canConnectTo(GraphModel gm,
                            java.lang.Object anotherPort)
Add the constraint that SamplePort2's can only be connected to other ports of the same type.

Specified by:
canConnectTo in interface GraphPortHooks
Overrides:
canConnectTo in class SamplePort