public class IlvRecursiveMultipleLayout extends IlvRecursiveLayout implements LabelLayoutEventListener
This is not a layout algorithm but rather a facility to perform multiple layouts recursively in a nested graph. In principle, this is just the combination of Recursive Layout and Multiple Layout.
Unless otherwise mentioned, the normal layout algorithms such as
IlvHierarchicalLayout
,
IlvTreeLayout
, IlvMultipleLayout
, and so forth work
on a flat graph, that is, they lay out the attached graph but not the
subgraphs of the attached graph. Similarly, label layout algorithms
work only on flat managers, not on nested graphs. The Recursive
Multiple Layout is different: it traverses the nesting structure
starting from the attached graph and recursively applies a first graph
layout, then a second graph layout, and finally a label layout on all
subgraphs. It can be tailored for which sublayouts have to be applied
to which subgraph.
The Recursive Multiple Layout is a Recursive Layout (see IlvRecursiveLayout
) where all layouts of subgraphs are Multiple
Layouts (see IlvMultipleLayout
).
For instance, assume that you want to apply to each subgraph a Tree
layout, then a Link layout for the nontree links, and finally a Label
layout for the link labels. It would be unfortunate to call IlvGraphLayout.performLayout(boolean, boolean, boolean)
multiple
times to achieve this, because the tree layout of the parent graph
would be finished before the link layout of its subgraph has started;
hence the link layout of the subgraph invalidates the tree layout of
the parent graph again. To avoid this effect, the Tree layout, Link
layout, and Label layout of the subgraph should be finished before
any layout of the parent graph has started. The following examples
shows how to achieve this by using the Recursive Multiple Layout
class. There are basically two scenarios:
To perform a Tree Layout, a Link Layout, and an Annealing Label Layout on a nested graph, call:
IlvGraphLayout layout = new IlvMultipleRecursiveLayout( new IlvTreeLayout(), new IlvLinkLayout(), new IlvAnnealingLabelLayout()); layout.attach(grapher); layout.performLayout(true, true);If you simply want to apply a label layout in a nested grapher, call:
IlvGraphLayout layout = new IlvMultipleRecursiveLayout( new IlvAnnealingLabelLayout()); layout.attach(grapher); layout.performLayout(true, true);In this case, each subgraph is treated bottom-up. First a tree layout is performed on the subgraph. Then a link layout is performed on the subgraph, finally the label layout is performed on the subgraph. All subgraphs of the nested graph including the top-level graph are treated in this way. All layouts are performed with the same global layout parameters as the layout instances passed as arguments to the constructor of
IlvRecursiveMultipleLayout
, which
are called the reference layouts. You can access the reference
layout instances to change the global layout parameters:
IlvTreeLayout treeLayout = (IlvTreeLayout)layout.getFirstReferenceGraphLayout(); treeLayout.setFlowDirection(IlvDirection.Left); IlvLinkLayout linkLayout = (IlvLinkLayout)layout.getSecondReferenceGraphLayout(); linkLayout.setLinkOffset(5); IlvAnnealingLabelLayout labelLayout = (IlvAnnealingLabelLayout)layout.getReferenceLabelLayout(); labelLayout.setObstacleOffset(20);Internally, a clone of the reference instance is created for each subgraph. This clone remains attached as long as the Recursive Multiple Layout is attached to the top-level graph. Before layout is performed, the global layout parameters are copied from the reference instance to each clone. If you need to set layout parameters for individual nodes, links, or labels, you have to access the layout instance of the subgraph that owns the node, link, or label:
IlvTreeLayout treeLayout = (IlvTreeLayout)layout.getFirstGraphLayout(subgraph); treeLayout.setAlignment(node, IlvTreeLayout.TIP_OVER); IlvLinkLayout linkLayout = (IlvLinkLayout)layout.getSecondGraphLayout(subgraph); linkLayout.setLinkStyle(link, IlvLinkLayout.ORTHOGONAL_STYLE); IlvAnnealingLabelLayout labelLayout = (IlvAnnealingLabelLayout)layout.getLabelLayout(subgraph); labelLayout.setLabelDescriptor(label, descriptor);
In the typical case, when you use instances of IlvGraphic
as nodes and instances of IlvGrapher
as subgraphs, it is:
IlvTreeLayout treeLayout = (IlvTreeLayout)layout.getFirstGraphLayout(node.getGraphicBag()); treeLayout.setAlignment(node, IlvTreeLayout.TIP_OVER); ...
Second scenario: Different layout styles at different subgraphs
The following example shows the second scenario: Each subgraph should be laid out by a different layout style or with individual layout parameters. In this case, there are no reference layouts. You specify the layouts of subgraphs in a very convenient way:
IlvRecursiveMultipleLayout layout = new IlvRecursiveMultipleLayout(); layout.attach(topLevelGrapher); // specify the layout of the top-level graph layout.setLayout(null, new IlvGridLayout(), new IlvLinkLayout(), new IlvRandomLabelLayout()); // specify the layout of subgraphs layout.setLayout(subgraph1, new IlvTreeLayout(), new IlvLinkLayout(), new IlvAnnealingLabelLayout()); layout.setLayout(subgraph2, new IlvHierarchicalLayout(), new IlvLinkLayout(), new IlvAnnealingLabelLayout()); // perform the layout IlvLayoutReport report = layout.performLayout(true, true);In this scenario, all layout parameters of different subgraphs are independent. You access the layout instance of each individual subgraph in the same way as when you have a reference layout. This allows you to change global layout parameters for this subgraph as well as parameters of nodes , links, or labels of the subgraph.
Notes:
IlvRecursiveLayout
.layout = new IlvRecursiveLayout(new IlvRecursiveMultipleLayout()); layout.performLayout(true, true);This would traverse the nested graph and perform the Recursive Layout for each subgraph, which, however, itself would recursively traverse the nested graph again. This would just be waste of run time.
IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
. Modifier and Type | Field and Description |
---|---|
static int |
ACTIVE
The sublayout is active for all subgraphs.
|
static int |
INACTIVE
The sublayout is inactive for all subgraphs.
|
static int |
MIXED
The sublayout can be active or inactive for individual subgraphs.
|
INTERNAL_PROVIDER_MODE, PROPAGATE_CLASS_MISMATCH, PROPAGATE_EXCEPTION, PROPAGATE_PARAMETER_AMBIGUOUS, PROPAGATE_PARAMETER_MISMATCH, PROPAGATE_PARAMETER_SET, REFERENCE_LAYOUT_MODE, SPECIFIED_PROVIDER_MODE
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvRecursiveMultipleLayout()
Creates a new instance of the Recursive Multiple Layout algorithm
that allows you to apply layouts to the entire nested graph.
|
IlvRecursiveMultipleLayout(IlvGraphLayout referenceLayout1,
IlvGraphLayout referenceLayout2)
Creates a new instance of the Recursive Multiple Layout algorithm.
|
IlvRecursiveMultipleLayout(IlvGraphLayout referenceLayout1,
IlvGraphLayout referenceLayout2,
IlvLabelLayout referenceLayout3)
Creates a new instance of the Recursive Multiple Layout algorithm
that allows you to apply the reference layouts to the entire nested
graph.
|
IlvRecursiveMultipleLayout(IlvLabelLayout referenceLayout)
Creates a new instance of the Recursive Multiple Layout algorithm
that allows you to apply the reference label layout to the entire
nested graph.
|
IlvRecursiveMultipleLayout(IlvRecursiveMultipleLayout source)
Creates a new layout instance by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
addSubLabelLayoutEventListener(LabelLayoutEventListener listener)
Adds a listener for the layout events delivered during the label
layout of subgraphs.
|
void |
attach(IlvGraphModel graphModel)
Allows you to specify the top-level graph model of the nested graph
you want to lay out.
|
IlvGraphLayout |
copy()
Copies the layout instance.
|
void |
copyParameters(IlvGraphLayout source)
Copies the parameters from a given layout instance.
|
void |
detach()
Detaches the graph model from the layout instance.
|
IlvGraphLayout |
getFirstGraphLayout(Object subgraph)
Returns the layout instance to be used for the input subgraph as the
first layout.
|
int |
getFirstGraphLayoutActive()
Returns whether the first graph layout of all subgraphs is active.
|
int |
getFirstGraphLayoutActiveDuringAutoLayout()
Tests if the first graph layout of all subgraphs is active during
automatic layout.
|
IlvGraphLayout |
getFirstReferenceGraphLayout()
Returns the first reference graph layout, if the reference layout mode
is used.
|
IlvLabelLayout |
getLabelLayout(Object subgraph)
Returns the layout instance to be used for the input subgraph as the
label layout.
|
int |
getLabelLayoutActive()
Returns whether the label layout of all subgraphs is active.
|
int |
getLabelLayoutActiveDuringAutoLayout()
Tests if the label layout of all subgraphs is active during automatic
layout.
|
IlvGraphLayout |
getLayout(Object subgraph)
Returns the layout instance to be used for the input subgraph.
|
IlvLabelingModel |
getReferenceLabelingModel()
Returns the reference labeling model used for the label layout.
|
IlvLabelLayout |
getReferenceLabelLayout()
Returns the reference label layout, if the reference layout mode is
used.
|
IlvGraphLayout |
getSecondGraphLayout(Object subgraph)
Returns the layout instance to be used for the input subgraph as the
second layout.
|
int |
getSecondGraphLayoutActive()
Tests if the second graph layout of all subgraphs is active.
|
int |
getSecondGraphLayoutActiveDuringAutoLayout()
Tests if the second graph layout of all subgraphs is active during
automatic layout.
|
IlvGraphLayout |
getSecondReferenceGraphLayout()
Returns the second reference graph layout, if the reference layout
mode is used.
|
protected void |
init()
Initializes instance variables.
|
void |
layoutStepPerformed(GraphLayoutEvent event)
This method is called by the graph layouts of subgraphs.
|
void |
layoutStepPerformed(LabelLayoutEvent event)
This method is called by the label layout.
|
protected int |
performSublayout(Object subgraph,
IlvGraphLayout layout,
boolean force,
boolean redraw)
Starts the input layout algorithm.
|
void |
propagateFirstGraphLayoutActive(boolean active)
Sets whether the first graph layout of all subgraphs is active.
|
void |
propagateLabelLayoutActive(boolean active)
Sets whether the label layout of all subgraphs is active.
|
void |
propagateSecondGraphLayoutActive(boolean active)
Sets whether the second graph layout of all subgraphs is active.
|
void |
removeSubLabelLayoutEventListener(LabelLayoutEventListener listener)
Removes a listener for the layout events delivered during the label
layout of subgraphs.
|
void |
setFirstGraphLayoutActive(boolean active)
Deprecated.
Beginning with JViews 8.1, use
propagateFirstGraphLayoutActive(boolean) instead. |
void |
setFirstGraphLayoutActive(int value)
Sets whether the first graph layout of all subgraphs is active.
|
void |
setFirstGraphLayoutActiveDuringAutoLayout(int active)
Sets whether the first graph layout of all subgraphs is active during
automatic layout.
|
void |
setLabelLayoutActive(boolean active)
Deprecated.
Beginning with JViews 8.1, use
propagateLabelLayoutActive(boolean) instead. |
void |
setLabelLayoutActive(int value)
Sets whether the label layout of all subgraphs is active.
|
void |
setLabelLayoutActiveDuringAutoLayout(int active)
Sets whether the label layout of all subgraphs is active during
automatic layout.
|
void |
setLayout(Object subgraph,
IlvGraphLayout layout)
Sets the layout instance to be used for the input subgraph.
|
void |
setLayout(Object subgraph,
IlvGraphLayout layout,
boolean detachPrevious,
boolean traverse)
Sets the layout instance to be used for the input subgraph.
|
void |
setLayout(Object subgraph,
IlvGraphLayout layout1,
IlvGraphLayout layout2)
Sets the layout instances to be used for the input subgraph.
|
void |
setLayout(Object subgraph,
IlvGraphLayout layout1,
IlvGraphLayout layout2,
IlvLabelLayout layout3)
Sets the layout instances to be used for the input subgraph.
|
void |
setReferenceLabelingModel(IlvLabelingModel model)
Sets the reference labeling model to be used for the label layouts.
|
void |
setSecondGraphLayoutActive(boolean active)
Deprecated.
Beginning with JViews 8.1, use
propagateSecondGraphLayoutActive(boolean) instead. |
void |
setSecondGraphLayoutActive(int value)
Sets whether the second graph layout of all subgraphs is active.
|
void |
setSecondGraphLayoutActiveDuringAutoLayout(int active)
Sets whether the second graph layout of all subgraphs is active during
automatic layout.
|
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, addSubLayoutEventListener, checkAppropriateLinks, contentsChanged, createLayoutGrapherProperty, createLayoutReport, getAllowedTime, getLayoutMode, getLayoutProvider, getLayoutReport, getLayouts, getReferenceLayout, getSubgraphCorrectionInterface, isGeometryUpToDate, isLoadLayoutModeFromNamesProperties, isParametersUpToDate, isSavePreferredLayoutsToNamedProperties, isStructureUpToDate, layout, performLayout, performLayout, performLayout, propagateAndApply, propagateLayoutOfConnectedComponents, propagateLayoutOfConnectedComponentsEnabled, propagateLayoutParameter, propagateLayoutParameter, propagateLayoutParameter, propagateLayoutParameter, propagateLayoutParameter, propagateLayoutParameter, propagateLayoutParameter, propagateLinkClipInterface, propagateLinkConnectionBoxInterface, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, removeSubLayoutEventListener, setAllowedTime, setAutoCheckAppropriateLinksEnabled, setAutoLayout, setConnectionPointCheckEnabled, setCoordinatesMode, setInputCheckEnabled, setLayoutRunning, setLinkCheckEnabled, setLoadLayoutModeFromNamesProperties, setMinBusyTime, setSavePreferredLayoutsToNamedProperties, setSubgraphCorrectionInterface, setUseDefaultParameters, stopImmediately, supportsAllowedTime, supportsPercentageComplete, supportsSaveParametersToNamedProperties, supportsStopImmediately, useAnimateRedraw
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, checkAppropriateLink, cleanGraphModel, cleanLink, cleanNode, clipAllLinks, clipLink, connectAllLinksToCenter, connectLinkToCenter, createLayoutLinkProperty, createLayoutNodeProperty, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getMovingNodes, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, increasePercentageComplete, isAnimate, isAutoLayout, isFitToView, isFixed, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutRunning, isLayoutTimeElapsed, isLocalRecursiveLayoutNeeded, isMemorySavings, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, PerformLayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAnimate, setAutoLayoutHandler, setBalanceSplineCurveThreshold, setFixed, setGeometryUpToDate, setGrapher, setGraphModel, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLinkClipInterface, setLinkConnectionBoxInterface, setMaxSplineCurveSize, setMemorySavings, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setStructureUpToDate, setUseSeedValueForRandomGenerator, supportsAnimation, supportsLayoutOfConnectedComponents, supportsLayoutRegion, supportsLinkClipping, supportsLinkConnectionBox, supportsMemorySavings, supportsPreserveFixedLinks, supportsPreserveFixedNodes, supportsRandomGenerator, supportsSplineRouting, unfixAllLinks, unfixAllNodes
public static final int ACTIVE
public static final int INACTIVE
public static final int MIXED
public IlvRecursiveMultipleLayout(IlvGraphLayout referenceLayout1, IlvGraphLayout referenceLayout2)
Use this constructor if you want to apply the same layout styles with
the same global layout parameters to all subgraphs of the nested
graph. The layout mode of this Recursive Multiple Layout is IlvRecursiveLayout.REFERENCE_LAYOUT_MODE
.
This constructor behaves like a recursive layout that contains a multiple layout. The code
layout = new IlvRecursiveMultipleLayout(layout1, layout2);is equivalent to
layout = new IlvRecursiveLayout( new IlvMultipleLayout(layout1, layout2));
The reference graph layouts must not be an instance of
IlvRecursiveLayout
.
To indicate the top-level grapher of the nesting hierarchy you want
to lay out, use the method attach(IlvGrapher)
. To
indicate the graph model of the top-level graph of the nesting
hierarchy to lay out, call attach(IlvGraphModel)
.
To perform the layout, call performLayout(boolean,
boolean)
.
referenceLayout1
- The first layout to be performed.referenceLayout2
- The second layout to be performed.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvGraphLayout.performLayout(boolean, boolean)
,
IlvRecursiveLayout.getLayoutMode()
public IlvRecursiveMultipleLayout(IlvGraphLayout referenceLayout1, IlvGraphLayout referenceLayout2, IlvLabelLayout referenceLayout3)
IlvRecursiveLayout.REFERENCE_LAYOUT_MODE
.
This constructor behaves basically like a Recursive Layout that contains a Multiple Layout. The code
layout = new IlvRecursiveMultipleLayout(layout1, layout2, layout3);is equivalent to
layout = new IlvRecursiveLayout( new IlvMultipleLayout(layout1, layout2, layout3));
The reference graph layouts must not be an instance of
IlvRecursiveLayout
.
To indicate the top-level grapher of the nesting hierarchy you want
to lay out, use the method attach(IlvGrapher)
.
To indicate the graph model of the top-level graph of the nesting
hierarchy you want to lay out, use the method
attach(IlvGraphModel)
.
To perform the layout, use the method performLayout(boolean,
boolean)
.
referenceLayout1
- The first layout to be performed.referenceLayout2
- The second layout to be performed.referenceLayout3
- The third layout to be performed.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvGraphLayout.performLayout(boolean, boolean)
,
IlvRecursiveLayout.getLayoutMode()
public IlvRecursiveMultipleLayout(IlvLabelLayout referenceLayout)
IlvRecursiveLayout.REFERENCE_LAYOUT_MODE
.
This constructor behaves basically like a Recursive Layout that contains a Multiple Layout that contains the label layout. The code
layout = new IlvRecursiveMultipleLayout(labelLayout);is equivalent to
layout = new IlvRecursiveLayout( new IlvMultipleLayout(null, null, labelLayout));
To indicate the top-level grapher of the nesting hierarchy you want
to lay out, use the method attach(IlvGrapher)
.
To indicate the graph model of the top-level graph of the nesting
hierarchy you want to lay out, use the method
attach(IlvGraphModel)
.
To perform the layout, use the method performLayout(boolean,
boolean)
.
public IlvRecursiveMultipleLayout()
setLayout(Object, IlvGraphLayout, IlvGraphLayout, IlvLabelLayout)
.
The layout mode of this Recursive Multiple Layout is IlvRecursiveLayout.INTERNAL_PROVIDER_MODE
.
To indicate the top-level grapher of the nesting hierarchy you want
to lay out, use the method attach(IlvGrapher)
.
To indicate the graph model of the top-level graph of the nesting
hierarchy you want to lay out, use the method
attach(IlvGraphModel)
.
To perform the layout, use the method performLayout(boolean,
boolean)
.
public IlvRecursiveMultipleLayout(IlvRecursiveMultipleLayout source)
copy()
method. Any subclass should
provide a copy constructor.
The parameters of the source
layout are copied using the
method copyParameters(IlvGraphLayout)
.
source
- The layout instance that is copied.copy()
,
copyParameters(ilog.views.graphlayout.IlvGraphLayout)
protected void init()
You should not call this method directly. The method is called internally by the constructor without arguments and by the copy constructor. The method must be overridden by subclasses that need to initialize additional instance variables.
init
in class IlvRecursiveLayout
public IlvGraphLayout copy()
This method copies the layout instance by calling the copy constructor. Note that the parameters which are specific to a node or a link are not copied. The reference labeling model is not copied. It depends on the layout mode what is copied:
IlvRecursiveLayout.REFERENCE_LAYOUT_MODE
- The reference layouts are
copied deeply.IlvRecursiveLayout.INTERNAL_PROVIDER_MODE
- The information which subgraph
uses which sublayouts is not copied.copy
in class IlvRecursiveLayout
IlvRecursiveMultipleLayout(IlvRecursiveMultipleLayout)
,
copyParameters(IlvGraphLayout)
,
IlvRecursiveLayout.getLayoutMode()
public void copyParameters(IlvGraphLayout source)
IlvRecursiveLayout.REFERENCE_LAYOUT_MODE
- The reference layouts are
copied deeply.IlvRecursiveLayout.INTERNAL_PROVIDER_MODE
- The information which subgraph
uses which sublayouts is not copied.copyParameters
in class IlvRecursiveLayout
source
- The layout instance from which the parameters are copied.copy()
,
IlvRecursiveLayout.getLayoutMode()
public void setReferenceLabelingModel(IlvLabelingModel model)
If this layout instance is attached to a grapher or grapher adapter,
an IlvDefaultLabelingModel
is created internally and
attached to the label layout by default. You can use this method to
specify a different labeling model.
If you want to attach this layout instance to a graph model that is not based on a grapher, you must set the labeling model before attaching the Recursive Multiple Layout.
The reference labeling model is used to attach the label layout of
the top-level graph. Clones of the reference labeling model are used
to attach the label layout of subgraphs that are nested inside. The
clones are created by calling IlvLabelingModel.createLabelingModel(Object)
on the reference
labeling model.
Note that all these labeling models are disposed of when the layout
is detached and cannot be used afterwards. Therefore you have to call
setLabelingModel
each time immediately before attaching
it.
model
- The labeling model.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
public IlvLabelingModel getReferenceLabelingModel()
null
, an IlvDefaultLabelingModel
is used when possible.public IlvGraphLayout getFirstReferenceGraphLayout()
null
otherwise.
In reference layout mode, the reference layout is used to lay out the top-level graph. Clones of the reference layout are used to lay out the subgraphs. The entire nested graph is laid out with the global layout parameters of the reference layout. If you change global layout parameters of the reference layout, this will affect the layout of subgraphs as well, because the global layout parameters are copied from the reference layout to the layouts of the subgraphs.
public IlvGraphLayout getSecondReferenceGraphLayout()
null
otherwise.
In reference layout mode, the reference layout is used to lay out the top-level graph. Clones of the reference layout are used to lay out the subgraphs. The entire nested graph is laid out with the global layout parameters of the reference layout. If you change global layout parameters of the reference layout, this will affect the layout of subgraphs as well, because the global layout parameters are copied from the reference layout to the layouts of the subgraphs.
public IlvLabelLayout getReferenceLabelLayout()
null
otherwise.
In reference layout mode, the reference layout is used to lay out the top-level graph. Clones of the reference layout are used to lay out the subgraphs. The entire nested graph is laid out with the global layout parameters of the reference layout. If you change global layout parameters of the reference layout, this will affect the layout of subgraphs as well, because the global layout parameters are copied from the reference layout to the layouts of the subgraphs.
public void setLayout(Object subgraph, IlvGraphLayout layout)
IlvMultipleLayout
. If
null
is passed as the subgraph, the input layout is used
for the top-level graph. If null
is passed as the
layout, no layout will be performed for the corresponding subgraph.
You can use this method only in internal provider mode. You must attach a grapher or graph model first before using this method. Each subgraph must get a different layout instance, that is, the layout instances cannot be shared among different subgraphs. The input layout is automatically attached and detached by the Recursive Multiple Layout as needed.
setLayout
in class IlvRecursiveLayout
subgraph
- The subgraph or null
.layout
- The layout instance used to lay out the subgraph. This
can be null
, or must be an instance of
IlvMultipleLayout
.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
setLayout(Object, IlvGraphLayout, IlvGraphLayout, IlvLabelLayout)
,
IlvRecursiveLayout.getLayoutMode()
,
IlvRecursiveMultipleLayout()
,
getLayout(Object)
public void setLayout(Object subgraph, IlvGraphLayout layout, boolean detachPrevious, boolean traverse)
IlvMultipleLayout
. If the
traverse
flag is true
, it traverses the
nested graph starting from the input graph and sets a clone of the
input layout recursively for each subgraphs. Notice that if you
insert subgraphs after calling this method, the new subgraphs have no
layout yet assigned.
If null
is passed as the subgraph, the input layout is
used for the top-level graph, and the traversal, if any, starts at
the top-level graph. If null
is passed as the layout,
no layout will be performed for the corresponding subgraphs.
You can use this method only in internal provider mode. Each subgraph must get a different layout instance, that is, the layout instances cannot be shared among different subgraphs. You must attach a grapher or graph model first before using this method. The input layout is automatically attached and detached by the Recursive Multiple Layout as needed.
setLayout
in class IlvRecursiveLayout
subgraph
- The subgraph or null
.layout
- The layout instance used to lay out the subgraph. This
must be an instance of IlvMultipleLayout
.detachPrevious
- If true
, the layout instance
previously specified as the preferred layout of the subgraph (if
any) is detached.traverse
- If true
, clones of the input layout are
recursively used for all current subgraphs of the input graph.setLayout(Object, IlvGraphLayout)
,
IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
IlvRecursiveMultipleLayout()
,
getLayout(Object)
public void setLayout(Object subgraph, IlvGraphLayout layout1, IlvGraphLayout layout2)
null
is passed as the subgraph, the input layout is used
for the top-level graph. Internally, a Multiple Layout is created
that contains the input layouts as sublayouts.
When the Recursive Multiple Layout is performed, layout1
is applied first and layout2
second to the input
subgraph.
You can use this method only in internal provider mode. You must attach a grapher or graph model before using this method. Each subgraph must get different layout instances, that is, the layout instances cannot be shared among different subgraphs. The input layouts are automatically attached and detached by the recursive multiple layout as needed.
subgraph
- The subgraph or null
.layout1
- The first graph layout used to lay out the subgraph.layout2
- The second graph layout used to lay out the subgraph.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
IlvRecursiveMultipleLayout()
,
getLayout(Object)
,
getFirstGraphLayout(Object)
,
getSecondGraphLayout(Object)
public void setLayout(Object subgraph, IlvGraphLayout layout1, IlvGraphLayout layout2, IlvLabelLayout layout3)
null
is passed as the subgraph, the input layout is used
for the top-level graph. Internally, a Multiple Layout is created
that contains the input layouts as sublayouts.
When the Recursive Multiple Layout is performed, layout1
is applied first, layout2
second, and
layout3
last to the input subgraph.
You can use this method only in internal provider mode. You must attach a grapher or graph model first before using this method. Each subgraph must get different layout instances, that is, the layout instances cannot be shared among different subgraphs. The input layouts are automatically attached and detached by the Recursive Multiple Layout as needed.
subgraph
- The subgraph or null
.layout1
- The first graph layout used to lay out the subgraph.layout2
- The second graph layout used to lay out the subgraph.layout3
- The label layout used to lay out the subgraph.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
IlvRecursiveMultipleLayout()
,
getLayout(Object)
,
getFirstGraphLayout(Object)
,
getSecondGraphLayout(Object)
,
getLabelLayout(Object)
public IlvGraphLayout getFirstGraphLayout(Object subgraph)
null
is passed as the subgraph, the
layout instance of the top-level graph is returned. You can use this
method in all layout modes. You must attach a grapher or graph model
first before using this method. The method may return
null
if no layout should be performed for the subgraph.
In reference layout mode, changing global layout parameters of the layout instances of subgraphs is useless, because during layout, the global parameters of the first reference graph layout are used for each subgraph.
subgraph
- The subgraph or null
.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
setLayout(Object, IlvGraphLayout, IlvGraphLayout, IlvLabelLayout)
public IlvGraphLayout getSecondGraphLayout(Object subgraph)
null
is passed as the subgraph, the
layout instance of the top-level graph is returned. You can use this
method in all layout modes. You must attach a grapher or graph model
first before using this method. The method may return
null
if no layout should be performed for the subgraph.
In reference layout mode, changing global layout parameters of the layout instances of subgraphs is useless, because during layout, the global parameters of the second reference graph layout are used for each subgraph.
subgraph
- The subgraph or null
.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
setLayout(Object, IlvGraphLayout, IlvGraphLayout, IlvLabelLayout)
public IlvLabelLayout getLabelLayout(Object subgraph)
null
is passed as the subgraph, the
layout instance of the top-level graph is returned. You can use this
method in all layout modes. You must attach a grapher or graph model
first before using this method. The method may return
null
if no layout should be performed for the subgraph.
In reference layout mode, changing global layout parameters of the layout instances of subgraphs is useless, because during layout, the global parameters of the reference label layout are used for each subgraph.
subgraph
- The subgraph or null
.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
setLayout(Object, IlvGraphLayout, IlvGraphLayout, IlvLabelLayout)
public IlvGraphLayout getLayout(Object subgraph)
IlvMultipleLayout
. If
null
is passed as the subgraph, the layout instance of
the top-level graph is returned. You can use this method in all
layout modes. You must attach a grapher or graph model first before
using this method. The method may return null
if no
layout should be performed for the subgraph.
In reference layout mode, changing global layout parameters of the layout instances of subgraphs is useless, because during layout, the global parameters of the reference layout are used for each subgraph.
getLayout
in class IlvRecursiveLayout
subgraph
- The subgraph or null
.IlvGraphLayout.attach(ilog.views.IlvGrapher)
,
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel)
,
IlvRecursiveLayout.getLayoutMode()
,
setLayout(Object, IlvGraphLayout, boolean, boolean)
public void attach(IlvGraphModel graphModel)
IlvRecursiveLayout.REFERENCE_LAYOUT_MODE
. If
a label layout algorithm is used but no reference labeling model was
specified before, it tries to use an IlvDefaultLabelingModel
.
attach
in class IlvRecursiveLayout
graphModel
- The graph model.detach()
,
setReferenceLabelingModel(IlvLabelingModel)
public void detach()
IlvGraphLayout.attach(IlvGraphModel)
. The detach
method performs cleaning operations on the graph model. In addition
to the cleaning operations in the base class, the Recursive Multiple
Layout detaches the sublayouts of subgraphs and disposes of the
labeling models including the reference labeling model. In internal
provider mode, it also cleans all settings of layout instances for
subgraphs.
Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.
protected int performSublayout(Object subgraph, IlvGraphLayout layout, boolean force, boolean redraw) throws IlvGraphLayoutException
In addition to the functionality of the base class, the Recursive Multiple Layout prepares the sublayouts according to the layout mode.
performSublayout
in class IlvRecursiveLayout
subgraph
- The subgraph if used during nested layout, or
null
.layout
- The sublayout to be performed.force
- If true
, no check is made to determine if it
is necessary to perform the layout.redraw
- If true
, the attached graph model will be
asked to redraw the graph after layout.IlvGraphLayoutException
public void propagateFirstGraphLayoutActive(boolean active)
IlvGraphLayout.performLayout()
on the Recursive
Multiple layout instance.
In reference layout mode, it calls IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
at the
reference layout, which is in this case a Multiple Layout. If a graph
is attached and the layout mode is the internal provider mode, it
traverses the nesting hierarchy and calls IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
for all
Multiple Layout instances of subgraphs. However, if you insert
subgraphs after calling this method, or if you change the layout
instances of subgraphs in the internal provider after calling this
method, the new layouts of these subgraphs may have a different
setting.
This method throws a runtime exception when no graph model is yet attached.
active
- true
if the first graph layout is active, or
false
otherwise.getFirstGraphLayout(Object)
,
IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
,
IlvGraphLayout.performLayout()
public void propagateSecondGraphLayoutActive(boolean active)
IlvGraphLayout.performLayout()
on the Recursive Multiple layout
instance.
In reference layout mode, IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
is called at
the reference layout, which is in this case a Multiple Layout. If a
graph is attached and the layout mode is the internal provider mode,
it traverses the nesting hierarchy and calls IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
for all
Multiple Layout instances of subgraphs. If you insert subgraphs after
calling this method, or if you change the layout instances of
subgraphs in the internal provider after calling this method, the new
layouts of these subgraphs may have a different setting.
This method throws a runtime exception when no graph model is yet attached.
active
- Set to true
if the second graph layout is
active.getSecondGraphLayout(Object)
,
IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
,
IlvGraphLayout.performLayout()
public void propagateLabelLayoutActive(boolean active)
IlvGraphLayout.performLayout()
on the Recursive Multiple layout
instance.
In reference layout mode, it calls IlvMultipleLayout.setLabelLayoutActive(boolean)
at the reference
layout, which is in this case a Multiple Layout. If a graph is
attached and the layout mode is the internal provider mode, it
traverses the nesting hierarchy and calls IlvMultipleLayout.setLabelLayoutActive(boolean)
for all Multiple
Layout instances of subgraphs. However, if you insert subgraphs after
calling this method, or if you change the layout instances of
subgraphs in the internal provider after calling this method, the new
layouts of these subgraphs may have a different setting.
This method throws a runtime exception when no graph model is yet attached.
active
- true
if the label layout is active, or
false
otherwise.getLabelLayout(Object)
,
IlvMultipleLayout.setLabelLayoutActive(boolean)
,
IlvGraphLayout.performLayout()
public void setFirstGraphLayoutActive(boolean active)
propagateFirstGraphLayoutActive(boolean)
instead.public void setSecondGraphLayoutActive(boolean active)
propagateSecondGraphLayoutActive(boolean)
instead.public void setLabelLayoutActive(boolean active)
propagateLabelLayoutActive(boolean)
instead.public void setFirstGraphLayoutActive(int value)
IlvGraphLayout.performLayout()
, except for calls that
were triggered by automatic layout. See IlvRecursiveLayout.setAutoLayout(boolean)
for
more. Possible values are:
ACTIVE
: the first graph layout is active for all
subgraphs. INACTIVE
: the first graph layout is inactive for all
subgraphs. MIXED
: it is unspecified whether the first layout is
active or inactive for all subgraphs. Instead, it is possible to
specify for each subgraph individually by calling IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
to control
whether the first graph layout should be active or inactive. value
- Sets whether the first graph layout is active.IlvGraphLayout.performLayout()
,
IlvRecursiveLayout.setAutoLayout(boolean)
,
IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
,
propagateFirstGraphLayoutActive(boolean)
,
setFirstGraphLayoutActiveDuringAutoLayout(int)
,
getFirstGraphLayoutActive()
public int getFirstGraphLayoutActive()
IlvGraphLayout.performLayout()
, except for calls
triggered by automatic layout. See IlvRecursiveLayout.setAutoLayout(boolean)
for more
information.ACTIVE
is returned. If the first graph layout of all subgraphs is
inactive, INACTIVE
is returned. Otherwise MIXED
is returned.setFirstGraphLayoutActive(int)
public void setSecondGraphLayoutActive(int value)
IlvGraphLayout.performLayout()
, except calls triggered
by automatic layout (see IlvRecursiveLayout.setAutoLayout(boolean)
). Possible values
are:
ACTIVE
: the second graph layout is active for all
subgraphs. INACTIVE
: the second graph layout is inactive for all
subgraphs. MIXED
: it is unspecified whether the second layout is
active or inactive for all subgraphs. Instead, it is possible to
specify for each subgraph individually by calling IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
to control whether the
second graph layout should be active or inactive. value
- Sets whether the second graph layout is active.IlvGraphLayout.performLayout()
,
IlvRecursiveLayout.setAutoLayout(boolean)
,
IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
,
propagateSecondGraphLayoutActive(boolean)
,
setSecondGraphLayoutActiveDuringAutoLayout(int)
,
getSecondGraphLayoutActive()
public int getSecondGraphLayoutActive()
IlvGraphLayout.performLayout()
, except for calls
triggered by automatic layout (see IlvRecursiveLayout.setAutoLayout(boolean)
).ACTIVE
is returned. If the second graph layout of all subgraphs
is inactive, INACTIVE
is returned. Otherwise MIXED
is returned.setSecondGraphLayoutActive(int)
public void setLabelLayoutActive(int value)
IlvGraphLayout.performLayout()
except for calls triggered by
automatic layout. See IlvRecursiveLayout.setAutoLayout(boolean)
for more information.
Possible values are:
ACTIVE
: the label layout is active for all subgraphs.
INACTIVE
: the label layout is inactive for all
subgraphs. MIXED
: it is unspecified whether the label is active or
inactive for all subgraphs. Instead, it is possible to specify for
each subgraph individually by calling IlvMultipleLayout.setLabelLayoutActive(boolean)
to control whether
the label layout should be active or inactive. value
- Sets whether the label layout is active.IlvGraphLayout.performLayout()
,
IlvRecursiveLayout.setAutoLayout(boolean)
,
IlvMultipleLayout.setLabelLayoutActive(boolean)
,
propagateLabelLayoutActive(boolean)
,
setLabelLayoutActiveDuringAutoLayout(int)
,
getLabelLayoutActive()
public int getLabelLayoutActive()
IlvGraphLayout.performLayout()
except those calls that
were triggered by automatic layout (see IlvRecursiveLayout.setAutoLayout(boolean)
).ACTIVE
is returned. If the label layout of all subgraphs is inactive,
INACTIVE
is returned. Otherwise MIXED
is
returned.setLabelLayoutActive(int)
public void setFirstGraphLayoutActiveDuringAutoLayout(int active)
IlvRecursiveLayout.setAutoLayout(boolean)
) for more
information. Possible values are:
ACTIVE
: the first graph layout is active for all
subgraphs. INACTIVE
: the first graph layout is inactive for all
subgraphs. MIXED
: it is unspecified whether the first layout is
active or inactive for all subgraphs. Instead, it is possible to
specify for each subgraph individually by calling IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
to control whether the
first graph layout should be active or inactive. setFirstGraphLayoutActive(int)
) and
during automatic layout (this API). For example, if the first graph
layout positions the nodes and the second graph layout routes the
links, it allows you to specify that during automatic layout, only
the links should be routed. That is, the first graph layout must be
disabled, while during a full explicitly triggered layout, the first
graph layout must be enabled.
active
- Sets whether the first graph layout is active during
automatic layout.IlvGraphLayout.performAutoLayout()
,
IlvRecursiveLayout.setAutoLayout(boolean)
,
IlvMultipleLayout.setFirstGraphLayoutActive(boolean)
,
propagateFirstGraphLayoutActive(boolean)
,
setFirstGraphLayoutActive(int)
,
getFirstGraphLayoutActiveDuringAutoLayout()
public int getFirstGraphLayoutActiveDuringAutoLayout()
ACTIVE
is returned. If the first graph
layout of all subgraphs is inactive during automatic layout, INACTIVE
is returned. Otherwise MIXED
is returned.setFirstGraphLayoutActiveDuringAutoLayout(int)
public void setSecondGraphLayoutActiveDuringAutoLayout(int active)
IlvRecursiveLayout.setAutoLayout(boolean)
for more
information. Possible values are:
ACTIVE
: the second graph layout is active for all
subgraphs. INACTIVE
: the second graph layout is inactive for all
subgraphs. MIXED
: it is unspecified whether the second layout is
active or inactive for all subgraphs. Instead, it is possible to
specify for each subgraph individually by calling IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
to control whether the
second graph layout should be active or inactive. setSecondGraphLayoutActive(int)
) and
during automatic layout (this API). For example, if the first graph
layout positions the nodes and the second graph layout routes the
links, it allows you to specify that during automatic layout, only
the links should be routed. That is, the second graph layout must be
enabled, while during a full explicitly triggered layout, the second
graph layout might be disabled.
active
- Sets whether the second graph layout is active during
automatic layout.IlvGraphLayout.performAutoLayout()
,
IlvRecursiveLayout.setAutoLayout(boolean)
,
IlvMultipleLayout.setSecondGraphLayoutActive(boolean)
,
propagateSecondGraphLayoutActive(boolean)
,
setSecondGraphLayoutActive(int)
,
getSecondGraphLayoutActiveDuringAutoLayout()
public int getSecondGraphLayoutActiveDuringAutoLayout()
ACTIVE
is returned. If the second graph
layout of all subgraphs is inactive during automatic layout, INACTIVE
is returned. Otherwise MIXED
is returned.setSecondGraphLayoutActiveDuringAutoLayout(int)
public void setLabelLayoutActiveDuringAutoLayout(int active)
IlvRecursiveLayout.setAutoLayout(boolean)
for more information.
Possible values are:
ACTIVE
: the label layout is active for all subgraphs.
INACTIVE
: the label layout is inactive for all
subgraphs. MIXED
: it is unspecified whether the label is active or
inactive for all subgraphs. Instead, it is possible to specify for
each subgraph individually by calling IlvMultipleLayout.setLabelLayoutActive(boolean)
to control whether
the label layout should be active or inactive. setLabelLayoutActive(boolean)
) and
during automatic layout (this API). For instance, it allows you to
specify that during automatic layout, only the labels should be
placed. That is, the label layout must be enabled, while during a
full explicitly triggered layout, the label might be disabled.
active
- Sets whether the label layout is active during automatic
layout.IlvGraphLayout.performAutoLayout()
,
IlvRecursiveLayout.setAutoLayout(boolean)
,
IlvMultipleLayout.setLabelLayoutActive(boolean)
,
propagateLabelLayoutActive(boolean)
,
setLabelLayoutActive(boolean)
,
getLabelLayoutActiveDuringAutoLayout()
public int getLabelLayoutActiveDuringAutoLayout()
ACTIVE
is returned. If the label layout of all
subgraphs is inactive during automatic layout, INACTIVE
is
returned. Otherwise MIXED
is returned.setLabelLayoutActiveDuringAutoLayout(int)
public void addSubLabelLayoutEventListener(LabelLayoutEventListener listener)
This listener does not receive the layout events from the Recursive
Layout, but rather the events for the label layouts of the subgraphs
(that is, event.getSource()
returns the label layout,
not the Recursive Layout. If you want to receive events from the
Recursive Layout itself, please use IlvGraphLayout.addGraphLayoutEventListener(GraphLayoutEventListener)
on the
Recursive Multiple Layout instance instead.
listener
- The listener.removeSubLabelLayoutEventListener(ilog.views.graphlayout.labellayout.LabelLayoutEventListener)
,
layoutStepPerformed(ilog.views.graphlayout.GraphLayoutEvent)
public void removeSubLabelLayoutEventListener(LabelLayoutEventListener listener)
listener
- The listener.addSubLabelLayoutEventListener(ilog.views.graphlayout.labellayout.LabelLayoutEventListener)
public void layoutStepPerformed(GraphLayoutEvent event)
layoutStepPerformed
in interface GraphLayoutEventListener
layoutStepPerformed
in class IlvRecursiveLayout
event
- The layout event that may contain information about the
behavior of the layout algorithm.GraphLayoutEvent.getLayoutReport()
public void layoutStepPerformed(LabelLayoutEvent event)
layoutStepPerformed
in interface LabelLayoutEventListener
event
- The layout event that may contain information about the
behavior of the layout algorithm.LabelLayoutEvent.getLayoutReport()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.