Search in sources :

Example 1 with UIRadialRing

use of org.terasology.nui.widgets.UIRadialRing in project Terasology by MovingBlocks.

the class CoreScreenLayer method iterateThrough.

private void iterateThrough(Iterator<UIWidget> widgets) {
    modifyingList = true;
    while (widgets.hasNext()) {
        UIWidget next = widgets.next();
        boolean setParent = false;
        if (next instanceof ScrollableArea) {
            parentToSet = (ScrollableArea) next;
        }
        if (next instanceof WidgetWithOrder) {
            TabbingManager.addToWidgetsList((WidgetWithOrder) next);
            TabbingManager.addToUsedNums(((WidgetWithOrder) next).getOrder());
            ((WidgetWithOrder) next).setParent(parentToSet);
        }
        if (next.iterator().hasNext()) {
            iterateThrough(next.iterator());
        } else if (next instanceof UIRadialRing) {
            Iterator<UIRadialSection> iter = ((UIRadialRing) next).getSections().iterator();
            while (iter.hasNext()) {
                next = iter.next();
                TabbingManager.addToWidgetsList((WidgetWithOrder) next);
                TabbingManager.addToUsedNums(((WidgetWithOrder) next).getOrder());
                if (setParent) {
                    ((WidgetWithOrder) next).setParent(parentToSet);
                }
            }
        }
    }
    modifyingList = false;
}
Also used : ScrollableArea(org.terasology.nui.layouts.ScrollableArea) Iterator(java.util.Iterator) UIRadialRing(org.terasology.nui.widgets.UIRadialRing) WidgetWithOrder(org.terasology.nui.WidgetWithOrder) UIWidget(org.terasology.nui.UIWidget)

Aggregations

Iterator (java.util.Iterator)1 UIWidget (org.terasology.nui.UIWidget)1 WidgetWithOrder (org.terasology.nui.WidgetWithOrder)1 ScrollableArea (org.terasology.nui.layouts.ScrollableArea)1 UIRadialRing (org.terasology.nui.widgets.UIRadialRing)1