Example usage for com.badlogic.gdx.scenes.scene2d.ui WidgetGroup getChildren

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui WidgetGroup getChildren

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui WidgetGroup getChildren.

Prototype

public SnapshotArray<Actor> getChildren() 

Source Link

Document

Returns an ordered list of child actors in this group.

Usage

From source file:com.kotcrab.vis.editor.module.editor.DebugFeaturesControllerModule.java

License:Apache License

private void invalidateRecursively(WidgetGroup group) {
    group.invalidate();//from  w  ww  . j  ava  2 s . c  o  m

    for (Actor actor : group.getChildren()) {
        if (actor instanceof WidgetGroup)
            invalidateRecursively((WidgetGroup) actor);
        else if (actor instanceof Layout)
            ((Layout) actor).invalidate();
    }
}

From source file:de.longri.cachebox3.gui.activities.Settings_Activity.java

License:Open Source License

private void layoutActListView(boolean itemCountChanged) {
    //get act listView
    WidgetGroup widgetGroup = listViews.get(listViews.size - 1);
    ListView actListView = null;/*  w w w.j ava 2 s .co  m*/
    for (Actor actor : widgetGroup.getChildren()) {
        if (actor instanceof ListView) {
            actListView = (ListView) actor;
            break;
        }
    }

    if (itemCountChanged) {
        Object object = actListView.getUserObject();
        if (object instanceof de.longri.cachebox3.settings.types.SettingCategory) {
            WidgetGroup group = listViews.pop();
            listViewsNames.pop();

            //remove all Listener
            for (Actor actor : group.getChildren())
                for (EventListener listener : actor.getListeners())
                    actor.removeListener(listener);

            this.removeActor(group);
            showCategory((de.longri.cachebox3.settings.types.SettingCategory) object, false);
        }
    }

}

From source file:de.longri.cachebox3.gui.activities.Settings_Activity.java

License:Open Source License

private ListViewItem getFloatView(int listIndex,
        final de.longri.cachebox3.settings.types.SettingFloat setting) {
    final VisLabel valueLabel = new VisLabel(Float.toString(setting.getValue()), valueStyle);
    ListViewItem table = getNumericItemTable(listIndex, valueLabel, setting);

    // add clickListener
    table.addListener(new ClickListener() {
        public void clicked(InputEvent event, float x, float y) {
            if (event.getType() == InputEvent.Type.touchUp) {
                new NumericInput_Activity<Float>(setting.getValue()) {
                    public void returnValue(Float value) {
                        setting.setValue(value);
                        WidgetGroup group = listViews.peek();
                        for (Actor actor : group.getChildren()) {
                            if (actor instanceof ListView) {
                                final ListView listView = (ListView) actor;
                                final float scrollPos = listView.getScrollPos();
                                listView.layout(FORCE);
                                Gdx.app.postRunnable(new Runnable() {
                                    @Override
                                    public void run() {
                                        listView.setScrollPos(scrollPos);
                                    }/*from  w  ww  .  j a  v  a2 s . c om*/
                                });

                            }
                        }
                    }
                }.show();
            }
        }
    });

    return table;
}

From source file:de.longri.cachebox3.gui.activities.Settings_Activity.java

License:Open Source License

private ListViewItem getDblView(int listIndex, final de.longri.cachebox3.settings.types.SettingDouble setting) {
    final VisLabel valueLabel = new VisLabel(Double.toString(setting.getValue()), valueStyle);
    ListViewItem table = getNumericItemTable(listIndex, valueLabel, setting);

    // add clickListener
    table.addListener(new ClickListener() {
        public void clicked(InputEvent event, float x, float y) {
            if (event.getType() == InputEvent.Type.touchUp) {
                new NumericInput_Activity<Double>(setting.getValue()) {
                    public void returnValue(Double value) {
                        setting.setValue(value);
                        WidgetGroup group = listViews.peek();
                        for (Actor actor : group.getChildren()) {
                            if (actor instanceof ListView) {
                                final ListView listView = (ListView) actor;
                                final float scrollPos = listView.getScrollPos();
                                listView.layout(FORCE);
                                Gdx.app.postRunnable(new Runnable() {
                                    @Override
                                    public void run() {
                                        listView.setScrollPos(scrollPos);
                                    }//from   w ww .  j  a  v a2 s.c  om
                                });

                            }
                        }
                    }
                }.show();
            }
        }
    });

    return table;
}

From source file:de.longri.cachebox3.gui.activities.Settings_Activity.java

License:Open Source License

private ListViewItem getIntView(int listIndex, final de.longri.cachebox3.settings.types.SettingInt setting) {
    final VisLabel valueLabel = new VisLabel(Integer.toString(setting.getValue()), valueStyle);
    final ListViewItem table = getNumericItemTable(listIndex, valueLabel, setting);

    // add clickListener
    table.addListener(new ClickListener() {
        public void clicked(InputEvent event, float x, float y) {
            if (event.getType() == InputEvent.Type.touchUp) {
                new NumericInput_Activity<Integer>(setting.getValue()) {
                    public void returnValue(Integer value) {
                        setting.setValue(value);
                        WidgetGroup group = listViews.peek();
                        for (Actor actor : group.getChildren()) {
                            if (actor instanceof ListView) {
                                final ListView listView = (ListView) actor;
                                final float scrollPos = listView.getScrollPos();
                                listView.layout(FORCE);
                                Gdx.app.postRunnable(new Runnable() {
                                    @Override
                                    public void run() {
                                        listView.setScrollPos(scrollPos);
                                    }//from w  w w . ja  v  a2 s.  co  m
                                });

                            }
                        }
                    }
                }.show();
            }
        }
    });
    return table;
}