src/main/java/com/mxgraph/layout/hierarchical/mxHierarchicalLayout.java
public Set<Object> filterDescendants(Object cell)
	{
		mxIGraphModel model = graph.getModel();
		Set<Object> result = new LinkedHashSet<Object>();

		if (model.isVertex(cell) && cell != this.parent && graph.isCellVisible(cell))
		{
			result.add(cell);
		}

		if (this.traverseAncestors || cell == this.parent
				&& graph.isCellVisible(cell))
		{
			int childCount = model.getChildCount(cell);

			for (int i = 0; i < childCount; i++)
			{
				Object child = model.getChildAt(cell, i);
				result.addAll(filterDescendants(child));
			}
		}

		return result;
	}
/**
	 * Creates a set of descendant cells
	 * @param cell The cell whose descendants are to be calculated
	 * @return the descendants of the cell (not the cell)
	 */
Creates a set of descendant cells
@param cell The cell whose descendants are to be calculated
@return the descendants of the cell (not the cell)
Creates a set of descendant cells @param cell The cell whose descendants are to be calculated @return the descendants of the cell ( not the cell )
public Set<Object> filterDescendants(Object cell)
	{
		mxIGraphModel model = graph.getModel();
		Set<Object> result = new LinkedHashSet<Object>();
		if (model.isVertex(cell) && cell != this.parent && graph.isCellVisible(cell))
		{
			result.add(cell);
		}
		if (this.traverseAncestors || cell == this.parent
				&& graph.isCellVisible(cell))
		{
			int childCount = model.getChildCount(cell);
			for (int i = 0; i < childCount; i++)
			{
				Object child = model.getChildAt(cell, i);
				result.addAll(filterDescendants(child));
			}
		}
		return result;
	}
public Set < Object > filterDescendants ( Object cell ) { mxIGraphModel model = graph . getModel ( ) ; Set < Object > result = new LinkedHashSet < Object > ( ) ; if ( model . isVertex ( cell ) && cell != this . parent && graph . isCellVisible ( cell ) ) { result . add ( cell ) ; } if ( this . traverseAncestors || cell == this . parent && graph . isCellVisible ( cell ) ) { int childCount = model . getChildCount ( cell ) ; for ( int i = 0 ; i < childCount ; i ++ ) { Object child = model . getChildAt ( cell , i ) ; result . addAll ( filterDescendants ( child ) ) ; } } return result ; }
Creates a set of descendant cells
 @param cell The cell whose descendants are to be calculated
 @return the descendants of the cell (not the cell)
Creates a set of descendant cells @param cell The cell whose descendants are to be calculated @return the descendants of the cell ( not the cell )