public class IlvExpandCollapseUtil extends Object
IlvManager
.
This class contains static methods that are useful
when dealing with nested managers that are collapsed or expanded.Modifier and Type | Class and Description |
---|---|
static interface |
IlvExpandCollapseUtil.CustomAdjustmentPolicy
Policy how to adjust the contents of a manager after a submanager
was collapsed or expanded.
|
Modifier and Type | Method and Description |
---|---|
static void |
expandOrCollapse(IlvManager manager,
IlvExpandCollapseUtil.CustomAdjustmentPolicy policy,
int mode,
boolean collapse,
IlvApplyObject collapseApply,
IlvTransformer t,
boolean redraw)
Expands or collapses the input manager and adjusts the remaining
nodes and links to avoid overlaps.
|
static void |
expandOrCollapse(IlvManager manager,
IlvExpandCollapseUtil.CustomAdjustmentPolicy policy,
int mode,
boolean collapse,
IlvTransformer t,
boolean redraw)
Expands or collapses the input manager and adjusts the remaining
nodes and links to avoid overlaps.
|
static void |
expandOrCollapse(IlvManager manager,
int adjustmentPolicy,
boolean collapse,
IlvTransformer t,
boolean redraw)
Expands or collapses the input manager and adjusts the remaining
nodes and links to avoid overlaps.
|
public static final int FLAT
1
.public static final int RECURSIVE
public static final int STABLE
public static final int NONE
public static final int ORTHOGONAL_WITH_LINKS
public static final int ORTHOGONAL_WITHOUT_LINKS
public static final int ORTHOGONAL_RECURSIVE_WITH_LINKS
public static final int ORTHOGONAL_RECURSIVE_WITHOUT_LINKS
public static final int ORTHOGONAL_STABLE_WITH_LINKS
public static final int ORTHOGONAL_STABLE_WITHOUT_LINKS
public static final int RADIAL_WITH_LINKS
public static final int RADIAL_WITHOUT_LINKS
public static final int RADIAL_RECURSIVE_WITH_LINKS
public static final int RADIAL_RECURSIVE_WITHOUT_LINKS
public static final int RADIAL_STABLE_WITH_LINKS
public static final int RADIAL_STABLE_WITHOUT_LINKS
public static final IlvExpandCollapseUtil.CustomAdjustmentPolicy orthWithLinksPolicy
ORTHOGONAL_WITH_LINKS
,
ORTHOGONAL_RECURSIVE_WITH_LINKS
,
ORTHOGONAL_STABLE_WITH_LINKS
public static final IlvExpandCollapseUtil.CustomAdjustmentPolicy orthWithoutLinksPolicy
ORTHOGONAL_WITHOUT_LINKS
,
ORTHOGONAL_RECURSIVE_WITHOUT_LINKS
,
ORTHOGONAL_STABLE_WITHOUT_LINKS
public static final IlvExpandCollapseUtil.CustomAdjustmentPolicy radialWithLinksPolicy
RADIAL_WITH_LINKS
,
RADIAL_RECURSIVE_WITH_LINKS
,
RADIAL_STABLE_WITH_LINKS
public static final IlvExpandCollapseUtil.CustomAdjustmentPolicy radialWithoutLinksPolicy
RADIAL_WITHOUT_LINKS
,
RADIAL_RECURSIVE_WITHOUT_LINKS
,
RADIAL_STABLE_WITHOUT_LINKS
public static void expandOrCollapse(IlvManager manager, IlvExpandCollapseUtil.CustomAdjustmentPolicy policy, int mode, boolean collapse, IlvTransformer t, boolean redraw)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
to change the collapse flag of the input manager and then shifts the
remaining nodes to make space for the expanded or collapsed node.
This works only if the input manager is directly contained in a manager.
Note that the contents of input manager is not laid out by this operation.
It should already be laid out before expanding the manager.
After expanding or collapsing the manager, the input adjustment policy
is applied. This policy can position the manager, or shift other nodes
around to make space when the expanded manager requires more space then
the collapsed manager. This is useful when no incremental graph layout
is used to adapt the expanded or collapsed situation.
The mode
parameter specifies how the policy is applied:
FLAT
- The policy is only applied to the contents of
the parent of the input manager. This is fast and sufficient if
the nesting depth is only 1. RECURSIVE
- The policy is applied recursively to all
ancestors of the input manager. This is slower, but ensures
that all ancestors provide space that becomes necessary when
a deeply nested manager is expanded or collapsed.
The mechanism is not necessarily stable in the sense that
expanding and recollapsing a manager does not necessarily
produce the same situation as at the beginning. STABLE
- The policy is applied recursively to all
ancestors of the input manager. This is the slowest variant.
It ensure stability, i.e. expanding and recollapsing
a manager produce approximately the same situation as at the
beginning. (Small rounding errors might occur in the positions).
The stable mode works only correctly when the policy itself is
also stable (see IlvExpandCollapseUtil.CustomAdjustmentPolicy
). manager
- The manager to be expanded or collapsed.policy
- A custom adjustment policy (can be null
.mode
- The mode how the custom policy is applied.collapse
- If true
, then collapse, otherwise expand.t
- The transformer to draw the manager itself (not to draw the
contents of the manager).redraw
- Whether to redraw the manager.public static void expandOrCollapse(IlvManager manager, int adjustmentPolicy, boolean collapse, IlvTransformer t, boolean redraw)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
to change the collapse flag of the input manager and then shifts the
remaining nodes to make space for the expanded or collapsed node.
This works only if the input manager is directly contained in a manager.
Note that the contents of input manager is not laid out by this operation.
It should already be laid out before expanding the manager.
After expanding or collapsing the manager, the adjustment policy is applied. This is useful when no incremental graph layout is used to adapt the expanded or collapsed situation. The policy shifts nodes (and optionally also links) to make space when the expanded manager requires more space then the collapsed manager. The adjustment policy parameter allows to choose one of the default adjustment policies:
NONE
- No adjustment policy is applied. The manager is
only collapsed or expanded.
ORTHOGONAL_WITH_LINKS
-
An orthogonal transformation is applied to nodes and link bends
in order to adjust the space of the expanded node.
The policy is only applied to the contents of
the parent of the input manager. This is fast and sufficient if
the nesting depth is only 1.
ORTHOGONAL_WITHOUT_LINKS
An orthogonal transformation is applied to nodes (not to links)
in order to adjust the space of the expanded node.
This is useful when all links are straight, or when a separate
link layout runs afterwards to adjust the links.
The policy is only applied to the contents of
the parent of the input manager. This is fast and sufficient if
the nesting depth is only 1.
ORTHOGONAL_RECURSIVE_WITH_LINKS
An orthogonal transformation is applied to nodes and link bends
in order to adjust the space of the expanded node.
The policy is applied recursively to all
ancestors of the input manager. This is slower, but ensures
that all ancestors provide space that becomes necessary when
a deeply nested manager is expanded or collapsed.
The mechanism is not necessarily stable in the sense that
expanding and recollapsing a manager does not necessarily
produce the same situation as at the beginning.
ORTHOGONAL_RECURSIVE_WITHOUT_LINKS
An orthogonal transformation is applied to nodes (not to links)
in order to adjust the space of the expanded node.
This is useful when all links are straight, or when a separate
link layout runs afterwards to adjust the links.
The policy is applied recursively to all
ancestors of the input manager. This is slower, but ensures
that all ancestors provide space that becomes necessary when
a deeply nested manager is expanded or collapsed.
The mechanism is not necessarily stable in the sense that
expanding and recollapsing a manager does not necessarily
produce the same situation as at the beginning.
ORTHOGONAL_STABLE_WITH_LINKS
An orthogonal transformation is applied to nodes and link bends
in order to adjust the space of the expanded node.
The policy is applied recursively to all
ancestors of the input manager. This is the slowest variant.
It ensure stability, i.e. expanding and recollapsing
a manager produce approximately the same situation as at the
beginning. (Small rounding errors might occur in the positions).
ORTHOGONAL_STABLE_WITHOUT_LINKS
An orthogonal transformation is applied to nodes (not to links)
in order to adjust the space of the expanded node.
This is useful when all links are straight, or when a separate
link layout runs afterwards to adjust the links.
The policy is applied recursively to all
ancestors of the input manager. This is the slowest variant.
If the links are straight, it ensure stability, i.e. expanding
and recollapsing a manager produce approximately the same situation
as at the beginning. (Small rounding errors might occur in the
positions). If a separate link layout runs after expand/collapse,
then the links should be straightened before expand/collapse
to improve the stability.
RADIAL_WITH_LINKS
A radial transformation is applied to nodes and link bends
in order to adjust the space of the expanded node.
The policy is only applied to the contents of
the parent of the input manager. This is fast and sufficient if
the nesting depth is only 1.
RADIAL_WITHOUT_LINKS
A radial transformation is applied to nodes (not to links)
in order to adjust the space of the expanded node.
This is useful when all links are straight, or when a separate
link layout runs afterwards to adjust the links.
The policy is only applied to the contents of
the parent of the input manager. This is fast and sufficient if
the nesting depth is only 1.
RADIAL_RECURSIVE_WITH_LINKS
A radial transformation is applied to nodes and link bends
in order to adjust the space of the expanded node.
The policy is applied recursively to all
ancestors of the input manager. This is slower, but ensures
that all ancestors provide space that becomes necessary when
a deeply nested manager is expanded or collapsed.
The mechanism is not necessarily stable in the sense that
expanding and recollapsing a manager does not necessarily
produce the same situation as at the beginning.
RADIAL_RECURSIVE_WITHOUT_LINKS
A radial transformation is applied to nodes (not to links)
in order to adjust the space of the expanded node.
This is useful when all links are straight, or when a separate
link layout runs afterwards to adjust the links.
The policy is applied recursively to all
ancestors of the input manager. This is slower, but ensures
that all ancestors provide space that becomes necessary when
a deeply nested manager is expanded or collapsed.
The mechanism is not necessarily stable in the sense that
expanding and recollapsing a manager does not necessarily
produce the same situation as at the beginning.
RADIAL_STABLE_WITH_LINKS
A radial transformation is applied to nodes and link bends
in order to adjust the space of the expanded node.
The policy is applied recursively to all
ancestors of the input manager. This is the slowest variant.
It ensure stability, i.e. expanding and recollapsing
a manager produce approximately the same situation as at the
beginning. (Small rounding errors might occur in the positions).
RADIAL_STABLE_WITHOUT_LINKS
A radial transformation is applied to nodes (not to links)
in order to adjust the space of the expanded node.
This is useful when all links are straight, or when a separate
link layout runs afterwards to adjust the links.
The policy is applied recursively to all
ancestors of the input manager. This is the slowest variant.
If the links are straight, it ensure stability, i.e. expanding
and recollapsing a manager produce approximately the same situation
as at the beginning. (Small rounding errors might occur in the
positions). If a separate link layout runs after expand/collapse,
then the links should be straightened before expand/collapse
to improve the stability.
manager
- The manager to be expanded or collapsed.adjustmentPolicy
- The policy how to adjust the remaining nodes
and links.collapse
- If true
, then collapse, otherwise expand.t
- The transformer to draw the manager itself (not to draw the
contents of the manager).redraw
- Whether to redraw the manager.public static void expandOrCollapse(IlvManager manager, IlvExpandCollapseUtil.CustomAdjustmentPolicy policy, int mode, boolean collapse, IlvApplyObject collapseApply, IlvTransformer t, boolean redraw)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
to change the collapse flag of the input manager and then shifts the
remaining nodes to make space for the expanded or collapsed node.
This works only if the input manager is directly contained in a manager.
Note that the contents of input manager is not laid out by this operation.
It should already be laid out before expanding the manager.
After expanding or collapsing the manager, the input adjustment policy
is applied. This policy can position the manager, or shift other nodes
around to make space when the expanded manager requires more space then
the collapsed manager. This is useful when no incremental graph layout
is used to adapt the expanded or collapsed situation.
The mode
parameter specifies how the policy is applied:
FLAT
- The policy is only applied to the contents of
the parent of the input manager. This is fast and sufficient if
the nesting depth is only 1. RECURSIVE
- The policy is applied recursively to all
ancestors of the input manager. This is slower, but ensures
that all ancestors provide space that becomes necessary when
a deeply nested manager is expanded or collapsed.
The mechanism is not necessarily stable in the sense that
expanding and recollapsing a manager does not necessarily
produce the same situation as at the beginning. STABLE
- The policy is applied recursively to all
ancestors of the input manager. This is the slowest variant.
It ensure stability, i.e. expanding and recollapsing
a manager produce approximately the same situation as at the
beginning. (Small rounding errors might occur in the positions).
The stable mode works only correctly when the policy itself is
also stable (see IlvExpandCollapseUtil.CustomAdjustmentPolicy
). collapeApply
parameter is an apply object that actually
executes the collapsing of a single manager. It decides whether to
collapse or expand depending on the second parameter of
IlvApplyObject.apply(ilog.views.IlvGraphic, java.lang.Object)
which is passed as Boolean. A simple default
example implementation of the collapseApply
parameter is
this:
new IlvApplyObject() { public void apply(IlvGraphic g, Object arg) { ((IlvManager)g).setCollapsed(((Boolean)arg).booleanValue()); } }
manager
- The manager to be expanded or collapsed.policy
- A custom adjustment policy (can be null
.mode
- The mode how the custom policy is applied.collapse
- If true
, then collapse, otherwise expand.collapseApply
- An apply object that actually executed the collapse.t
- The transformer to draw the manager itself (not to draw the
contents of the manager).redraw
- Whether to redraw the manager.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.