sddl.hierarchy
Class Line

java.lang.Object
  extended by sddl.hierarchy.Shape
      extended by sddl.hierarchy.Line

public class Line
extends Shape

Describes a simple line between two points

Version:
1.00
Author:
Mathieu Bourgeois

Constructor Summary
Line()
          Standard SDDL constructor
Line(AbstractPoint point1, AbstractPoint point2)
          Java-only constructor
 
Method Summary
 Line copy()
          Returns a copy of this Line
 void draw(AbstractPoint location, java.io.PrintWriter out)
          Standard SDDL draw function.
 AbstractPoint getPoint1()
          Gets the first point of the line
 AbstractPoint getPoint2()
          Gets the second point of the line
 Path obtainPath()
          Returns a Path to describe this Line
 void setPoint1(AbstractPoint point1)
          Sets the first point of the line
 void setPoint2(AbstractPoint point2)
          Sets the second point of the line
 
Methods inherited from class sddl.hierarchy.Shape
isVisible, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line()
Standard SDDL constructor


Line

public Line(AbstractPoint point1,
            AbstractPoint point2)
Java-only constructor

Parameters:
point1 - first point
point2 - second point
Method Detail

copy

public Line copy()
Returns a copy of this Line

Specified by:
copy in class Shape
Returns:
A copy of this Line

draw

public void draw(AbstractPoint location,
                 java.io.PrintWriter out)
Description copied from class: Shape
Standard SDDL draw function. Every shape must implement this

Specified by:
draw in class Shape
Parameters:
location - The location of the Shape on the main drawing
out - The file to be written to

setPoint1

public void setPoint1(AbstractPoint point1)
Sets the first point of the line

Parameters:
point1 - First point of the line

setPoint2

public void setPoint2(AbstractPoint point2)
Sets the second point of the line

Parameters:
point2 - Second point of the line

getPoint1

public AbstractPoint getPoint1()
Gets the first point of the line

Returns:
First point of the line

getPoint2

public AbstractPoint getPoint2()
Gets the second point of the line

Returns:
Second point of the line

obtainPath

public Path obtainPath()
Returns a Path to describe this Line

Specified by:
obtainPath in class Shape
Returns:
A Path to describe this Line