Search in sources :

Example 1 with CheckBoxChangeListener

use of games.rednblack.editor.event.CheckBoxChangeListener 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 CheckBoxChangeListener

use of games.rednblack.editor.event.CheckBoxChangeListener in project HyperLap2D by rednblackgames.

the class UIGridBox method init.

private void init() {
    addSeparator(true).padRight(13).padLeft(13);
    lockLinesCheckBox = StandardWidgetsFactory.createCheckBox("Lock lines");
    lockLinesCheckBox.addListener(new CheckBoxChangeListener(LOCK_LINES_CHECKBOX_FIELD_UPDATED));
    add(lockLinesCheckBox);
    addSeparator(true).padRight(13).padLeft(13);
    VisLabel lbl = new VisLabel("Grid Size:");
    add(lbl).padRight(4);
    gridSizeTextField = StandardWidgetsFactory.createValidableTextField("light", new Validators.GreaterThanValidator(0));
    gridSizeTextField.addListener(new KeyboardListener(GRID_SIZE_TEXT_FIELD_UPDATED));
    gridSizeTextField.setAlignment(Align.center);
    add(gridSizeTextField).width(30);
}
Also used : KeyboardListener(games.rednblack.editor.event.KeyboardListener) VisLabel(com.kotcrab.vis.ui.widget.VisLabel) CheckBoxChangeListener(games.rednblack.editor.event.CheckBoxChangeListener)

Example 3 with CheckBoxChangeListener

use of games.rednblack.editor.event.CheckBoxChangeListener in project HyperLap2D by rednblackgames.

the class UISceneProperties method setListeners.

private void setListeners() {
    physicsEnabledCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    gravityXTextField.addListener(new KeyboardListener(getUpdateEventName()));
    gravityYTextField.addListener(new KeyboardListener(getUpdateEventName()));
    sleepVelocityTextField.addListener(new KeyboardListener(getUpdateEventName()));
    enableLightsCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    enablePseudo3DLightsCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    blurNumTextField.addListener(new KeyboardListener(getUpdateEventName()));
    directionalRays.addListener(new NumberSelectorOverlapListener(getUpdateEventName()));
    directionalDegreeTextField.addListener(new KeyboardListener(getUpdateEventName()));
    directionalHeightTextField.addListener(new KeyboardListener(getUpdateEventName()));
    lightTypeBox.addListener(new SelectBoxChangeListener(getUpdateEventName()));
    lightTypeBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            updateDisabled();
        }
    });
    ambientColorComponent.addListener(new ClickListener() {

        public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
            super.touchUp(event, x, y, pointer, button);
            facade.sendNotification(AMBIENT_COLOR_BUTTON_CLICKED, ambientColorComponent.getColorValue(), null);
        }
    });
    directionalLightColor.addListener(new ClickListener() {

        public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
            super.touchUp(event, x, y, pointer, button);
            if (lightTypeBox.getSelected().equals("DIRECTIONAL"))
                facade.sendNotification(DIRECTIONAL_COLOR_BUTTON_CLICKED, directionalLightColor.getColorValue(), null);
        }
    });
}
Also used : KeyboardListener(games.rednblack.editor.event.KeyboardListener) Actor(com.badlogic.gdx.scenes.scene2d.Actor) CheckBoxChangeListener(games.rednblack.editor.event.CheckBoxChangeListener) SelectBoxChangeListener(games.rednblack.editor.event.SelectBoxChangeListener) SelectBoxChangeListener(games.rednblack.editor.event.SelectBoxChangeListener) CheckBoxChangeListener(games.rednblack.editor.event.CheckBoxChangeListener) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) NumberSelectorOverlapListener(games.rednblack.editor.event.NumberSelectorOverlapListener) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 4 with CheckBoxChangeListener

use of games.rednblack.editor.event.CheckBoxChangeListener in project HyperLap2D by rednblackgames.

the class UISensorProperties method initListeners.

private void initListeners() {
    sensorBottom.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    sensorLeft.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    sensorRight.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    sensorTop.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    sensorSpanPercentBottom.addListener(new KeyboardListener(getUpdateEventName()));
    sensorSpanPercentLeft.addListener(new KeyboardListener(getUpdateEventName()));
    sensorSpanPercentRight.addListener(new KeyboardListener(getUpdateEventName()));
    sensorSpanPercentTop.addListener(new KeyboardListener(getUpdateEventName()));
}
Also used : KeyboardListener(games.rednblack.editor.event.KeyboardListener) CheckBoxChangeListener(games.rednblack.editor.event.CheckBoxChangeListener)

Example 5 with CheckBoxChangeListener

use of games.rednblack.editor.event.CheckBoxChangeListener in project HyperLap2D by rednblackgames.

the class UILightItemProperties method setListeners.

private void setListeners() {
    isStaticCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    isXRayCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    rayCountSelector.addListener(new NumberSelectorOverlapListener(getUpdateEventName()));
    pointLightRadiusField.addListener(new KeyboardListener(getUpdateEventName()));
    coneInnerAngleField.addListener(new KeyboardListener(getUpdateEventName()));
    coneDistanceField.addListener(new KeyboardListener(getUpdateEventName()));
    softnessLengthField.addListener(new KeyboardListener(getUpdateEventName()));
    heightField.addListener(new KeyboardListener(getUpdateEventName()));
    intensityField.addListener(new KeyboardListener(getUpdateEventName()));
    coneDirectionField.addListener(new KeyboardListener(getUpdateEventName()));
    isSoftCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
    isActiveCheckBox.addListener(new CheckBoxChangeListener(getUpdateEventName()));
}
Also used : KeyboardListener(games.rednblack.editor.event.KeyboardListener) CheckBoxChangeListener(games.rednblack.editor.event.CheckBoxChangeListener) NumberSelectorOverlapListener(games.rednblack.editor.event.NumberSelectorOverlapListener)

Aggregations

CheckBoxChangeListener (games.rednblack.editor.event.CheckBoxChangeListener)11 KeyboardListener (games.rednblack.editor.event.KeyboardListener)8 NumberSelectorOverlapListener (games.rednblack.editor.event.NumberSelectorOverlapListener)4 SelectBoxChangeListener (games.rednblack.editor.event.SelectBoxChangeListener)4 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)3 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)3 Actor (com.badlogic.gdx.scenes.scene2d.Actor)2 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)2 ButtonToNotificationListener (games.rednblack.editor.event.ButtonToNotificationListener)2 VisCheckBox (com.kotcrab.vis.ui.widget.VisCheckBox)1 VisLabel (com.kotcrab.vis.ui.widget.VisLabel)1