cz.cmc.tcgui
Class TCEdge

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.jgraph.graph.DefaultGraphCell
          extended bycz.cmc.tcgui.TCEdge
All Implemented Interfaces:
Cloneable, org.jgraph.graph.Edge, org.jgraph.graph.GraphCell, MutableTreeNode, Serializable, TreeNode
Direct Known Subclasses:
FilterChainEdge, FilterMatchEdge, QDiscInputEdge, SubclassEdge

public abstract class TCEdge
extends org.jgraph.graph.DefaultGraphCell
implements org.jgraph.graph.Edge

Title:

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
 
Nested classes inherited from class org.jgraph.graph.Edge
org.jgraph.graph.Edge.Routing
 
Field Summary
protected static Point defaultLabelPosition
           
protected static ArrayList defaultPoints
           
protected  Object source
          Source and target of the edge.
protected  Object target
          Source and target of the edge.
 
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
TCEdge()
          Constructs an empty edge.
TCEdge(Object userObject)
          Constructs an edge that holds a reference to the specified user object.
TCEdge(Object userObject, boolean allowsChildren)
          Constructs an edge that holds a reference to the specified user object and sets default values for points and the label position.
 
Method Summary
abstract  boolean acceptsSource(TCPort port)
          Returns whether the edge can accept given port as its source
abstract  boolean acceptsTarget(TCPort port)
          Returns whether the edge can accept given port as its target
 Object clone()
          Create a clone of the cell.
 TCEdgeView createDefaultView(TCGraph g, org.jgraph.graph.CellMapper cm)
          Creates default view object for this TCEdge.
 void createInsertEdit(List toInsert, Map viewMap)
          Insert into list additional cells to be created with this TCEdge and inserts their attributes to the viewMap.
 Object getSource()
          Returns the source of the edge.
 Object getTarget()
          Returns the target of the edge.
 Map changeAttributes(Map change)
          Override parent method to ensure non-null points.
 void setSource(Object port)
          Sets the source of the edge.
 void setTarget(Object port)
          Returns the target of edge.
 
Methods inherited from class org.jgraph.graph.DefaultGraphCell
cloneUserObject, getAttributes, getChildren, 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, setAttributes
 

Field Detail

defaultLabelPosition

protected static final Point defaultLabelPosition

defaultPoints

protected static final ArrayList defaultPoints

source

protected Object source
Source and target of the edge.


target

protected Object target
Source and target of the edge.

Constructor Detail

TCEdge

public TCEdge()
Constructs an empty edge.


TCEdge

public TCEdge(Object userObject)
Constructs an edge that holds a reference to the specified user object.

Parameters:
userObject - reference to the user object

TCEdge

public TCEdge(Object userObject,
              boolean allowsChildren)
Constructs an edge that holds a reference to the specified user object and sets default values for points and the label position.

Parameters:
userObject - reference to the user object
Method Detail

changeAttributes

public Map changeAttributes(Map change)
Override parent method to ensure non-null points.

Specified by:
changeAttributes in interface org.jgraph.graph.GraphCell

getSource

public Object getSource()
Returns the source of the edge.

Specified by:
getSource in interface org.jgraph.graph.Edge

getTarget

public Object getTarget()
Returns the target of the edge.

Specified by:
getTarget in interface org.jgraph.graph.Edge

setSource

public void setSource(Object port)
Sets the source of the edge.

Specified by:
setSource in interface org.jgraph.graph.Edge

setTarget

public void setTarget(Object port)
Returns the target of edge.

Specified by:
setTarget in interface org.jgraph.graph.Edge

createInsertEdit

public void createInsertEdit(List toInsert,
                             Map viewMap)
Insert into list additional cells to be created with this TCEdge and inserts their attributes to the viewMap. Intended for Graphmodel.insert.

Parameters:
toInsert - List of additional cells to be created with this TCObject
viewMap - attributes to be supplied to their views

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.

acceptsSource

public abstract boolean acceptsSource(TCPort port)
Returns whether the edge can accept given port as its source

Parameters:
port - port to decide whether to be accepted as source
Returns:
whether the port is accepted

acceptsTarget

public abstract boolean acceptsTarget(TCPort port)
Returns whether the edge can accept given port as its target

Parameters:
port - port to decide whether to be accepted as target
Returns:
whether the port is accepted

createDefaultView

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

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