public class PathCalculator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PathCalculator.ArrowDirection
An enum listing the various directions the arrow can be painted.
|
static class |
PathCalculator.TargetLocation
An enumerator of possible locations that the target object can have
relative to the source object.
|
Constructor and Description |
---|
PathCalculator()
Constructs a new path calculator.
|
Modifier and Type | Method and Description |
---|---|
GeneralPath |
calculatePathEndToEnd(Rectangle sourceRect,
Rectangle targetRect)
Calculates a path from the end of the source rectangle to the end of the
target rectangle.
|
GeneralPath |
calculatePathEndToStart(Rectangle sourceRect,
Rectangle targetRect)
Calculates a path from the end of the source rectangle to the start of
the target rectangle.
|
GeneralPath |
calculatePathStartToEnd(Rectangle sourceRect,
Rectangle targetRect)
Calculates a path from the start of the source rectangle to the end of
the target rectangle.
|
GeneralPath |
calculatePathStartToStart(Rectangle sourceRect,
Rectangle targetRect)
Calculates a path from the start of the source rectangle to the start of
the target rectangle.
|
PathCalculator.ArrowDirection |
getArrowDirection()
Returns the arrow direction.
|
int |
getCurve()
Returns the radius of the curve.
|
int |
getGap()
The gap determines how far the line is drawn away from the bounds of the
source or target timeline object.
|
int |
getOffset()
The offset determines the end location of the first segment of the
calculated path.
|
PathCalculator.TargetLocation |
getTargetLocation()
Returns the target location.
|
void |
setCurve(int curve)
Sets the radius for the curve.
|
void |
setGap(int gap)
The gap determines how far the line is drawn away from the bounds of the
source or target timeline object.
|
void |
setOffset(int offset)
The offset determines the end location of the first segment of the
calculated path.
|
public PathCalculator()
public PathCalculator.TargetLocation getTargetLocation()
public PathCalculator.ArrowDirection getArrowDirection()
public GeneralPath calculatePathStartToStart(Rectangle sourceRect, Rectangle targetRect)
sourceRect
- the source rectangletargetRect
- the target rectanglepublic GeneralPath calculatePathEndToEnd(Rectangle sourceRect, Rectangle targetRect)
sourceRect
- the source rectangletargetRect
- the target rectanglepublic GeneralPath calculatePathStartToEnd(Rectangle sourceRect, Rectangle targetRect)
sourceRect
- the source rectangletargetRect
- the target rectanglepublic GeneralPath calculatePathEndToStart(Rectangle sourceRect, Rectangle targetRect)
sourceRect
- the source rectangletargetRect
- the target rectanglepublic int getOffset()
public void setOffset(int offset)
offset
- the offset in pixelspublic void setCurve(int curve)
setOffset(int)
). Setting this value to 0 results in
corners instead of curves.curve
- the radius of the curvepublic int getCurve()
public int getGap()
public void setGap(int gap)
gap
- the distance between line and timeline objectsCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.