sddl.hierarchy
Class Rectangle

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

public class Rectangle
extends Shape

This Shape describes a standard rectangle. The rectangle can have rounded edges.

Version:
1.00
Author:
Mathieu Bourgeois

Constructor Summary
Rectangle()
          Standard SDDL constructor
Rectangle(double length, double width)
          Standard Java-only constructor
 
Method Summary
 Rectangle copy()
          Returns a copy of this Rectangle
 void draw(AbstractPoint location, java.io.PrintWriter out)
          Standard SDDL draw function.
 RefPoint getEast(Drawing d)
          Returns the eastern point in the rectangle
 double getLength()
          Standard SDDL getter for the length parameter
 RefPoint getNorth(Drawing d)
          Returns the northern point in the rectangle
 RefPoint getNortheast(Drawing d)
          Returns the northeastern point in the rectangle
 RefPoint getNorthwest(Drawing d)
          Returns the northwestern point in the rectangle
 boolean getRound()
          Standard SDDL getter for the round parameter
 RefPoint getSouth(Drawing d)
          Returns the southern point in the rectangle
 RefPoint getSoutheast(Drawing d)
          Returns the southeastern point in the rectangle
 RefPoint getSouthwest(Drawing d)
          Returns the southwestern point in the rectangle
 RefPoint getWest(Drawing d)
          Returns the western point in the rectangle
 double getWidth()
          Standard SDDL getter for the width parameter
 Path obtainPath()
          Gives a Path describing the Rectangle.
 void setLength(double length)
          Standard SDDL setter for the length parameter
 void setRound(boolean round)
          Standard SDDL setter for the round parameter
 void setWidth(double width)
          Standard SDDL setter for width parameter
 
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

Rectangle

public Rectangle()
Standard SDDL constructor


Rectangle

public Rectangle(double length,
                 double width)
Standard Java-only constructor

Parameters:
length - Length of the rectangle
width - Width of the rectangle
Method Detail

setLength

public void setLength(double length)
Standard SDDL setter for the length parameter

Parameters:
length - The length of the rectangle

setWidth

public void setWidth(double width)
Standard SDDL setter for width parameter

Parameters:
width - The width of the rectangle

setRound

public void setRound(boolean round)
Standard SDDL setter for the round parameter

Parameters:
round - If edges are to be drawn rounded

getLength

public double getLength()
Standard SDDL getter for the length parameter

Returns:
The length of the rectangle

getWidth

public double getWidth()
Standard SDDL getter for the width parameter

Returns:
The width of the rectangle

getRound

public boolean getRound()
Standard SDDL getter for the round parameter

Returns:
If the edges are to be drawn rounded

getNorth

public RefPoint getNorth(Drawing d)
Returns the northern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The northern point

getSouth

public RefPoint getSouth(Drawing d)
Returns the southern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The southern point

getWest

public RefPoint getWest(Drawing d)
Returns the western point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The western point

getEast

public RefPoint getEast(Drawing d)
Returns the eastern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The eastern point

getNorthwest

public RefPoint getNorthwest(Drawing d)
Returns the northwestern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The northwestern point

getNortheast

public RefPoint getNortheast(Drawing d)
Returns the northeastern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The northeastern point

getSouthwest

public RefPoint getSouthwest(Drawing d)
Returns the southwestern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The southwestern point

getSoutheast

public RefPoint getSoutheast(Drawing d)
Returns the southeastern point in the rectangle

Parameters:
d - Drawing referencing the Shape
Returns:
The southeastern point

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

obtainPath

public Path obtainPath()
Gives a Path describing the Rectangle. This does not consider the rounded edges

Specified by:
obtainPath in class Shape
Returns:
A Path describing the Rectangle

copy

public Rectangle copy()
Returns a copy of this Rectangle

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