org.vormplus.shapeLib
Class RoundedRectangle

java.lang.Object
  extended by org.vormplus.shapeLib.BasicShape
      extended by org.vormplus.shapeLib.RoundedRectangle

public class RoundedRectangle
extends BasicShape

Create a RoundedRectangle object. This class extends the BasicShape class.

Author:
Jan Vantomme

Field Summary
 float h
           
 float r
           
 float w
           
 
Constructor Summary
RoundedRectangle(processing.core.PApplet _p)
          Creates a RoundedRectangle object
 
Method Summary
 float area()
          Returns the area of the rounded rectangle.
 float perimeter()
          Returns the perimeter of the rounded rectangle.
 void render()
          Renders the rounded rectangle to the screen.
 RoundedRectangle setHeight(float _h)
          Sets the height for the rounded rectangle.
 RoundedRectangle setRadius(float _r)
          Sets the radius for the rounded rectangle.
 RoundedRectangle setWidth(float _w)
          Sets the width for the rounded rectangle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

w

public float w

h

public float h

r

public float r
Constructor Detail

RoundedRectangle

public RoundedRectangle(processing.core.PApplet _p)
Creates a RoundedRectangle object

Parameters:
_p - Reference to the PApplet object. Normally use 'this'
Method Detail

setWidth

public RoundedRectangle setWidth(float _w)
Sets the width for the rounded rectangle.

Parameters:
_w - width for the rounded rectangle.

setHeight

public RoundedRectangle setHeight(float _h)
Sets the height for the rounded rectangle.

Parameters:
_h - height for the rounded rectangle.

setRadius

public RoundedRectangle setRadius(float _r)
Sets the radius for the rounded rectangle.

Parameters:
_r - radius for the rounded rectangle.

render

public void render()
Renders the rounded rectangle to the screen.


area

public float area()
Returns the area of the rounded rectangle.

Returns:
float: Area of the rounded rectangle.

perimeter

public float perimeter()
Returns the perimeter of the rounded rectangle.

Returns:
float: Perimeter of the rounded rectangle.