Make your own free website on Tripod.com
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Graph.Edge

java.lang.Object
   |
   +----Graph.Edge

public abstract class Edge
extends Object
implements Serializable, Cloneable
This is an abstract class representing an Edge. Every edge has its own Id, which is used as key in the hash table of all edges.(note that the start and end node are not sufficient to determine an unique edge, there may be more than one edge that connects same nodes)

See Also:
EdgeAttributes, GraphEventsAdaptor, GraphEventsCollector

Variable Index

 o timestampEnd
Timestamps, used to indicate the time when the last change of the node position happened.
 o timestampStart
Timestamps, used to indicate the time when the last change of the node position happened.

Constructor Index

 o Edge(Integer, Node, Node)
Edge constructor

Method Index

 o addComponents(GraphPanel)
Adds Edge Attributes component to the graph panel
 o clone()
This cloning method is never used (it should be abstract)
 o getEndNode()
Get End node
 o getId()
get Id
 o getMarkPoint()
This method returns the middle of the visible part of the edge (visible means that it is not covered by either start or end node).
 o getStartNode()
get Start Node
 o intersectionEndNode()
Returns the point of intersection between edge and the end node.
 o intersectionStartNode()
Returns the point of intersection between edge and the start node.
 o paint(Graphics)
 o removeComponents(GraphPanel)
 o setEndNode(Node)
 o setEventAdaptor(GraphEventsAdaptor)
 o setId(Integer)
 o setStartNode(Node)

Variables

 o timestampEnd
 public long timestampEnd
Timestamps, used to indicate the time when the last change of the node position happened. Since there are several fields that depend on the position of the Node, and their calculation is rather expensive to be performed every time an Edge is updated/displayed we chose to use timestamps, to reduce the expense of maintaining fields in question (fields carry information about intersection of edge and start/end node, and position of the center of the visible part of the edge. If you chose to create your own edges, note that getMarkPoint(), updates the timestamps, so call it after the timestamp dependant methods. I suggest that you do not change timestamps in your (new) methods, but leave it to the getMarkPoint.

 o timestampStart
 public long timestampStart
Timestamps, used to indicate the time when the last change of the node position happened. Since there are several fields that depend on the position of the Node, and their calculation is rather expensive to be performed every time an Edge is updated/displayed we chose to use timestamps, to reduce the expense of maintaining fields in question (fields carry information about intersection of edge and start/end node, and position of the center of the visible part of the edge. If you chose to create your own edges, note that getMarkPoint(), updates the timestamps, so call it after the timestamp dependant methods. I suggest that you do not change timestamps in your (new) methods, but leave it to the getMarkPoint.

Constructors

 o Edge
 public Edge(Integer Id,
             Node startNode,
             Node endNode)
Edge constructor

Methods

 o addComponents
 public void addComponents(GraphPanel graphPanel)
Adds Edge Attributes component to the graph panel

 o clone
 public Object clone()
This cloning method is never used (it should be abstract)

Overrides:
clone in class Object
 o getEndNode
 public Node getEndNode()
Get End node

 o getId
 public Integer getId()
get Id

 o getMarkPoint
 public Point getMarkPoint()
This method returns the middle of the visible part of the edge (visible means that it is not covered by either start or end node). Note that is updates the timestamps.

 o getStartNode
 public Node getStartNode()
get Start Node

 o intersectionEndNode
 public Point intersectionEndNode()
Returns the point of intersection between edge and the end node. (should be optimized)

 o intersectionStartNode
 public Point intersectionStartNode()
Returns the point of intersection between edge and the start node. (should be optimized)

 o paint
 public abstract void paint(Graphics g)
 o removeComponents
 public void removeComponents(GraphPanel g)
 o setEndNode
 public void setEndNode(Node endNode)
 o setEventAdaptor
 public void setEventAdaptor(GraphEventsAdaptor gea)
 o setId
 public void setId(Integer Id)
 o setStartNode
 public void setStartNode(Node startNode)

All Packages  Class Hierarchy  This Package  Previous  Next  Index