/**
* Converts a {@link ILayoutViewInfo} (and its children) to a {@link ViewInfo}.
*/
private ViewInfo convertToViewInfo(ILayoutViewInfo view) {
// create the view info.
ViewInfo viewInfo = new ViewInfo(view.getName(), view.getViewKey(),
view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
// then convert the children
ILayoutViewInfo[] children = view.getChildren();
if (children != null) {
ArrayList<ViewInfo> convertedChildren = new ArrayList<ViewInfo>(children.length);
for (ILayoutViewInfo child : children) {
convertedChildren.add(convertToViewInfo(child));
}
viewInfo.setChildren(convertedChildren);
}
return viewInfo;
}