public class IlvBundleLinkShapePolicy extends IlvAbstractLinkShapePolicy
IlvClippingLinkConnector
.
It bundles only those links that are straight, because these links would
otherwise overlap. It bundles only self links that have less than 4 bends,
because these self links would otherwise be hidden by the nodes.
The same policy can be shared among all links.
The parameters of the policy can be set via
setMultiLinkSpacing(double)
, setSelfLinkBaseSpacing(double)
,
setSelfLinkSideSpacing(double)
, getSelfLinkDirection()
, and
setSelfLinkTriangular(boolean)
.
You should set the spacing parameters before installing the policy.
If you change spacing parameters of this policy, you must
uninstall the policy first from all links and reinstall it afterwards.
IlvEnhancedPolylineLinkImage
and subclasses,
this policy can be activated using
IlvEnhancedPolylineLinkImage.setMultiLinkBundled(boolean)
.
IlvLinkBundle
.IlvPolicyAwareLinkImage
,
IlvEnhancedPolylineLinkImage.setMultiLinkBundled(boolean)
Modifier and Type | Field and Description |
---|---|
static int |
ALWAYS_HORIZONTAL
Option for the multilink orientation.
|
static int |
ALWAYS_VERTICAL
Option for the multilink orientation.
|
static int |
VARIABLE
Option for the multilink orientation.
|
Constructor and Description |
---|
IlvBundleLinkShapePolicy()
Creates an empty 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 |
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 |
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.
|
void |
beforeRemove(IlvLinkImage link)
Allows the policy to react before a link with installed policy is removed
from a grapher.
|
boolean |
canBundle(IlvLinkImage link)
This method decides whether a link can be bundled.
|
int |
getMultiLinkOrientation()
Returns the preferred orientation of the links bundled as multilinks.
|
double |
getMultiLinkSpacing()
Returns the offset between links that are bundled as multilinks.
|
double |
getSelfLinkBaseSpacing()
Returns the smallest length of the base line segment of selflinks that
are automatically routed.
|
int |
getSelfLinkDirection()
Returns the direction where the automatically routed self links
are attached to the node.
|
double |
getSelfLinkSideSpacing()
Returns the smallest length of the two side line segments of selflinks that
are automatically routed.
|
boolean |
isSelfLinkTriangular()
Returns
true if the automatic rerouted selflinks have a
triangular shape. |
void |
onInstall(IlvLinkImage link)
Allows the policy to react immediately when it is installed at a link.
|
void |
onUninstall(IlvLinkImage link)
Allows the policy to react immediately when it is removed from a link.
|
static void |
recalculateAllBundles(IlvGraphic node,
boolean includeTreeExternalIntergraphLinks)
Recalculates the link bundles incident to the input node.
|
static void |
SetMultiLinkOrientation(IlvManager manager,
int orientation,
boolean traverse,
boolean redraw)
Sets the preferred orientation of the links bundled as multilinks
for all links of the input manager.
|
void |
setMultiLinkOrientation(int orientation)
Sets the preferred orientation of the links bundled as multilinks.
|
void |
setMultiLinkSpacing(double offset)
Sets the offset between links that are bundled as multilinks.
|
static void |
SetMultiLinkSpacing(IlvManager manager,
double offset,
boolean traverse,
boolean redraw)
Sets the offset between links that are bundled as multilinks
for all links of the input manager.
|
void |
setSelfLinkBaseSpacing(double offset)
Sets the smallest length of the base line segment of selflinks that
are automatically routed.
|
static void |
SetSelfLinkBaseSpacing(IlvManager manager,
double offset,
boolean traverse,
boolean redraw)
Sets the smallest length of the base line segment of selflinks that
are automatically routed for all links of the input manager.
|
static void |
SetSelfLinkDirection(IlvManager manager,
int direction,
boolean traverse,
boolean redraw)
Sets the direction where the automatically routed self links
are attached to the node for all links of the input manager.
|
void |
setSelfLinkDirection(int direction)
Sets the direction where the automatically routed self links
are attached to the node.
|
void |
setSelfLinkSideSpacing(double offset)
Sets the smallest length of the two side line segments of selflinks that
are automatically routed.
|
static void |
SetSelfLinkSideSpacing(IlvManager manager,
double offset,
boolean traverse,
boolean redraw)
Sets the smallest length of the two side line segments of selflinks that
are automatically routed for all links of the input manager.
|
void |
setSelfLinkTriangular(boolean enable)
Sets whether the automatic rerouted selflinks have a triangular shape
or a rectangular shape.
|
static void |
SetSelfLinkTriangular(IlvManager manager,
boolean enable,
boolean traverse,
boolean redraw)
Sets whether the automatic rerouted selflinks have a triangular shape
or a rectangular shape for all links of the input manager.
|
afterAny, afterApplyTransform, afterMovePoint, allowApplyTransform, allowInsertPoint, allowMovePoint, allowRemovePoint, allowSetIntermediateLinkPoints, getChildPolicy, getLinkPoints, getPointAt, setChildPolicy
public static final int VARIABLE
setMultiLinkOrientation(int)
,
Constant Field Valuespublic static final int ALWAYS_HORIZONTAL
setMultiLinkOrientation(int)
,
Constant Field Valuespublic static final int ALWAYS_VERTICAL
setMultiLinkOrientation(int)
,
Constant Field Valuespublic IlvBundleLinkShapePolicy()
public void setMultiLinkSpacing(double offset)
SetMultiLinkSpacing(IlvManager, double, boolean, boolean)
which sets the spacing at all policies of links in the manager in the
same way.
getMultiLinkSpacing()
public double getMultiLinkSpacing()
setMultiLinkSpacing(double)
public static void SetMultiLinkSpacing(IlvManager manager, double offset, boolean traverse, boolean redraw)
setMultiLinkSpacing(double)
for details.
manager
- The manager.offset
- The multi link spacing.traverse
- Whether the submanagers should recursively be traversed
as well to set the spacing.redraw
- Whether a redraw of all links is required after setting
the spacing.setMultiLinkSpacing(double)
,
getMultiLinkSpacing()
public void setMultiLinkOrientation(int orientation)
VARIABLE
- the orientation is variable and calculated
from the positions of the end nodes.
This is usually the best value.
ALWAYS_HORIZONTAL
- The offset between the bundled links is
always an x offset. This is only useful
if the nodes connected by links do not overlap
vertically (do not have the same y coordinate).
It is also useful if the links are connected to a
IlvBusLinkConnector
on one side.
ALWAYS_VERTICAL
- The offset between the bundled links is
always an y offset. This is only useful
if the nodes connected by links do not overlap
horizontally (do not have the same x coordinate).
getMultiLinkOrientation()
public int getMultiLinkOrientation()
setMultiLinkOrientation(int)
public static void SetMultiLinkOrientation(IlvManager manager, int orientation, boolean traverse, boolean redraw)
setMultiLinkOrientation(int)
for details.
manager
- The manager.orientation
- The multilink orientation.traverse
- Whether the submanagers should recursively be traversed
as well to set the spacing.redraw
- Whether a redraw of all links is required after setting
the spacing.setMultiLinkOrientation(int)
,
getMultiLinkOrientation()
public void setSelfLinkBaseSpacing(double offset)
SetSelfLinkBaseSpacing(IlvManager, double, boolean, boolean)
which sets the spacing at all policies of links in the manager in the
same way.
getSelfLinkBaseSpacing()
public double getSelfLinkBaseSpacing()
setSelfLinkBaseSpacing(double)
public static void SetSelfLinkBaseSpacing(IlvManager manager, double offset, boolean traverse, boolean redraw)
setSelfLinkBaseSpacing(double)
for details.
manager
- The manager.offset
- The self link spacing.traverse
- Whether the submanagers should recursively be traversed
as well to set the spacing.redraw
- Whether a redraw of all links is required after setting
the spacing.setSelfLinkBaseSpacing(double)
,
getSelfLinkBaseSpacing()
public void setSelfLinkSideSpacing(double offset)
SetSelfLinkSideSpacing(IlvManager, double, boolean, boolean)
which sets the spacing at all policies of links in the manager in the
same way.
getSelfLinkSideSpacing()
public double getSelfLinkSideSpacing()
setSelfLinkSideSpacing(double)
public static void SetSelfLinkSideSpacing(IlvManager manager, double offset, boolean traverse, boolean redraw)
setSelfLinkSideSpacing(double)
for details.
manager
- The manager.offset
- The self link spacing.traverse
- Whether the submanagers should recursively be traversed
as well to set the spacing.redraw
- Whether a redraw of all links is required after setting
the spacing.setSelfLinkSideSpacing(double)
,
getSelfLinkSideSpacing()
public void setSelfLinkDirection(int direction)
IlvDirection.Bottom
- the self links are routed at
the bottom side of the node. This is the default.
IlvDirection.Top
- the self links are routed at
the top side of the node.
IlvDirection.Left
- the self links are routed at
the left side of the node.
IlvDirection.Left
- the self links are routed at
the left side of the node.
SetSelfLinkDirection(IlvManager, int, boolean, boolean)
which sets the direction at all policies of links in the manager in the
same way.
getSelfLinkDirection()
,
IlvDirection
public int getSelfLinkDirection()
IlvDirection
.
setSelfLinkDirection(int)
,
IlvDirection
public static void SetSelfLinkDirection(IlvManager manager, int direction, boolean traverse, boolean redraw)
setSelfLinkDirection(int)
for details.
manager
- The manager.direction
- The self link direction.traverse
- Whether the submanagers should recursively be traversed
as well to set the direction.redraw
- Whether a redraw of all links is required after setting
the direction.setSelfLinkDirection(int)
,
getSelfLinkDirection()
public void setSelfLinkTriangular(boolean enable)
SetSelfLinkTriangular(IlvManager, boolean, boolean, boolean)
which sets the shape preference at all policies of links in the manager
in the same way.
isSelfLinkTriangular()
public boolean isSelfLinkTriangular()
true
if the automatic rerouted selflinks have a
triangular shape. Returns false
if the automatic rerouted
selflinks have a rectangular shape.
setSelfLinkTriangular(boolean)
public static void SetSelfLinkTriangular(IlvManager manager, boolean enable, boolean traverse, boolean redraw)
setSelfLinkTriangular(boolean)
for details.
manager
- The manager.enable
- Whether triangular shapes are enabled.traverse
- Whether the submanagers should recursively be traversed
as well to set the shape preference.redraw
- Whether a redraw of all links is required after setting
the shape preference.setSelfLinkTriangular(boolean)
,
isSelfLinkTriangular()
public boolean canBundle(IlvLinkImage link)
public static void recalculateAllBundles(IlvGraphic node, boolean includeTreeExternalIntergraphLinks)
node
- The node.includeTreeExternalIntergraphLinks
- Indicates whether
intergraph links not ending directly on the node
are taken into account.IlvGrapher.getTreeExternalInterGraphLinks()
public void afterAdd(IlvLinkImage link)
applyToObject
on the link.
afterAdd
in interface IlvLinkShapePolicy
afterAdd
in class IlvAbstractLinkShapePolicy
link
- The link.public void beforeRemove(IlvLinkImage link)
applyToObject
on the link.
beforeRemove
in interface IlvLinkShapePolicy
beforeRemove
in class IlvAbstractLinkShapePolicy
link
- The link.public void onInstall(IlvLinkImage link)
onInstall
in interface IlvLinkShapePolicy
onInstall
in class IlvAbstractLinkShapePolicy
link
- The link.public void onUninstall(IlvLinkImage link)
onUninstall
in interface IlvLinkShapePolicy
onUninstall
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 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 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.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.