edu.mit.sketch.ddg
Class DrawnArrow

java.lang.Object
  extended by edu.mit.sketch.ddg.DrawnObject
      extended by edu.mit.sketch.ddg.DrawnArrow
All Implemented Interfaces:
Transformable, java.io.Serializable, java.lang.Cloneable

public class DrawnArrow
extends DrawnObject
implements java.io.Serializable

An concrete drawn arrow. In the default position the arrow is horizontal right-pointing.

DrawnArrow.java Created: Sun Apr 28 16:44:00 2002

Author:
Olya Veselova
See Also:
Serialized Form

Field Summary
static double DEFAULT_HEAD_ANGLE
           
static double DEFAULT_HEAD_RATIO
           
static double DEFAULT_LENGTH
          Default arrow length.
 
Constructor Summary
DrawnArrow()
          Construct a default right-pointing arrow
DrawnArrow(PrimitiveList primitives)
          Construct a default arrow with a given list of labels.
 
Method Summary
 Rectangle boundingBox()
          Get the smallest possible bounding box of any orientation
 java.lang.Object clone()
          Clone the object (and the concrete geometric parts inside)
 
Methods inherited from class edu.mit.sketch.ddg.DrawnObject
angle, axisParallelBoundingBox, center, geometricPartAt, geometricPartAt, geometricParts, getObject, getObject, height, length, paint, primitiveAt, primitives, remove, rotate, scale, thickness, translate, width
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LENGTH

public static final double DEFAULT_LENGTH
Default arrow length.

See Also:
Constant Field Values

DEFAULT_HEAD_RATIO

public static final double DEFAULT_HEAD_RATIO
See Also:
Constant Field Values

DEFAULT_HEAD_ANGLE

public static final double DEFAULT_HEAD_ANGLE
See Also:
Constant Field Values
Constructor Detail

DrawnArrow

public DrawnArrow()
Construct a default right-pointing arrow


DrawnArrow

public DrawnArrow(PrimitiveList primitives)
           throws InvalidParameterException
Construct a default arrow with a given list of labels. Throws an exception if the number of labels is not 3. The labels should be in the following order - shaft, top head, bottom head.

Throws:
InvalidParameterException
Method Detail

boundingBox

public Rectangle boundingBox()
                      throws ObjectEmptyException
Get the smallest possible bounding box of any orientation

Overrides:
boundingBox in class DrawnObject
Throws:
ObjectEmptyException

clone

public java.lang.Object clone()
Clone the object (and the concrete geometric parts inside)

Overrides:
clone in class DrawnObject