JHotDraw 6.0b1

org.jhotdraw.figures
Class ArrowTip

java.lang.Object
  extended by org.jhotdraw.figures.AbstractLineDecoration
      extended by org.jhotdraw.figures.ArrowTip
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, LineDecoration, Storable

public class ArrowTip
extends AbstractLineDecoration

An arrow tip line decoration.

See Also:
PolyLineFigure, Serialized Form

Constructor Summary
ArrowTip()
           
ArrowTip(double angle, double outerRadius, double innerRadius)
          Constructs an arrow tip with the given angle and radius.
 
Method Summary
protected  double getAngle()
          Returns point angle of arrow.
protected  double getInnerRadius()
          Returns the inner radius
protected  double getOuterRadius()
          Returns the outer radius
 java.awt.Polygon outline(int x1, int y1, int x2, int y2)
          Calculates the outline of an arrow tip.
 void read(StorableInput dr)
          Reads the arrow tip from a StorableInput.
protected  void setAngle(double newAngle)
          Sets point angle of arrow.
protected  void setInnerRadius(double newInnerRadius)
          Sets the inner radius
protected  void setOuterRadius(double newOuterRadius)
          Sets the outer radius
 void write(StorableOutput dw)
          Stores the arrow tip to a StorableOutput.
 
Methods inherited from class org.jhotdraw.figures.AbstractLineDecoration
displayBox, draw, getBorderColor, getFillColor, setBorderColor, setFillColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrowTip

public ArrowTip()

ArrowTip

public ArrowTip(double angle,
                double outerRadius,
                double innerRadius)
Constructs an arrow tip with the given angle and radius.

Method Detail

outline

public java.awt.Polygon outline(int x1,
                                int y1,
                                int x2,
                                int y2)
Calculates the outline of an arrow tip.

Specified by:
outline in class AbstractLineDecoration

write

public void write(StorableOutput dw)
Stores the arrow tip to a StorableOutput.

Specified by:
write in interface Storable
Overrides:
write in class AbstractLineDecoration

read

public void read(StorableInput dr)
          throws java.io.IOException
Reads the arrow tip from a StorableInput.

Specified by:
read in interface Storable
Overrides:
read in class AbstractLineDecoration
Throws:
java.io.IOException

setAngle

protected void setAngle(double newAngle)
Sets point angle of arrow. A smaller angle leads to a pointier arrow. The angle is measured between the arrow line and one of the points at the side of the arrow. Thus, the total angle at the arrow tip is the double of the angle specified.


getAngle

protected double getAngle()
Returns point angle of arrow. A smaller angle leads to a pointier arrow. The angle is measured between the arrow line and one of the points at the side of the arrow. Thus, the total angle at the arrow tip is the double of the angle specified.


setInnerRadius

protected void setInnerRadius(double newInnerRadius)
Sets the inner radius


getInnerRadius

protected double getInnerRadius()
Returns the inner radius


setOuterRadius

protected void setOuterRadius(double newOuterRadius)
Sets the outer radius


getOuterRadius

protected double getOuterRadius()
Returns the outer radius


JHotDraw 6.0b1