Search in sources :

Example 1 with VisCheckBox

use of com.kotcrab.vis.ui.widget.VisCheckBox in project HyperLap2D by rednblackgames.

the class UIFilterMenu method addFilter.

public void addFilter(IAbstractResourceFilter filter) {
    VisCheckBox checkBox = StandardWidgetsFactory.createCheckBox(filter.name);
    checkBox.setChecked(filter.isActive());
    checkBox.addListener(new CheckBoxChangeListener(UIResourcesTabMediator.CHANGE_ACTIVE_FILTER, filter.id));
    add(checkBox).padTop(2).padBottom(2).row();
    pack();
}
Also used : VisCheckBox(com.kotcrab.vis.ui.widget.VisCheckBox) CheckBoxChangeListener(games.rednblack.editor.event.CheckBoxChangeListener)

Example 2 with VisCheckBox

use of com.kotcrab.vis.ui.widget.VisCheckBox in project HyperLap2D by rednblackgames.

the class ValueBooleanBoxProducer method createValuePart.

private GraphBoxPartImpl<T> createValuePart(Skin skin, boolean v) {
    HorizontalGroup horizontalGroup = new HorizontalGroup();
    final VisCheckBox checkBox = StandardWidgetsFactory.createCheckBox("Value");
    checkBox.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            checkBox.fire(new GraphChangedEvent(false, true));
        }
    });
    checkBox.setChecked(v);
    horizontalGroup.addActor(checkBox);
    GraphBoxPartImpl<T> colorPart = new GraphBoxPartImpl<T>(horizontalGroup, new GraphBoxPartImpl.Callback() {

        @Override
        public void serialize(Map<String, String> object) {
            if (checkBox.isChecked())
                object.put("v", "t");
            else
                object.remove("v");
        }
    });
    colorPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, configuration.getNodeOutputs().get("value"));
    return colorPart;
}
Also used : VisCheckBox(com.kotcrab.vis.ui.widget.VisCheckBox) HorizontalGroup(com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 3 with VisCheckBox

use of com.kotcrab.vis.ui.widget.VisCheckBox in project gdx-graph by MarcinSc.

the class ValueBooleanBoxProducer method createValuePart.

private GraphBoxPartImpl createValuePart(boolean v) {
    HorizontalGroup horizontalGroup = new HorizontalGroup();
    final VisCheckBox checkBox = new VisCheckBox("Value");
    checkBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            checkBox.fire(new GraphChangedEvent(false, true));
        }
    });
    checkBox.setChecked(v);
    horizontalGroup.addActor(checkBox);
    GraphBoxPartImpl colorPart = new GraphBoxPartImpl(horizontalGroup, new GraphBoxPartImpl.Callback() {

        @Override
        public void serialize(JsonValue object) {
            object.addChild("v", new JsonValue(checkBox.isChecked()));
        }
    });
    colorPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, configuration.getNodeOutputs().get("value"));
    return colorPart;
}
Also used : VisCheckBox(com.kotcrab.vis.ui.widget.VisCheckBox) Actor(com.badlogic.gdx.scenes.scene2d.Actor) JsonValue(com.badlogic.gdx.utils.JsonValue) HorizontalGroup(com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Example 4 with VisCheckBox

use of com.kotcrab.vis.ui.widget.VisCheckBox in project talos by rockbite.

the class RandomRangeModuleWrapper method configureSlots.

@Override
protected void configureSlots() {
    addInputSlot("min", RandomRangeModule.MIN_INPUT);
    addInputSlot("max", RandomRangeModule.MAX_INPUT);
    addOutputSlot("result", 0);
    distribution = new VisCheckBox("distributed");
    rightWrapper.add(distribution).right().expandX().padRight(3).row();
    inputRange = new FloatRangeInputWidget("Min", "Max", getSkin());
    inputRange.setValue(1, 1);
    contentWrapper.add(inputRange).left().padTop(40).padLeft(4).expandX();
    leftWrapper.add(new Table()).expandY();
    rightWrapper.add(new Table()).expandY();
    inputRange.setListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            updateValues();
        }
    });
    distribution.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            module.setDistributed(distribution.isChecked());
        }
    });
}
Also used : FloatRangeInputWidget(com.talosvfx.talos.editor.widgets.FloatRangeInputWidget) Table(com.badlogic.gdx.scenes.scene2d.ui.Table) VisCheckBox(com.kotcrab.vis.ui.widget.VisCheckBox) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Example 5 with VisCheckBox

use of com.kotcrab.vis.ui.widget.VisCheckBox in project talos by rockbite.

the class EmConfigModuleWrapper method configureSlots.

@Override
protected void configureSlots() {
    addOutputSlot("config", EmConfigModule.OUTPUT);
    additiveBox = new VisCheckBox("additive");
    blendAddBox = new VisCheckBox("blendadd");
    attachedBox = new VisCheckBox("attached");
    continuousBox = new VisCheckBox("continuous");
    alignedBox = new VisCheckBox("aligned");
    immortalBox = new VisCheckBox("immortal");
    Table form = new Table();
    form.add(additiveBox).left().padLeft(3);
    form.row();
    form.add(blendAddBox).left().padLeft(3);
    form.row();
    form.add(attachedBox).left().padLeft(3);
    form.row();
    form.add(continuousBox).left().padLeft(3);
    form.row();
    form.add(alignedBox).left().padLeft(3);
    form.row();
    form.add(immortalBox).left().padLeft(3);
    contentWrapper.add(form).left();
    contentWrapper.add().expandX();
    rightWrapper.add().expandY();
    additiveBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            fromUIToData();
        }
    });
    blendAddBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            fromUIToData();
        }
    });
    attachedBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            fromUIToData();
        }
    });
    continuousBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            fromUIToData();
        }
    });
    alignedBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            fromUIToData();
        }
    });
    immortalBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            fromUIToData();
        }
    });
}
Also used : Table(com.badlogic.gdx.scenes.scene2d.ui.Table) VisCheckBox(com.kotcrab.vis.ui.widget.VisCheckBox) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Aggregations

VisCheckBox (com.kotcrab.vis.ui.widget.VisCheckBox)5 Actor (com.badlogic.gdx.scenes.scene2d.Actor)3 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)3 HorizontalGroup (com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup)2 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)2 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 JsonValue (com.badlogic.gdx.utils.JsonValue)1 FloatRangeInputWidget (com.talosvfx.talos.editor.widgets.FloatRangeInputWidget)1 CheckBoxChangeListener (games.rednblack.editor.event.CheckBoxChangeListener)1