src/main/java/com/mxgraph/layout/hierarchical/mxHierarchicalLayout.java
public void execute(Object parent, List<Object> roots)
	{
		super.execute(parent);
		mxIGraphModel model = graph.getModel();

		// If the roots are set and the parent is set, only
		// use the roots that are some dependent of the that
		// parent.
		// If just the root are set, use them as-is
		// If just the parent is set use it's immediate
		// children as the initial set

		if (roots == null && parent == null)
		{
			// TODO indicate the problem
			return;
		}

		if (roots != null && parent != null)
		{
			for (Object root : roots)
			{
				if (!model.isAncestor(parent, root))
				{
					roots.remove(root);
				}
			}
		}

		this.roots = roots;

		model.beginUpdate();
		try
		{
			run(parent);

			if (isResizeParent() && !graph.isCellCollapsed(parent))
			{
				graph.updateGroupBounds(new Object[] { parent },
						getParentBorder(), isMoveParent());
			}
		}
		finally
		{
			model.endUpdate();
		}
	}
/**
	 * Executes the layout for the children of the specified parent.
	 * 
	 * @param parent Parent cell that contains the children to be laid out.
	 * @param roots the starting roots of the layout
	 */
Executes the layout for the children of the specified parent.

@param parent Parent cell that contains the children to be laid out.
@param roots the starting roots of the layout
Executes the layout for the children of the specified parent . @param parent Parent cell that contains the children to be laid out . @param roots the starting roots of the layout
public void execute(Object parent, List<Object> roots)
	{
		super.execute(parent);
		mxIGraphModel model = graph.getModel();
		if (roots == null && parent == null)
		{
			return;
		}
		if (roots != null && parent != null)
		{
			for (Object root : roots)
			{
				if (!model.isAncestor(parent, root))
				{
					roots.remove(root);
				}
			}
		}
		this.roots = roots;
		model.beginUpdate();
		try
		{
			run(parent);
			if (isResizeParent() && !graph.isCellCollapsed(parent))
			{
				graph.updateGroupBounds(new Object[] { parent },
						getParentBorder(), isMoveParent());
			}
		}
		finally
		{
			model.endUpdate();
		}
	}
public void execute ( Object parent , List < Object > roots ) { super . execute ( parent ) ; mxIGraphModel model = graph . getModel ( ) ; if ( roots == null && parent == null ) { return ; } if ( roots != null && parent != null ) { for ( Object root : roots ) { if ( ! model . isAncestor ( parent , root ) ) { roots . remove ( root ) ; } } } this . roots = roots ; model . beginUpdate ( ) ; try { run ( parent ) ; if ( isResizeParent ( ) && ! graph . isCellCollapsed ( parent ) ) { graph . updateGroupBounds ( new Object [ ] { parent } , getParentBorder ( ) , isMoveParent ( ) ) ; } } finally { model . endUpdate ( ) ; } }
Executes the layout for the children of the specified parent.
Executes the layout for the children of the specified parent .
// If the roots are set and the parent is set, only // use the roots that are some dependent of the that // parent. // If just the root are set, use them as-is // If just the parent is set use it's immediate // children as the initial set // TODO indicate the problem