org.tigris.gef.demo
Class PortData

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.PortData
All Implemented Interfaces:
java.io.Serializable, GraphPortHooks

public class PortData
extends NetPort
implements java.io.Serializable

An example subclass of NetPort for the EquipmentApplet demo. As part of the example I constrain the ports to only connect to PortDatas.

See Also:
EquipmentApplet, 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
PortData(NetNode parent)
          Construct a new NetPort with the given parent node and no arcs.
 
Method Summary
 boolean canConnectTo(GraphModel gm, NetPort otherPort)
          Add the constraint that PortData's can only be connected to other ports of the same type.
protected  java.lang.Class defaultEdgeClass(NetPort otherPort)
          If the user starts draggin on this port, he will create a new EdgeData.
 
Methods inherited from class org.tigris.gef.graph.presentation.NetPort
addEdge, canConnectTo, 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

PortData

public PortData(NetNode parent)
Construct a new NetPort with the given parent node and no arcs.

Method Detail

canConnectTo

public boolean canConnectTo(GraphModel gm,
                            NetPort otherPort)
Add the constraint that PortData's can only be connected to other ports of the same type.


defaultEdgeClass

protected java.lang.Class defaultEdgeClass(NetPort otherPort)
If the user starts draggin on this port, he will create a new EdgeData.

Overrides:
defaultEdgeClass in class NetPort