ilog.views.graphlayout
Interface IlvAutoLayoutHandler

All Known Implementing Classes:
IlvGraphLayoutRenderer, IlvLinkLayoutRenderer

public interface IlvAutoLayoutHandler

An interface used to automatically perform a layout again following a structural or geometric change of the graph. This can be used for graph layout and label layout. The interface can be installed at a layout instance. It is used inside IlvGraphLayout.performAutoLayout() to start the automatic layout. A simple example implementation of the performAutoLayout method is:

 public void performAutoLayout(Object layout, Vector objects)
 {
   try {
     if (layout instanceof IlvGraphLayout)
       ((IlvGraphLayout)layout).performLayout(true, true);
     else if (layout instanceof IlvLabelLayout)
       ((IlvLabelLayout)layout).performLayout(true, true);
   } catch (Exception e) { }
 }
 
Advanced usages of this interface can catch the exception IlvInappropriateLinkException thrown by the method IlvGraphLayout.performLayout(boolean, boolean) and to execute the most appropriate action. The utility method IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvGraphModel, IlvLayoutProvider) can be used to replace the inappropriate links, and then the layout can be restarted.

Since:
JViews 5.5
See Also:
IlvGraphLayout.setAutoLayoutHandler(ilog.views.graphlayout.IlvAutoLayoutHandler), IlvGraphLayout.performAutoLayout()

Method Summary
 void performAutoLayout(Object layout, Vector objects)
          Performs an automatic layout that was caused by a structural or geometric change of some graphic objects.
 

Method Detail

performAutoLayout

void performAutoLayout(Object layout,
                       Vector objects)
Performs an automatic layout that was caused by a structural or geometric change of some graphic objects.

Parameters:
layout - The graph layout or label layout to be performed.
objects - The vector of graphic objects that caused the need for layout. These objects were added, removed, or have moved. If null is passed, the need for layout has no specific reason (for example, when all nodes and links have moved).


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