edu.colorado.cs.ns2.graphics
Class LineEndpoint

java.lang.Object
  extended by edu.colorado.cs.ns2.graphics.LineEndpoint

public class LineEndpoint
extends java.lang.Object

This class defines a line's endpoint, which can be any of {(x1, y1), (x2, y2)}

Author:
Kevin Bauer, Pushkar Sambhoos.

Field Summary
private  LineDrawable line
          A graphical shape representing a a link.
private  boolean whichEndPoint
          Determines which endpoint of the line we want to access.
 
Constructor Summary
LineEndpoint(LineDrawable line, boolean whichEndPoint)
          Two-argument constructor.
 
Method Summary
 LineDrawable getLine()
          Returns a reference to the line shape.
 boolean getWhichEndPoint()
          Returns True if we want endpoint 1, False if we want endpoint 2.
 void setShape(LineDrawable line)
          Sets the line shape.
 void setWhichEndPoint(boolean whichEndPoint)
          Sets the endpoint desired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

line

private LineDrawable line
A graphical shape representing a a link.


whichEndPoint

private boolean whichEndPoint
Determines which endpoint of the line we want to access. A value of True gives Point 1 (x1, y1) and a value of False gives Point 2 (x2, y2).

Constructor Detail

LineEndpoint

public LineEndpoint(LineDrawable line,
                    boolean whichEndPoint)
Two-argument constructor.

Parameters:
line - Sets the graphical line.
whichEndPoint - Determines which endpoint of the is desired.
Method Detail

getLine

public LineDrawable getLine()
Returns a reference to the line shape.

Returns:
A reference to the line shape.

setShape

public void setShape(LineDrawable line)
Sets the line shape.

Parameters:
line - A new line shape.

getWhichEndPoint

public boolean getWhichEndPoint()
Returns True if we want endpoint 1, False if we want endpoint 2.

Returns:
True if we want endpoint 1, False if we want endpoint 2.

setWhichEndPoint

public void setWhichEndPoint(boolean whichEndPoint)
Sets the endpoint desired.

Parameters:
whichEndPoint - A new endpoint desired.