com.horstmann.violet
Class ArrowHead

java.lang.Object
  extended by com.horstmann.violet.framework.SerializableEnumeration
      extended by com.horstmann.violet.ArrowHead
All Implemented Interfaces:
java.io.Serializable

public class ArrowHead
extends SerializableEnumeration

This class defines arrowheads of various shapes.

See Also:
Serialized Form

Field Summary
static ArrowHead BLACK_DIAMOND
           
static ArrowHead BLACK_TRIANGLE
           
static ArrowHead DIAMOND
           
static ArrowHead HALF_V
           
static ArrowHead NONE
           
static ArrowHead TRIANGLE
           
static ArrowHead V
           
 
Method Summary
 void draw(java.awt.Graphics2D g2, java.awt.geom.Point2D p, java.awt.geom.Point2D q)
          Draws the arrowhead.
 java.awt.geom.GeneralPath getPath(java.awt.geom.Point2D p, java.awt.geom.Point2D q)
          Gets the path of the arrowhead
 
Methods inherited from class com.horstmann.violet.framework.SerializableEnumeration
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final ArrowHead NONE

TRIANGLE

public static final ArrowHead TRIANGLE

BLACK_TRIANGLE

public static final ArrowHead BLACK_TRIANGLE

V

public static final ArrowHead V

HALF_V

public static final ArrowHead HALF_V

DIAMOND

public static final ArrowHead DIAMOND

BLACK_DIAMOND

public static final ArrowHead BLACK_DIAMOND
Method Detail

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Point2D p,
                 java.awt.geom.Point2D q)
Draws the arrowhead.

Parameters:
g2 - the graphics context
p - a point on the axis of the arrow head
q - the end point of the arrow head

getPath

public java.awt.geom.GeneralPath getPath(java.awt.geom.Point2D p,
                                         java.awt.geom.Point2D q)
Gets the path of the arrowhead

Parameters:
p - a point on the axis of the arrow head
q - the end point of the arrow head
Returns:
the path