public IFigure getPreviousFocusableFigure(IFigure root, IFigure prevFocus) {
		if (prevFocus == null)
			return null;

		boolean found = false;
		IFigure nextFocus = prevFocus;
		while (!found) {
			IFigure parent = nextFocus.getParent();

			/*
			 * At root, return null to indicate traversal is complete.
			 */
			if (parent == null)
				return null;

			List siblings = parent.getChildren();
			int siblingPos = siblings.indexOf(nextFocus);

			/*
			 * Figure traversal is implemented using the post-order right to
			 * left tree traversal algorithm.
			 * 
			 * Find the rightmost child. If this child is focusable, return it
			 * If not focusable, traverse to its sibling and repeat. If there is
			 * no sibling, traverse its parent.
			 */
			if (siblingPos != 0) {
				IFigure child = findDeepestRightmostChildOf((IFigure) siblings
						.get(siblingPos - 1));
				if (isFocusEligible(child)) {
					found = true;
					nextFocus = child;
				} else if (child.equals(nextFocus)) {
					if (isFocusEligible(nextFocus))
						found = true;
				} else
					nextFocus = child;
			} else {
				nextFocus = parent;
				if (isFocusEligible(nextFocus))
					found = true;
			}
		}
		return nextFocus;
	}