Search in sources :

Example 16 with VisTable

use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.

the class TestVertical method addVisWidgets.

private void addVisWidgets() {
    VisProgressBar progressbar = new VisProgressBar(0, 100, 1, true);
    VisSlider slider = new VisSlider(0, 100, 1, true);
    VisSlider sliderDisabled = new VisSlider(0, 100, 1, true);
    progressbar.setValue(50);
    slider.setValue(50);
    sliderDisabled.setValue(50);
    sliderDisabled.setDisabled(true);
    VisTable progressbarTable = new VisTable(true);
    progressbarTable.add(progressbar);
    progressbarTable.add(slider);
    progressbarTable.add(sliderDisabled);
    add(progressbarTable);
}
Also used : VisProgressBar(com.kotcrab.vis.ui.widget.VisProgressBar) VisTable(com.kotcrab.vis.ui.widget.VisTable) VisSlider(com.kotcrab.vis.ui.widget.VisSlider)

Example 17 with VisTable

use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.

the class Toast method createMainTable.

protected void createMainTable() {
    mainTable = new VisTable();
    mainTable.setBackground(style.background);
    VisImageButton closeButton = new VisImageButton(style.closeButtonStyle);
    closeButton.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            close();
        }
    });
    mainTable.add(contentTable).pad(3).fill().expand();
    mainTable.add(closeButton).top();
}
Also used : VisImageButton(com.kotcrab.vis.ui.widget.VisImageButton) VisTable(com.kotcrab.vis.ui.widget.VisTable) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Example 18 with VisTable

use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.

the class TestSplitPane method addVisWidgets.

private void addVisWidgets() {
    VisLabel label = new VisLabel("Lorem \nipsum \ndolor \nsit \namet");
    VisLabel label2 = new VisLabel("Consectetur \nadipiscing \nelit");
    VisTable table = new VisTable(true);
    VisTable table2 = new VisTable(true);
    table.add(label);
    table2.add(label2);
    VisSplitPane splitPane = new VisSplitPane(table, table2, vertical);
    add(splitPane).fill().expand();
}
Also used : VisSplitPane(com.kotcrab.vis.ui.widget.VisSplitPane) VisTable(com.kotcrab.vis.ui.widget.VisTable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel)

Example 19 with VisTable

use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.

the class BasicColorPicker method createHexTable.

private VisTable createHexTable() {
    VisTable table = new VisTable(true);
    table.add(new VisLabel(HEX.get()));
    table.add(hexField = new VisValidatableTextField("00000000")).width(HEX_FIELD_WIDTH * sizes.scaleFactor);
    table.row();
    hexField.setMaxLength(HEX_COLOR_LENGTH);
    hexField.setProgrammaticChangeEvents(false);
    hexField.setTextFieldFilter(new TextFieldFilter() {

        @Override
        public boolean acceptChar(VisTextField textField, char c) {
            return Character.isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
        }
    });
    hexField.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            if (hexField.getText().length() == (allowAlphaEdit ? HEX_COLOR_LENGTH_WITH_ALPHA : HEX_COLOR_LENGTH)) {
                setColor(Color.valueOf(hexField.getText()), false);
            }
        }
    });
    return table;
}
Also used : VisTextField(com.kotcrab.vis.ui.widget.VisTextField) VisTable(com.kotcrab.vis.ui.widget.VisTable) Actor(com.badlogic.gdx.scenes.scene2d.Actor) TextFieldFilter(com.kotcrab.vis.ui.widget.VisTextField.TextFieldFilter) VisLabel(com.kotcrab.vis.ui.widget.VisLabel) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) VisValidatableTextField(com.kotcrab.vis.ui.widget.VisValidatableTextField)

Example 20 with VisTable

use of com.kotcrab.vis.ui.widget.VisTable in project vis-ui by kotcrab.

the class BasicColorPicker method createColorsPreviewTable.

private VisTable createColorsPreviewTable() {
    VisTable table = new VisTable(false);
    table.add(currentColorImg = new AlphaImage(commons, 5 * sizes.scaleFactor)).height(25 * sizes.scaleFactor).width(80 * sizes.scaleFactor).expandX().fillX();
    table.add(new Image(style.iconArrowRight)).pad(0, 2, 0, 2);
    table.add(newColorImg = new AlphaImage(commons, 5 * sizes.scaleFactor)).height(25 * sizes.scaleFactor).width(80 * sizes.scaleFactor).expandX().fillX();
    currentColorImg.setColor(color);
    newColorImg.setColor(color);
    currentColorImg.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            restoreLastColor();
        }
    });
    return table;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) AlphaImage(com.kotcrab.vis.ui.widget.color.internal.AlphaImage) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) AlphaImage(com.kotcrab.vis.ui.widget.color.internal.AlphaImage) Image(com.badlogic.gdx.scenes.scene2d.ui.Image) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

VisTable (com.kotcrab.vis.ui.widget.VisTable)35 VisLabel (com.kotcrab.vis.ui.widget.VisLabel)11 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)7 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)7 Actor (com.badlogic.gdx.scenes.scene2d.Actor)6 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)6 VisImageButton (com.kotcrab.vis.ui.widget.VisImageButton)6 JsonValue (com.badlogic.gdx.utils.JsonValue)4 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)3 GraphBoxImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)3 GraphBoxPartImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxPartImpl)3 VisSelectBox (com.kotcrab.vis.ui.widget.VisSelectBox)3 Color (com.badlogic.gdx.graphics.Color)2 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)2 ClampMethod (com.gempukku.libgdx.graph.shader.ClampMethod)2 GraphChangedEvent (com.gempukku.libgdx.graph.ui.graph.GraphChangedEvent)2 VisProgressBar (com.kotcrab.vis.ui.widget.VisProgressBar)2 VisSlider (com.kotcrab.vis.ui.widget.VisSlider)2 VisSplitPane (com.kotcrab.vis.ui.widget.VisSplitPane)2 VisTextButton (com.kotcrab.vis.ui.widget.VisTextButton)2