public class ArrowTipPathGenerator extends Object
The ArrowTipPathGenerator
creates a path corresponding to an arrow tip.
The path provided by getPath(Point, Point, double)
is properly oriented relative to the underlying arrow.
When the length of the underlying arrow gets shorter than the desired one, a shrinking ratio is gradually applied
so that the arrow tip remains visible.
Constructor and Description |
---|
ArrowTipPathGenerator(double tipOpeningAngle,
double tipLength,
double tipShrinkingRatio)
Creates an
ArrowTipPathGenerator . |
Modifier and Type | Method and Description |
---|---|
List<Point> |
getPath(Point source,
Point destination,
double destinationIconSize)
|
public ArrowTipPathGenerator(double tipOpeningAngle, double tipLength, double tipShrinkingRatio)
ArrowTipPathGenerator
.tipOpeningAngle
- the angle by which the arrow tip should be open, in radians.tipLength
- the expected length of the arrow tip, when not constrained.tipShrinkingRatio
- the ratio of the arrow length that the tip should take when the available arrow
length is shorter than the expected tipLength. A double between 0
and
1
.public List<Point> getPath(Point source, Point destination, double destinationIconSize)
Computes a path for the tip of an arrow going from provided the source Point
to the destination
Point
.
source
- the Point
from which the arrow starts. Nothing to be displayed here.destination
- the Point
to which the arrow points. The arrow tip is to be displayed on this side.destinationIconSize
- the size of the destination icon, as a double.List
of Point
s representing the arrow tip.