public class IlvOrthogonalLinkShapePolicy extends IlvAbstractLinkShapePolicy
IlvOrthogonalLinkShapePolicy
always keeps the links
orthogonal.
The policy can be shared between all links.
The parameters of the policy can be set via
setMinFinalSegmentLength(double)
and setBendDeltaOnStraightLink(double)
.
IlvPolicyAwareLinkImage
Constructor and Description |
---|
IlvOrthogonalLinkShapePolicy()
Creates an orthogonal link shape policy.
|
Modifier and Type | Method and Description |
---|---|
void |
afterAdd(IlvLinkImage link)
Allows the policy to react after a link with installed policy is added
to a grapher.
|
void |
afterApplyTransform(IlvLinkImage link,
IlvTransformer t)
Allows the policy to react after a transformation was applied.
|
void |
afterFromNodeMoved(IlvLinkImage link)
Allows the policy to react after the source node of the link was moved.
|
void |
afterInsertPoint(IlvLinkImage link,
int index,
IlvTransformer t)
Allows the policy to react after a point was inserted.
|
void |
afterMovePoint(IlvLinkImage link,
int index,
IlvTransformer t)
Allows the policy to react after a point was moved.
|
void |
afterRemovePoint(IlvLinkImage link,
int index,
IlvTransformer t)
Allows the policy to react after a point was removed.
|
void |
afterSetIntermediateLinkPoints(IlvLinkImage link)
Allows the policy to react after the intermediate points were set.
|
void |
afterToNodeMoved(IlvLinkImage link)
Allows the policy to react after the target node of the link was moved.
|
boolean |
allowMovePoint(IlvLinkImage link,
int index,
double x,
double y,
IlvTransformer t)
Returns
true if the policy allows to move the point. |
boolean |
allowRemovePoint(IlvLinkImage link,
int index,
IlvTransformer t)
Returns
true if the policy allows to remove the point. |
double |
getBendDeltaOnStraightLink()
Returns the delta a newly created bend point is shifted if it was created
on a straight link.
|
IlvPoint[] |
getLinkPoints(IlvLinkImage link,
IlvTransformer t)
Returns the points that define the link.
|
IlvPoint |
getPointAt(IlvLinkImage link,
int index,
IlvTransformer t)
Returns the point at a given index.
|
void |
onInstall(IlvLinkImage link)
Allows the policy to react immediately when it is installed at a link.
|
void |
setBendDeltaOnStraightLink(double delta)
Sets the delta a newly created bend point is shifted if it was created
on a straight link.
|
double |
setMinFinalSegmentLength()
Returns the minimal segment length of a start segment or end segment
that is used when the link connection point is moved to a different
border side of the node.
|
void |
setMinFinalSegmentLength(double len)
Sets the minimal segment length of a start segment or end segment
that is used when the link connection point is moved to a different
border side of the node.
|
afterAny, allowApplyTransform, allowInsertPoint, allowSetIntermediateLinkPoints, beforeRemove, getChildPolicy, onUninstall, setChildPolicy
public IlvOrthogonalLinkShapePolicy()
public void setMinFinalSegmentLength(double len)
len
- The new lengthpublic double setMinFinalSegmentLength()
public void setBendDeltaOnStraightLink(double delta)
public double getBendDeltaOnStraightLink()
public void afterAdd(IlvLinkImage link)
afterAdd
in interface IlvLinkShapePolicy
afterAdd
in class IlvAbstractLinkShapePolicy
link
- The link.public void onInstall(IlvLinkImage link)
onInstall
in interface IlvLinkShapePolicy
onInstall
in class IlvAbstractLinkShapePolicy
link
- The link.public void afterSetIntermediateLinkPoints(IlvLinkImage link)
afterSetIntermediateLinkPoints
in interface IlvLinkShapePolicy
afterSetIntermediateLinkPoints
in class IlvAbstractLinkShapePolicy
link
- The link.public void afterInsertPoint(IlvLinkImage link, int index, IlvTransformer t)
afterInsertPoint
in interface IlvLinkShapePolicy
afterInsertPoint
in class IlvAbstractLinkShapePolicy
link
- The link.index
- The index at which the new point was inserted.t
- The transformer through which the link is drawn.public boolean allowRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
true
if the policy allows to remove the point.
Returns false
otherwise.
allowRemovePoint
in interface IlvLinkShapePolicy
allowRemovePoint
in class IlvAbstractLinkShapePolicy
link
- The link.index
- The index of the point to be removed.t
- The transformer through which the link is drawn.public void afterRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
afterRemovePoint
in interface IlvLinkShapePolicy
afterRemovePoint
in class IlvAbstractLinkShapePolicy
link
- The link.index
- The index at which a point was removed.t
- The transformer through which the link is drawn.public boolean allowMovePoint(IlvLinkImage link, int index, double x, double y, IlvTransformer t)
true
if the policy allows to move the point.
Returns false
otherwise.
allowMovePoint
in interface IlvLinkShapePolicy
allowMovePoint
in class IlvAbstractLinkShapePolicy
link
- The link.index
- The index of the point to be moved.x
- The new x coordinate (in manager coordinates).y
- The new y coordinate (in manager coordinates).t
- The transformer through which the link is drawn.public void afterMovePoint(IlvLinkImage link, int index, IlvTransformer t)
afterMovePoint
in interface IlvLinkShapePolicy
afterMovePoint
in class IlvAbstractLinkShapePolicy
link
- The link.index
- The index of the point that was moved.t
- The transformer through which the link is drawn.public void afterApplyTransform(IlvLinkImage link, IlvTransformer t)
afterApplyTransform
in interface IlvLinkShapePolicy
afterApplyTransform
in class IlvAbstractLinkShapePolicy
link
- The link.t
- The applied transformer.public void afterFromNodeMoved(IlvLinkImage link)
afterFromNodeMoved
in interface IlvLinkShapePolicy
afterFromNodeMoved
in class IlvAbstractLinkShapePolicy
link
- The link.public void afterToNodeMoved(IlvLinkImage link)
afterToNodeMoved
in interface IlvLinkShapePolicy
afterToNodeMoved
in class IlvAbstractLinkShapePolicy
link
- The link.public IlvPoint[] getLinkPoints(IlvLinkImage link, IlvTransformer t)
getLinkPoints
in interface IlvLinkShapePolicy
getLinkPoints
in class IlvAbstractLinkShapePolicy
link
- The link.t
- The transformer to be applied.public IlvPoint getPointAt(IlvLinkImage link, int index, IlvTransformer t)
getPointAt
in interface IlvLinkShapePolicy
getPointAt
in class IlvAbstractLinkShapePolicy
link
- The link.index
- The index of the point.t
- The transformer to be applied.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.