Specific parameters

Besides some expert parameters, Recursive Layout does not provide any specific layout parameters. You can set specific layout parameters of the sublayouts individually by accessing them via getLayout(Object) :
IlvGraphLayout sublayout = recursiveLayout.getLayout(subgraph);
sublayout.setParameter(parameter);
Recursive Layout has some convenient methods that automatically traverse the nested graph recursively and set the corresponding parameter at each sublayout of a subgraph that supports this parameter. This works well particularly in reference layout mode. In internal or specified provider mode, it takes only the current nesting structure into account. If you change the specific layout of a subgraph or the nesting structure (for example, by adding a new subgraph) after using such a convenience method, the new layout of the new subgraph usually has a different setting, so you may need to apply the convenience method again.
The following methods traverse the nested graph recursively and set the corresponding parameter on all sublayouts (see Generic parameters and features and Using advanced features for details):
  • setCoordinatesMode(int mode)
  • void setUseDefaultParameters(boolean option)
  • void setMinBusyTime(long time)
  • void setInputCheckEnabled(boolean enable)
  • void propagateLayoutOfConnectedComponentsEnabled(boolean enable)
  • void propagateLayoutOfConnectedComponents(IlvGraphLayout layout)
  • void propagateLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface linkConnectionBoxInterface)
  • propagateLinkClipInterface(IlvLinkClipInterface linkClipInterface)
  • void checkAppropriateLinks()
  • void setLinkCheckEnabled(boolean enable)
  • void setConnectionPointCheckEnabled(boolean enable)
There is a generic propagation mechanism for setting any parameter which is implemented by reflection. For example, the following call traverses the nested graph recursively, checks for each sublayout using introspection whether a method called setFlowDirection exists, and passes the input value direction to this method. As a result, all sublayouts that have a flow direction parameter will use the same flow direction, while the layout parameters of those layouts that do not have a flow direction remain unchanged:
int code = recursiveLayout.propagateLayoutParameter("flowDirection",
null, direction);
The second argument of propagateLayoutParameter can be used to select only specific layout classes. The call
int code = recursiveLayout.propagateLayoutParameter("flowDirection", 
                             IlvHierarchicalLayout.class, direction);
propagates the flow direction only to all those sublayouts that are instances of IlvHierarchicalLayout . For example if a subgraph uses a Tree Layout, its flow direction remains unchanged in this case, even though IlvTreeLayout has a method setFlowDirection .
The return code of the propagation method indicates whether setting the parameter has been successful. It is a bitwise-Or combination of the following bit masks:
  • IlvRecursiveLayout.PROPAGATE_PARAMETER_SET - the parameter was successfully applied at some layout instance of a subgraph.
  • IlvRecursiveLayout.PROPAGATE_PARAMETER_AMBIGUOUS - the method to set the parameter could not uniquely be determined at some layout instance, because there were many methods with the same name, which creates an unresolvable ambiguity. In this case, an arbitrary method is chosen among the ambiguous methods.
  • IlvRecursiveLayout.PROPAGATE_CLASS_MISMATCH - the parameter was not applied at some layout instance of a subgraph because the layout instance did not match the specified layout class. This can happen only when a non-null layout class is specified as the second parameter of the method propagateLayoutParameter .
  • IlvRecursiveLayout.PROPAGATE_PARAMETER_MISMATCH - the parameter was not applied at some layout instance of a subgraph because no matching method with appropriate argument types was found via reflection, or because the security manager of the Java™ Virtual Machine did not allow reflection. In Java applets, reflection is often not permitted.
  • IlvRecursiveLayout.PROPAGATE_EXCEPTION - the method to set the parameter was applied but threw an exception at some layout instance of a subgraph.
For further details about the propagation mechanism, see the class IlvRecursiveLayout IlvRecursiveLayout in the Java API Reference Manual.