ilog.views.graphic.linkpolicy
Class IlvOrthogonalLinkShapePolicy

java.lang.Object
  extended by ilog.views.graphic.linkpolicy.IlvAbstractLinkShapePolicy
      extended by ilog.views.graphic.linkpolicy.IlvOrthogonalLinkShapePolicy
All Implemented Interfaces:
IlvLinkShapePolicy

public class IlvOrthogonalLinkShapePolicy
extends IlvAbstractLinkShapePolicy

An IlvOrthogonalLinkShapePolicy always keeps the links orthogonal. The policy can be shared between all links. The parameters of the policy can be set via setMinFinalSegmentLength(float) and setBendDeltaOnStraightLink(float).

Since:
JViews 6.0
See Also:
IlvPolicyAwareLinkImage

Constructor Summary
IlvOrthogonalLinkShapePolicy()
          Creates an orthogonal link shape policy.
 
Method Summary
 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, float x, float 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.
 float 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(float delta)
          Sets the delta a newly created bend point is shifted if it was created on a straight link.
 float 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(float 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.
 
Methods inherited from class ilog.views.graphic.linkpolicy.IlvAbstractLinkShapePolicy
afterAny, allowApplyTransform, allowInsertPoint, allowSetIntermediateLinkPoints, beforeRemove, getChildPolicy, onUninstall, setChildPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvOrthogonalLinkShapePolicy

public IlvOrthogonalLinkShapePolicy()
Creates an orthogonal link shape policy.

Method Detail

setMinFinalSegmentLength

public void setMinFinalSegmentLength(float 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. For instance, when the start point of the link is moved from the top border to the left border of the node, a new horizontal segment must be created. The initial length of this horizontal segment is specified by this method.

Parameters:
len - The new length

setMinFinalSegmentLength

public float 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. For instance, when the start point of the


setBendDeltaOnStraightLink

public void setBendDeltaOnStraightLink(float delta)
Sets the delta a newly created bend point is shifted if it was created on a straight link. Because the link must remain orthogonal, not one but at least two bends are usually created, from which one may be initially immovable. If the delta is 0, it becomes difficult to select later the bend that is movable, because both bends would overlap.


getBendDeltaOnStraightLink

public float getBendDeltaOnStraightLink()
Returns the delta a newly created bend point is shifted if it was created on a straight link.


afterAdd

public void afterAdd(IlvLinkImage link)
Allows the policy to react after a link with installed policy is added to a grapher.

Specified by:
afterAdd in interface IlvLinkShapePolicy
Overrides:
afterAdd in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.

onInstall

public void onInstall(IlvLinkImage link)
Allows the policy to react immediately when it is installed at a link.

Specified by:
onInstall in interface IlvLinkShapePolicy
Overrides:
onInstall in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.

afterSetIntermediateLinkPoints

public void afterSetIntermediateLinkPoints(IlvLinkImage link)
Allows the policy to react after the intermediate points were set.

Specified by:
afterSetIntermediateLinkPoints in interface IlvLinkShapePolicy
Overrides:
afterSetIntermediateLinkPoints in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.

afterInsertPoint

public void afterInsertPoint(IlvLinkImage link,
                             int index,
                             IlvTransformer t)
Allows the policy to react after a point was inserted.

Specified by:
afterInsertPoint in interface IlvLinkShapePolicy
Overrides:
afterInsertPoint in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
index - The index at which the new point was inserted.
t - The transformer through which the link is drawn.

allowRemovePoint

public boolean allowRemovePoint(IlvLinkImage link,
                                int index,
                                IlvTransformer t)
Returns true if the policy allows to remove the point. Returns false otherwise.

Specified by:
allowRemovePoint in interface IlvLinkShapePolicy
Overrides:
allowRemovePoint in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
index - The index of the point to be removed.
t - The transformer through which the link is drawn.

afterRemovePoint

public void afterRemovePoint(IlvLinkImage link,
                             int index,
                             IlvTransformer t)
Allows the policy to react after a point was removed.

Specified by:
afterRemovePoint in interface IlvLinkShapePolicy
Overrides:
afterRemovePoint in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
index - The index at which a point was removed.
t - The transformer through which the link is drawn.

allowMovePoint

public boolean allowMovePoint(IlvLinkImage link,
                              int index,
                              float x,
                              float y,
                              IlvTransformer t)
Returns true if the policy allows to move the point. Returns false otherwise.

Specified by:
allowMovePoint in interface IlvLinkShapePolicy
Overrides:
allowMovePoint in class IlvAbstractLinkShapePolicy
Parameters:
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.

afterMovePoint

public void afterMovePoint(IlvLinkImage link,
                           int index,
                           IlvTransformer t)
Allows the policy to react after a point was moved.

Specified by:
afterMovePoint in interface IlvLinkShapePolicy
Overrides:
afterMovePoint in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
index - The index of the point that was moved.
t - The transformer through which the link is drawn.

afterApplyTransform

public void afterApplyTransform(IlvLinkImage link,
                                IlvTransformer t)
Allows the policy to react after a transformation was applied.

Specified by:
afterApplyTransform in interface IlvLinkShapePolicy
Overrides:
afterApplyTransform in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
t - The applied transformer.

afterFromNodeMoved

public void afterFromNodeMoved(IlvLinkImage link)
Allows the policy to react after the source node of the link was moved.

Specified by:
afterFromNodeMoved in interface IlvLinkShapePolicy
Overrides:
afterFromNodeMoved in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.

afterToNodeMoved

public void afterToNodeMoved(IlvLinkImage link)
Allows the policy to react after the target node of the link was moved.

Specified by:
afterToNodeMoved in interface IlvLinkShapePolicy
Overrides:
afterToNodeMoved in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.

getLinkPoints

public IlvPoint[] getLinkPoints(IlvLinkImage link,
                                IlvTransformer t)
Returns the points that define the link.

Specified by:
getLinkPoints in interface IlvLinkShapePolicy
Overrides:
getLinkPoints in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
t - The transformer to be applied.

getPointAt

public IlvPoint getPointAt(IlvLinkImage link,
                           int index,
                           IlvTransformer t)
Returns the point at a given index.

Specified by:
getPointAt in interface IlvLinkShapePolicy
Overrides:
getPointAt in class IlvAbstractLinkShapePolicy
Parameters:
link - The link.
index - The index of the point.
t - The transformer to be applied.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.