Vários links entre o mesmo par de nós

Às vezes um gráfico possui vários links entre o mesmo par de nós. Quando estes links são roteados diretamente e usam o mesmo ponto de conexão nos nós, eles se sobrepõem e não podem ser diferenciados. Para evitar tais sobreposições, os layouts especificados possuem um modo multilink que é aplicado apenas quando o estilo de link está configurado como STRAIGHT_LINE_STYLE. Este modo não tem efeito quando o estilo de link é NO_RESHAPE_STYLE.
Exemplo de Especificação de como Vários Links São Roteados
To specify the multilink mode, use the method:
layout.setMultiLinkMode(mode);
The valid values for mode are given with the example of Force-directed layout:
If the multilink mode is not NO_BUNDLE, the offset between the shifted links or between the bends of the links respectively can be specified:
Use os métodos:
layout.setMultiLinkOffset(offset);
layout.setMultiLinkMaxSpread(maxSpread);
The multilink offset is the offset between two neighboring links (or their bends). The value of maxSpread limits this offset to avoid having too much space used when you have too many multiple links. If the multilink offset is 10 and the value of maxSpread is 60, the effective offset is 10 if you have less than six multilinks. If you have more multilinks, the effective offset is reduced. For example, if you have 15 multilinks, the effective offset will be 4 instead of 10 to ensure that the links are shifted at most 60 units apart from each other. If the multilink mode is NARROW_STRAIGHT_LINE_BUNDLE, the effective offset is further limited by the size of the bounding box of both end nodes of a link bundle.
Examples of use of mode and offset Graphical result
NO_BUNDLE
Result
of offset in NO_BUNDLE mode between a pair of links
STRAIGHT_LINE_BUNDLE when the value of maxSpread is set too high.
Result
of offset in STRAIGHT_LINE_BUNDLE with the value of max spread set
too high
NARROW_STRAIGHT_LINE_BUNDLE: the same result can be obtained with STRAIGHT_LINE_BUNDLE by reducing the value of maxSpread.
Result
of offset in NARROW_STRAIGHT_LINE_BUNDLE or in STRAIGHT_LINE_BUNDLE
with a reduced value of max spread
CONNECTED_ONE_BEND_BUNDLE
Result
of offset in CONNECTED_ONE_BEND_BUNDLE
FREE_ONE_BEND_BUNDLE when the links are initially attached to node centers.
The same result can be obtained with CONNECTED_ONE_BEND_BUNDLE in combination with setting connectLinksToNodeCenters to true. For example, see ibm_ilog.graphlayout.forcedirected.ForceDirectedLayout.setConnectLinksToNodeCenters
Result
of offset in FREE_ONE_BEND_BUNDLE, links initially attached to node
centers, or CONNECTED_ONE_BEND_BUNDLE with setConnectLinksToNodeCenters
set to true