org.openbp.cockpit.modeler.figures.generic
Class XArrowTip

java.lang.Object
  extended by CH.ifa.draw.figures.AbstractLineDecoration
      extended by org.openbp.cockpit.modeler.figures.generic.XArrowTip
All Implemented Interfaces:
CH.ifa.draw.figures.LineDecoration, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable

public class XArrowTip
extends CH.ifa.draw.figures.AbstractLineDecoration

An arrow tip line decoration.

Author:
Stephan Moritz
See Also:
Serialized Form

Constructor Summary
XArrowTip()
          Constructor.
XArrowTip(double angle, double outerRadius, double innerRadius)
          Value constructor.
 
Method Summary
 double getAngle()
          Gets the pointiness of arrow.
 double getInnerRadius()
          Gets the inner radius.
 double getOuterRadius()
          Gets the outer radius.
 java.awt.Polygon outline(int x1, int y1, int x2, int y2)
          Calculates the outline of an arrow tip.
 void read(CH.ifa.draw.util.StorableInput dr)
          Reads the arrow tip from a StorableInput.
 void setAngle(double angle)
          Sets the pointiness of arrow.
 void setInnerRadius(double innerRadius)
          Sets the inner radius.
 void setOuterRadius(double outerRadius)
          Sets the outer radius.
 void write(CH.ifa.draw.util.StorableOutput dw)
          Stores the arrow tip to a StorableOutput.
 
Methods inherited from class CH.ifa.draw.figures.AbstractLineDecoration
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

XArrowTip

public XArrowTip()
Constructor. Angle: 0.4, radius: 8


XArrowTip

public XArrowTip(double angle,
                 double outerRadius,
                 double innerRadius)
Value constructor.

Parameters:
angle - Pointiness of arrow
outerRadius - Outer radius
innerRadius - Inner 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 CH.ifa.draw.figures.AbstractLineDecoration
Parameters:
x1 - Arrow tip
y1 - Arrow tip
x2 - Arrow base
y2 - Arrow base
Returns:
The polygon describing the outline

getAngle

public double getAngle()
Gets the pointiness 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.


setAngle

public void setAngle(double angle)
Sets the pointiness 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.


getOuterRadius

public double getOuterRadius()
Gets the outer radius.


setOuterRadius

public void setOuterRadius(double outerRadius)
Sets the outer radius.


getInnerRadius

public double getInnerRadius()
Gets the inner radius.


setInnerRadius

public void setInnerRadius(double innerRadius)
Sets the inner radius.


write

public void write(CH.ifa.draw.util.StorableOutput dw)
Stores the arrow tip to a StorableOutput.

Specified by:
write in interface CH.ifa.draw.util.Storable
Overrides:
write in class CH.ifa.draw.figures.AbstractLineDecoration

read

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

Specified by:
read in interface CH.ifa.draw.util.Storable
Overrides:
read in class CH.ifa.draw.figures.AbstractLineDecoration
Throws:
java.io.IOException


Copyright © 2011. All Rights Reserved.