public interface IlpGraphLayoutSupport
Modifier and Type | Method and Description |
---|---|
void |
attach(IlpGraphView view)
Attaches this object to a given view.
|
IlvGraphModel |
createGraphModel()
Creates the graph model used for the manager content.
|
void |
detach()
Detaches this object from its current view.
|
int |
getAutoLayoutIndex()
Returns the index of the graph layout that should
be executed automatically when the view contents
change.
|
int |
getAutoLayoutIndex(IlpRepresentationObject ro)
Returns the index of the graph layout that should
be executed automatically in the subnetwork when the view
contents change.
|
IlvGraphLayout[] |
getGraphLayouts()
Returns the list of graph layouts that have been
configured to this view.
|
IlvGraphLayout[] |
getGraphLayouts(IlpRepresentationObject ro)
Returns the list of graph layouts that have been
configured to the given subnetwork object.
|
IlvGraphLayout |
getGraphLayouts(IlpRepresentationObject ro,
int index)
Returns the graph layout that is configured at the given
index for the given subnetwork object.
|
IlvGraphLayout |
getGraphLayouts(int index)
Returns the graph layout that is configured at the given
index.
|
IlvGraphLayout |
getLinkLayout()
Returns the graph layout for links.
|
IlvGraphLayout |
getLinkLayout(IlpRepresentationObject ro)
Returns the graph layout for links in the subnetwork of the given
representation object.
|
IlvGraphLayout |
getNodeLayout()
Returns the graph layout of the view for nodes.
|
void |
optimizeLayout()
Applies the registered node and/or a link layout algorithm to the manager
content.
|
void |
performAttachedLayout(int index)
Applies a given graph layout algorithm once to the manager content.
|
void |
performLayoutOnce(IlvGraphLayout layout,
Runnable initializations,
Runnable postprocessing)
Applies a given graph layout algorithm once to the manager content.
|
void |
setAutoLayoutIndex(IlpRepresentationObject ro,
int index)
Sets the index of the graph layout that should be
executed automatically in the subnetwork objects when the
view contents change.
|
void |
setAutoLayoutIndex(int index)
Sets the index of the graph layout that should be
executed automatically when the view contents change.
|
void |
setGraphLayouts(IlpRepresentationObject ro,
IlvGraphLayout[] layouts)
Changes the layouts that can be applied to the subnetwork that
represents the given representation object.
|
void |
setGraphLayouts(IlpRepresentationObject ro,
int index,
IlvGraphLayout layout)
Sets a new graph layout to this subnetwork representation object.
|
void |
setGraphLayouts(IlvGraphLayout[] layouts)
Changes the layouts that can be applied to this view.
|
void |
setGraphLayouts(int index,
IlvGraphLayout layout)
Sets a new graph layout to this view.
|
void |
setLinkLayout(IlpRepresentationObject ro,
IlvGraphLayout layout)
Changes the link layout of subnetwork for the given representation
object.
|
void |
setLinkLayout(IlvGraphLayout layout,
boolean relayout)
Changes the link layout of this view.
|
void |
setNodeLayout(IlvGraphLayout layout,
boolean relayout)
Changes the node layout of this view.
|
void attach(IlpGraphView view)
void detach()
void setGraphLayouts(IlvGraphLayout[] layouts)
One of the graph layouts can be configured to run automatically
when the view contents change. The layout that should be
run automatically has to be defined using method
setAutoLayoutIndex(int)
.
The other layouts can be executed on demand using
method performAttachedLayout(int)
layouts
- Graph layoutsgetGraphLayouts()
,
setAutoLayoutIndex(int)
,
performAttachedLayout(int)
IlvGraphLayout[] getGraphLayouts()
setGraphLayouts(IlvGraphLayout[])
void setGraphLayouts(int index, IlvGraphLayout layout)
index
- Layout indexlayout
- LayoutIlvGraphLayout getGraphLayouts(int index)
index
- Layout indexnull
if none is defined.void setAutoLayoutIndex(int index)
Default value is 0.
index
- Layout indexint getAutoLayoutIndex()
-1
if none
shall be executed automatically.IlvGraphLayout getNodeLayout()
null
if none has been specified.void setNodeLayout(IlvGraphLayout layout, boolean relayout)
Use this function with relayout
set to false
if you need to set some layout parameters after the layout has been
attached. This is needed for setting the layout region and for passing
any layout proxies to the graph layout (for example, using
IlvBusLayout.setBus(ilog.views.IlvPolyPointsInterface)
,
IlvTreeLayout.setRoot(java.lang.Object)
or
IlvCircularLayout.setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)
.
This method corresponds to:
setGraphLayouts(new IlvGraphLayout[] { layout }); setAutoLayoutIndex(0); if (relayout) optimizeLayout();
layout
- A graph layout or null
.relayout
- Specifies whether the layout optimizers should be called
immediately.setGraphLayouts(IlvGraphLayout[])
,
setGraphLayouts(int, IlvGraphLayout)
IlvGraphLayout getLinkLayout()
null
if none has been specified.void setLinkLayout(IlvGraphLayout layout, boolean relayout)
If layout
is null
, and the node layout does
not update links, a default link layout is substituted. It can be
obtained using getLinkLayout()
.
layout
- A graph layout or null
.relayout
- Indicates if the layout should be applied immediately.void setGraphLayouts(IlpRepresentationObject ro, IlvGraphLayout[] layouts)
One of the graph layouts can be configured to run automatically
when the view contents change. The layout that should be
run automatically has to be defined using method
setAutoLayoutIndex(IlpRepresentationObject, int)
.
The other layouts can be executed on demand using
method performAttachedLayout(int)
ro
- Subnetwork representation objectlayouts
- Graph layoutsgetGraphLayouts(IlpRepresentationObject)
,
setAutoLayoutIndex(IlpRepresentationObject, int)
,
performAttachedLayout(int)
IlvGraphLayout[] getGraphLayouts(IlpRepresentationObject ro)
ro
- Subnetwork representation objectsetGraphLayouts(IlpRepresentationObject, IlvGraphLayout[])
void setGraphLayouts(IlpRepresentationObject ro, int index, IlvGraphLayout layout)
ro
- Subnetwork representation objectindex
- Layout indexlayout
- LayoutIlvGraphLayout getGraphLayouts(IlpRepresentationObject ro, int index)
ro
- Subnetwork representation objectindex
- Layout indexnull
if none is defined.void setAutoLayoutIndex(IlpRepresentationObject ro, int index)
Default value is 0.
ro
- Representation objectindex
- Layout indexint getAutoLayoutIndex(IlpRepresentationObject ro)
Default value is 0.
ro
- Subnetwork representation objectvoid setLinkLayout(IlpRepresentationObject ro, IlvGraphLayout layout)
Since this layout is applied to a subnetwork, using this method does not trigger the automatic layout execution. This will be done in the view when some of its contents is changed.
ro
- The container representation object.layout
- A graph layout or null
.IlvGraphLayout getLinkLayout(IlpRepresentationObject ro)
null
if none has been specified.void optimizeLayout()
Applies the registered node and/or a link layout algorithm to the manager content.
Since the registered node and/or link layout is invoked automatically, this function needs to be used:
setGraphLayouts(IlvGraphLayout[])
, setGraphLayouts(int, IlvGraphLayout)
or setAutoLayoutIndex(int)
;setNodeLayout
or setLinkLayout
if it has been invoked with
relayout
=false
;void performAttachedLayout(int index)
In contrast to the node and link layout optimizers that are registered in the grapher and called automatically when needed, this function allows you to call a layout only once. It is useful when the layout takes a lot of time.
index
- Layout indexsetGraphLayouts(IlvGraphLayout[])
,
setGraphLayouts(int, IlvGraphLayout)
void performLayoutOnce(IlvGraphLayout layout, Runnable initializations, Runnable postprocessing)
In contrast to the node and link layout optimizers, that are registered in the grapher and called automatically when needed, this function allows you to call a layout only once. It is useful when the layout takes a lot of time to perform.
layout
- A graph layout that is not attached to any grapher
or graph model.initializations
- Code that performs initializations of the layout
after the layout is attached, but before it is run.postprocessing
- Code that performs post-processing of the layout
after the layout has been run, but before it is
detached.IlvGraphModel createGraphModel()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.