ilog.cpl.graph.graphlayout
Interface IlpGraphLayoutSupport

All Known Implementing Classes:
IlpDefaultGraphLayoutSupport

public interface IlpGraphLayoutSupport

This interface describes the Graph Layout support for the Graph View.

Since:
JViews 7.5

Method Summary
 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.
 

Method Detail

attach

void attach(IlpGraphView view)
Attaches this object to a given view.

Since:
JViews 7.5

detach

void detach()
Detaches this object from its current view.

Since:
JViews 7.5

setGraphLayouts

void setGraphLayouts(IlvGraphLayout[] layouts)
Changes the layouts that can be applied to this view. All given graph layouts are attached to the view.

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)

Parameters:
layouts - Graph layouts
Since:
JViews 7.5
See Also:
getGraphLayouts(), setAutoLayoutIndex(int), performAttachedLayout(int)

getGraphLayouts

IlvGraphLayout[] getGraphLayouts()
Returns the list of graph layouts that have been configured to this view.

Returns:
Graph layouts
Since:
JViews 7.5
See Also:
setGraphLayouts(IlvGraphLayout[])

setGraphLayouts

void setGraphLayouts(int index,
                     IlvGraphLayout layout)
Sets a new graph layout to this view. The graph layout is immediately attached to the view.

Parameters:
index - Layout index
layout - Layout
Since:
JViews 7.5

getGraphLayouts

IlvGraphLayout getGraphLayouts(int index)
Returns the graph layout that is configured at the given index.

Parameters:
index - Layout index
Returns:
Graph layout or null if none is defined.
Since:
JViews 7.5

setAutoLayoutIndex

void setAutoLayoutIndex(int index)
Sets the index of the graph layout that should be executed automatically when the view contents change.

Default value is 0.

Parameters:
index - Layout index
Since:
JViews 7.5

getAutoLayoutIndex

int getAutoLayoutIndex()
Returns the index of the graph layout that should be executed automatically when the view contents change.

Returns:
Layout index or -1 if none shall be executed automatically.
Since:
JViews 7.5

getNodeLayout

IlvGraphLayout getNodeLayout()
Returns the graph layout of the view for nodes.

Returns:
The graph layout that is configure to perform automatically, or null if none has been specified.

setNodeLayout

void setNodeLayout(IlvGraphLayout layout,
                   boolean relayout)
Changes the node layout of this view.

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();
 

Parameters:
layout - A graph layout or null.
relayout - Specifies whether the layout optimizers should be called immediately.
Since:
JViews 7.5
See Also:
setGraphLayouts(IlvGraphLayout[]), setGraphLayouts(int, IlvGraphLayout)

getLinkLayout

IlvGraphLayout getLinkLayout()
Returns the graph layout for links.

Returns:
A graph layout, or null if none has been specified.
Since:
JViews 7.5

setLinkLayout

void setLinkLayout(IlvGraphLayout layout,
                   boolean relayout)
Changes the link layout of this view.

If layout is null, and the node layout does not update links, a default link layout is substituted. It can be obtained using getLinkLayout().

Parameters:
layout - A graph layout or null.
relayout - Indicates if the layout should be applied immediately.
Since:
JViews 7.5

setGraphLayouts

void setGraphLayouts(IlpRepresentationObject ro,
                     IlvGraphLayout[] layouts)
Changes the layouts that can be applied to the subnetwork that represents the given representation object. All given graph layouts are attached to the subnetwork.

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)

Parameters:
ro - Subnetwork representation object
layouts - Graph layouts
Since:
JViews 7.5
See Also:
getGraphLayouts(IlpRepresentationObject), setAutoLayoutIndex(IlpRepresentationObject, int), performAttachedLayout(int)

getGraphLayouts

IlvGraphLayout[] getGraphLayouts(IlpRepresentationObject ro)
Returns the list of graph layouts that have been configured to the given subnetwork object.

Parameters:
ro - Subnetwork representation object
Returns:
Graph layouts or empty list if nothing has been configured for the given object.
Since:
JViews 7.5
See Also:
setGraphLayouts(IlpRepresentationObject, IlvGraphLayout[])

setGraphLayouts

void setGraphLayouts(IlpRepresentationObject ro,
                     int index,
                     IlvGraphLayout layout)
Sets a new graph layout to this subnetwork representation object.

Parameters:
ro - Subnetwork representation object
index - Layout index
layout - Layout
Since:
JViews 7.5

getGraphLayouts

IlvGraphLayout getGraphLayouts(IlpRepresentationObject ro,
                               int index)
Returns the graph layout that is configured at the given index for the given subnetwork object.

Parameters:
ro - Subnetwork representation object
index - Layout index
Returns:
Graph layout or null if none is defined.
Since:
JViews 7.5

setAutoLayoutIndex

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.

Default value is 0.

Parameters:
ro - Representation object
index - Layout index
Since:
JViews 7.5

getAutoLayoutIndex

int getAutoLayoutIndex(IlpRepresentationObject ro)
Returns the index of the graph layout that should be executed automatically in the subnetwork when the view contents change.

Default value is 0.

Parameters:
ro - Subnetwork representation object
Returns:
Layout index
Since:
JViews 7.5

setLinkLayout

void setLinkLayout(IlpRepresentationObject ro,
                   IlvGraphLayout layout)
Changes the link layout of subnetwork for the given representation object.

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.

Parameters:
ro - The container representation object.
layout - A graph layout or null.
Since:
JViews 7.5

getLinkLayout

IlvGraphLayout getLinkLayout(IlpRepresentationObject ro)
Returns the graph layout for links in the subnetwork of the given representation object.

Returns:
A graph layout, or null if none has been specified.
Since:
JViews 7.5

optimizeLayout

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:


performAttachedLayout

void performAttachedLayout(int index)
Applies a given graph layout algorithm once to the manager content. The graph layout is identified by its index when configured in the view (@see #setGraphLayouts(int, IlvGraphLayout)).

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.

Parameters:
index - Layout index
Since:
JViews 7.5
See Also:
setGraphLayouts(IlvGraphLayout[]), setGraphLayouts(int, IlvGraphLayout)

performLayoutOnce

void performLayoutOnce(IlvGraphLayout layout,
                       Runnable initializations,
                       Runnable postprocessing)
Applies a given graph layout algorithm once to the manager content.

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.

Parameters:
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.
Since:
JViews 7.5

createGraphModel

IlvGraphModel createGraphModel()
Creates the graph model used for the manager content.

Returns:
Graph model
Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.