com.horstmann.violet.framework
Interface Edge

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
CallEdge, ClassRelationshipEdge, NoteEdge, ObjectReferenceEdge, ReturnEdge, SegmentedLineEdge, ShapeEdge, StateTransitionEdge

public interface Edge
extends java.io.Serializable, java.lang.Cloneable

An edge in a graph.


Method Summary
 java.lang.Object clone()
           
 void connect(Node aStart, Node anEnd)
          Connect this edge to two nodes.
 boolean contains(java.awt.geom.Point2D aPoint)
          Tests whether the edge contains a point.
 void draw(java.awt.Graphics2D g2)
          Draw the edge.
 java.awt.geom.Rectangle2D getBounds(java.awt.Graphics2D g2)
          Gets the smallest rectangle that bounds this edge.
 java.awt.geom.Line2D getConnectionPoints()
          Gets the points at which this edge is connected to its nodes.
 Node getEnd()
          Gets the ending node.
 Node getStart()
          Gets the starting node.
 

Method Detail

draw

void draw(java.awt.Graphics2D g2)
Draw the edge.

Parameters:
g2 - the graphics context

contains

boolean contains(java.awt.geom.Point2D aPoint)
Tests whether the edge contains a point.

Parameters:
aPoint - the point to test
Returns:
true if this edge contains aPoint

connect

void connect(Node aStart,
             Node anEnd)
Connect this edge to two nodes.

Parameters:
aStart - the starting node
anEnd - the ending node

getStart

Node getStart()
Gets the starting node.

Returns:
the starting node

getEnd

Node getEnd()
Gets the ending node.

Returns:
the ending node

getConnectionPoints

java.awt.geom.Line2D getConnectionPoints()
Gets the points at which this edge is connected to its nodes.

Returns:
a line joining the two connection points

getBounds

java.awt.geom.Rectangle2D getBounds(java.awt.Graphics2D g2)
Gets the smallest rectangle that bounds this edge. The bounding rectangle contains all labels.

Returns:
the bounding rectangle

clone

java.lang.Object clone()