The visibility of links can be controlled
independently of the visibility of nodes. This allows you to set a
link visible even though its origin and destination nodes are
invisible.
It is possible to couple the visibility of a
link to the visibility of its end nodes. In this case, the
visibility of the link can no longer be controlled independently. A
link becomes automatically invisible if its origin node or its
destination node becomes invisible. To enable this behavior, you
must install the IlvLinkVisibilityHandler as manager listener on
the grapher.
IlvGrapher grapher = new IlvGrapher(); grapher.addManagerContentChangedListener(new IlvLinkVisibilityHandler());
When the link visibility handler is
installed, it is possible to select which links are managed by the
handler and which links are not managed.
The visibility of a managed link is derived from the visibility of
its end nodes. The visibility of an unmanaged link is independent
of the visibility of its end nodes and can be controlled by
setVisible
. By default, all links are managed. Setting a Link as Unmanaged to Control Its
Visibility shows how to set a link as unmanaged to control its
visibility.
Setting a Link as Unmanaged to Control Its
Visibility
// install a link visibility handler. All links are managed. grapher.addManagerContentChangedListener(new IlvLinkVisibilityHandler()); // mark one link as unmanaged IlvLinkImage link = ... IlvLinkVisibilityHandler.setManaged(link, false); // the visibility of the unmanaged link can be controlled independently grapher.setVisible(link, false, redraw);
Note
In nested graphers, it is sufficient to install the link
visibility handler on the top-level grapher only as tree
content-changed listener to manage the visibility of all links in
all subgraphers. See Content-change events in nested managers.