algoanim.primitives
Class Rect

java.lang.Object
  extended by algoanim.primitives.Primitive
      extended by algoanim.primitives.Rect

public class Rect
extends Primitive

Represents a simple rectangle defined by its upper left and its lower right corners.

Author:
Stephan Mehlhase

Field Summary
 
Fields inherited from class algoanim.primitives.Primitive
gen
 
Constructor Summary
Rect(RectGenerator rg, Node upperLeftCorner, Node lowerRightCorner, java.lang.String name, DisplayOptions display, RectProperties rp)
          Instantiates the Rect and calls the create() method of the associated RectGenerator.
 
Method Summary
 Node getLowerRight()
          Returns the lower right corner of this Rect.
 RectProperties getProperties()
          Returns the properties of this Rect.
 Node getUpperLeft()
          Returns the upper left corner of this Rect.
 void setName(java.lang.String newName)
          Sets the name of this Primitive.
 
Methods inherited from class algoanim.primitives.Primitive
changeColor, exchange, getDisplayOptions, getName, hide, hide, moveBy, moveTo, moveVia, rotate, rotate, show, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rect

public Rect(RectGenerator rg,
            Node upperLeftCorner,
            Node lowerRightCorner,
            java.lang.String name,
            DisplayOptions display,
            RectProperties rp)
     throws java.lang.IllegalArgumentException
Instantiates the Rect and calls the create() method of the associated RectGenerator.

Parameters:
rg - the appropriate code Generator.
upperLeftCorner - the upper left corner of this Rect.
lowerRightCorner - the lower right corner of this Rect.
name - the name of this Rect.
display - [optional] the DisplayOptions of this Rect.
rp - [optional] the properties of this Rect.
Throws:
java.lang.IllegalArgumentException
Method Detail

getUpperLeft

public Node getUpperLeft()
Returns the upper left corner of this Rect.

Returns:
the upper left corner of this Rect.

getLowerRight

public Node getLowerRight()
Returns the lower right corner of this Rect.

Returns:
the lower right corner of this Rect.

getProperties

public RectProperties getProperties()
Returns the properties of this Rect.

Returns:
the properties of this Rect.

setName

public void setName(java.lang.String newName)
Description copied from class: Primitive
Sets the name of this Primitive.

Overrides:
setName in class Primitive
Parameters:
newName - the new name for this Primitive.
See Also:
Primitive.setName(java.lang.String)