public class IlvLinkVisibilityHandler extends Object implements ManagerContentChangedListener
IlvLinkVisibilityHandler
ensures that links are only
visible if their end nodes are visible. It is a contents changed listener
that must be installed at a grapher.
The handler influences only the global visibility of the objects in the managers. It does not influence the layer visibility per manager view, that is, if the end nodes of a link are visible in the manager but not visible in a layer of a specific manager view, the link is still visible in the manager.
The handler can be installed as manager listener on a flat grapher, or as tree listener on the top level grapher of a nesting hierarchy of graphers.
It is possible to selectively disable the behavior of the manager per
object. If an object is marked as managed (see setManaged(ilog.views.IlvGraphic, boolean)
),
its visibility is only controlled by the handler.
If the object is marked as unmanaged, its visibility is no longer
influenced by the handler and can be controlled independently via
IlvManager.setVisible(IlvGraphic, boolean, boolean)
.
By default, all objects are managed.
IlvManager.addManagerContentChangedListener(ilog.views.event.ManagerContentChangedListener)
,
IlvManager.removeManagerContentChangedListener(ilog.views.event.ManagerContentChangedListener)
,
IlvManager.addManagerTreeContentChangedListener(ilog.views.event.ManagerContentChangedListener)
,
IlvManager.removeManagerTreeContentChangedListener(ilog.views.event.ManagerContentChangedListener)
Constructor and Description |
---|
IlvLinkVisibilityHandler()
Creates a new link visibility handler.
|
Modifier and Type | Method and Description |
---|---|
void |
contentsChanged(ManagerContentChangedEvent evt)
This method is called by the manager to notify content modifications.
|
static void |
coupleLinkToNodeVisibility(IlvManager grapher,
boolean traverse,
boolean redraw)
Ensures that managed links that are currently in the grapher are visible
if and only if both end nodes are visible.
|
static boolean |
isManaged(IlvGraphic g)
Returns whether the visibility of the object is managed by a link
visibility handler.
|
static void |
setManaged(IlvGraphic g,
boolean managed)
Sets whether the visibility of the object is managed by a link
visibility handler.
|
public IlvLinkVisibilityHandler()
public void contentsChanged(ManagerContentChangedEvent evt)
contentsChanged
in interface ManagerContentChangedListener
evt
- The "content changed" event.IlvManager.addManagerContentChangedListener(ilog.views.event.ManagerContentChangedListener)
,
IlvManager.removeManagerContentChangedListener(ilog.views.event.ManagerContentChangedListener)
,
IlvManager.addManagerTreeContentChangedListener(ilog.views.event.ManagerContentChangedListener)
,
IlvManager.removeManagerTreeContentChangedListener(ilog.views.event.ManagerContentChangedListener)
public static void setManaged(IlvGraphic g, boolean managed)
IlvLinkVisibilityHandler
is installed as listener on
a grapher.
If an object is marked as managed, its visibility is only controlled by the handler. A managed link is invisible if one of its end nodes is invisible, and visible if both end nodes are visible. If the object is marked as unmanaged, its visibility is no longer influenced by the handler and can be controlled independently. By default, all objects are managed.
g
- The graphic object.managed
- Whether the visibility of the object is managed or not.isManaged(ilog.views.IlvGraphic)
public static boolean isManaged(IlvGraphic g)
IlvLinkVisibilityHandler
is installed as listener on
a grapher.
If an object is marked as managed, its visibility is only controlled by the handler. A managed link is invisible if one of its end nodes is invisible, and visible if both end nodes are visible. If the object is marked as unmanaged, its visibility is no longer influenced by the handler and can be controlled independently. By default, all objects are managed.
g
- The graphic object.setManaged(ilog.views.IlvGraphic, boolean)
public static void coupleLinkToNodeVisibility(IlvManager grapher, boolean traverse, boolean redraw)
IlvLinkVisibilityHandler
.
The purpose of this method is the following:
When a IlvLinkVisibilityHandler
is installed at a nonempty
grapher, the visibility of links of this grapher does not change right
away. The handler affects only subsequent operations when nodes are made
visible or invisible.
In order to change the link visibility right away to create a situation
consistent to the visibility-policy of the handler, this method can be
called just after installing the IlvLinkVisibilityHandler
.
It is not necessary to call this method when a
IlvLinkVisibilityHandler
is installed at an empty grapher.
grapher
- The grapher whose links should be examined.traverse
- If true
, the links of submanager are
examined as well.redraw
- Whether to redraw when changing visibility.setManaged(ilog.views.IlvGraphic, boolean)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.