cz.cmc.tcgui
Class TCPort

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.jgraph.graph.DefaultGraphCell
          extended bycz.cmc.tcgui.TCPort
All Implemented Interfaces:
Cloneable, org.jgraph.graph.GraphCell, MutableTreeNode, org.jgraph.graph.Port, Serializable, TreeNode
Direct Known Subclasses:
TCInputPort, TCOutputPort

public abstract class TCPort
extends org.jgraph.graph.DefaultGraphCell
implements org.jgraph.graph.Port

Title: class TCPort

Description:

Copyright: Copyright (c) 2003

Company: CMC Computers

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.jgraph.graph.DefaultGraphCell
org.jgraph.graph.DefaultGraphCell.ValueChangeHandler
 
Field Summary
protected  org.jgraph.graph.Port anchor
          Reference to the anchor of this port
protected  HashSet edges
          Edges that are connected to the port
 
Fields inherited from class org.jgraph.graph.DefaultGraphCell
attributes, defaultBounds
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, EMPTY_ENUMERATION, children, parent, userObject
 
Constructor Summary
TCPort(Object userObject)
          Constructs a vertex that holds a reference to the specified user object.
TCPort(Object userObject, org.jgraph.graph.Port anchor)
          Constructs a vertex that holds a reference to the specified user object and a reference to the specified anchor.
 
Method Summary
 boolean addEdge(Object edge)
          Adds edge to the list of ports.
 Object clone()
          Create a clone of the cell.
 TCPortView createDefaultView(TCGraph g, org.jgraph.graph.CellMapper cm)
          Creates default view object for this TCPort.
 Iterator edges()
          Returns an iterator of the edges connected to the port.
 org.jgraph.graph.Port getAnchor()
          Returns the anchor of this port.
 Set getEdges()
          Returns the anchor of this port.
 boolean removeEdge(Object edge)
          Removes edge from the list of ports.
 void setAnchor(org.jgraph.graph.Port port)
          Sets the anchor of this port.
 void setEdges(Set edges)
          Sets the anchor of this port.
 
Methods inherited from class org.jgraph.graph.DefaultGraphCell
cloneUserObject, getAttributes, getChildren, changeAttributes, setAttributes, setUserObject
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, depthFirstEnumeration, getAllowsChildren, getDepth, getFirstChild, getFirstLeaf, getChildAfter, getChildAt, getChildBefore, getChildCount, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, children, insert, isLeaf, isNodeAncestor, isNodeDescendant, isNodeChild, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jgraph.graph.GraphCell
getAttributes, changeAttributes, setAttributes
 

Field Detail

edges

protected HashSet edges
Edges that are connected to the port


anchor

protected org.jgraph.graph.Port anchor
Reference to the anchor of this port

Constructor Detail

TCPort

public TCPort(Object userObject)
Constructs a vertex that holds a reference to the specified user object.

Parameters:
userObject - reference to the user object

TCPort

public TCPort(Object userObject,
              org.jgraph.graph.Port anchor)
Constructs a vertex that holds a reference to the specified user object and a reference to the specified anchor.

Parameters:
userObject - reference to the user object
Method Detail

edges

public Iterator edges()
Returns an iterator of the edges connected to the port.

Specified by:
edges in interface org.jgraph.graph.Port

addEdge

public boolean addEdge(Object edge)
Adds edge to the list of ports.

Specified by:
addEdge in interface org.jgraph.graph.Port

removeEdge

public boolean removeEdge(Object edge)
Removes edge from the list of ports.

Specified by:
removeEdge in interface org.jgraph.graph.Port

getEdges

public Set getEdges()
Returns the anchor of this port.


setEdges

public void setEdges(Set edges)
Sets the anchor of this port.


getAnchor

public org.jgraph.graph.Port getAnchor()
Returns the anchor of this port.

Specified by:
getAnchor in interface org.jgraph.graph.Port

setAnchor

public void setAnchor(org.jgraph.graph.Port port)
Sets the anchor of this port.

Specified by:
setAnchor in interface org.jgraph.graph.Port

clone

public Object clone()
Create a clone of the cell. The cloning of the user object is deferred to the cloneUserObject() method.

Returns:
Object a clone of this object.

createDefaultView

public TCPortView createDefaultView(TCGraph g,
                                    org.jgraph.graph.CellMapper cm)
Creates default view object for this TCPort.

Parameters:
g - graph to create view on
cm - used CellMapper
Returns:
created TCPortView