ciips.animation.tree
Class TreeEdge

java.lang.Object
  |
  +--ciips.animation.tree.TreeEdge
All Implemented Interfaces:
DrawingObj

public class TreeEdge
extends java.lang.Object
implements DrawingObj

A drawable object connecting two TreeNode's


Constructor Summary
TreeEdge(TreeNode start, TreeNode end)
          Constructor in which offset is set to (0,0)
TreeEdge(TreeNode start, TreeNode end, java.awt.Dimension offset)
          Create a new edge joining start and end
 
Method Summary
 void draw(java.awt.Graphics g)
          Draw the edge
 boolean equals(TreeNode s, TreeNode end)
          Match an edge
 TreeNode getEnd()
           
 TreeNode getStart()
           
 int getX()
          Return the x coordinate of the start node
 int getY()
          Returns the y coordinate of the drawing object's reference point.
 void move(int x, int y)
          A no op for a tree edge
 void setColour(java.awt.Color c)
           
 void setEnd(TreeNode e)
           
 void setOffset(java.awt.Dimension offset)
          Changes the offset to the arc start and end points ..
 void setStart(TreeNode s)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeEdge

public TreeEdge(TreeNode start,
                TreeNode end,
                java.awt.Dimension offset)
Create a new edge joining start and end

TreeEdge

public TreeEdge(TreeNode start,
                TreeNode end)
Constructor in which offset is set to (0,0)
Method Detail

setStart

public void setStart(TreeNode s)

setEnd

public void setEnd(TreeNode e)

getStart

public TreeNode getStart()

getEnd

public TreeNode getEnd()

setOffset

public void setOffset(java.awt.Dimension offset)
Changes the offset to the arc start and end points .. used if the node size shrinks or expands, eg because a tree became larger or the panel changed size

setColour

public void setColour(java.awt.Color c)

move

public void move(int x,
                 int y)
A no op for a tree edge
Specified by:
move in interface DrawingObj
Following copied from interface: ciips.animation.DrawingObj
Parameters:
x - The x coordinate of the drawing object's new position.
y - The y coordinate of the drawing object's new position.

getX

public int getX()
Return the x coordinate of the start node
Specified by:
getX in interface DrawingObj
Following copied from interface: ciips.animation.DrawingObj
Returns:
The x coordinate of the drawing object's reference point.

getY

public int getY()
Description copied from interface: DrawingObj
Returns the y coordinate of the drawing object's reference point.
Specified by:
getY in interface DrawingObj
Following copied from interface: ciips.animation.DrawingObj
Returns:
The y coordinate of the drawing object's reference point.

equals

public boolean equals(TreeNode s,
                      TreeNode end)
Match an edge

draw

public void draw(java.awt.Graphics g)
Draw the edge
Specified by:
draw in interface DrawingObj
Following copied from interface: ciips.animation.DrawingObj
Parameters:
g - A reference to the graphical context.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object