Search in sources :

Example 6 with VisTable

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

the class ResourceListAdapter method createView.

@Override
protected VisTable createView(String item) {
    ResourceManager rm = HyperLap2DFacade.getInstance().retrieveProxy(ResourceManager.NAME);
    VisTable table = new VisTable();
    table.left();
    Image icon = new Image(new TextureRegionDrawable(rm.getTextureRegion(item)), Scaling.contain, Align.center);
    table.add(icon).width(45).height(45);
    table.add(new VisLabel(item)).padLeft(10).row();
    return table;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel) ResourceManager(games.rednblack.editor.proxy.ResourceManager) Image(com.badlogic.gdx.scenes.scene2d.ui.Image)

Example 7 with VisTable

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

the class ProjectExportSettings method getFilterTable.

private Table getFilterTable() {
    String[] data = { "Linear", "Nearest", "MipMap", "MipMapNearestNearest", "MipMapLinearNearest", "MipMapNearestLinear", "MipMapLinearLinear" };
    VisTable filterTable = new VisTable();
    filterMagSelectBox.setItems(data);
    filterTable.add(new VisLabel("Mag:")).left().padRight(3);
    filterTable.add(filterMagSelectBox).width(85).height(21).padRight(3);
    filterTable.row().padTop(10);
    filterMinSelectBox.setItems(data);
    filterTable.add(new VisLabel("Min:")).left().padRight(3);
    filterTable.add(filterMinSelectBox).width(85).height(21).left();
    return filterTable;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel)

Example 8 with VisTable

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

the class AlternativeAutoTileDialog method initView.

/**
 * Initiates the view of the dialog.
 */
public void initView() {
    clear();
    String[] allAutoTileVOArray = new String[tiledPlugin.dataToSave.getAutoTiles().size];
    int index = 0;
    // add a "none" to the drop down list
    allAutoTileVOArray[index++] = "";
    for (int i = 0; i < tiledPlugin.dataToSave.getAutoTiles().size; i++) {
        AutoTileVO next = tiledPlugin.dataToSave.getAutoTiles().get(i);
        if (!openingAutoTileVO.equals(next)) {
            allAutoTileVOArray[index++] = next.regionName;
        }
    }
    alternativeSelectBoxArray = new VisSelectBox[allAutoTileVOArray.length - 1];
    alternativePercentTextFieldArray = new VisValidatableTextField[allAutoTileVOArray.length + 0];
    VisTable table = new VisTable();
    table.row().padTop(20);
    table.add(getVisImageButton(openingAutoTileVO.regionName)).maxHeight(32);
    // .width(115);
    table.add(StandardWidgetsFactory.createLabel(openingAutoTileVO.regionName, Align.left)).padLeft(5).left();
    alternativePercentTextFieldArray[0] = StandardWidgetsFactory.createValidableTextField(new FloatValidator());
    alternativePercentTextFieldArray[0].setText(openingAutoTileVO.alternativeAutoTileList.get(0, new AlternativeAutoTileVO()).percent.toString());
    table.add(alternativePercentTextFieldArray[0]).padLeft(5).padRight(5).fillX().left();
    table.row();
    for (int i = 0; i < allAutoTileVOArray.length - 1; i++) {
        String region = openingAutoTileVO.alternativeAutoTileList.get(i + 1, new AlternativeAutoTileVO()).region;
        VisImageButton imgButton = getVisImageButton(region);
        table.add(imgButton).maxHeight(32);
        alternativeSelectBoxArray[i] = StandardWidgetsFactory.createSelectBox(String.class);
        alternativeSelectBoxArray[i].setItems(allAutoTileVOArray);
        alternativeSelectBoxArray[i].setSelected(openingAutoTileVO.alternativeAutoTileList.get(i + 1, new AlternativeAutoTileVO()).region);
        alternativeSelectBoxArray[i].addListener(new ChangeListener() {

            @Override
            public void changed(ChangeEvent event, Actor actor) {
                updateVisImageButton(imgButton, ((SelectBox<String>) actor).getSelected());
                pack();
            }
        });
        table.add(alternativeSelectBoxArray[i]).padLeft(5).left();
        alternativePercentTextFieldArray[i + 1] = StandardWidgetsFactory.createValidableTextField(new FloatValidator());
        alternativePercentTextFieldArray[i + 1].setText(openingAutoTileVO.alternativeAutoTileList.get(i + 1, new AlternativeAutoTileVO()).percent.toString());
        table.add(alternativePercentTextFieldArray[i + 1]).padLeft(5).padRight(5).fillX().left();
        table.row().padTop(5).padBottom(5);
    }
    VisTextButton saveButton = StandardWidgetsFactory.createTextButton("Save");
    saveButton.addListener(new ClickListener() {

        @Override
        public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
            super.touchUp(event, x, y, pointer, button);
            tiledPlugin.facade.sendNotification(TiledPlugin.ACTION_SAVE_ALTERNATIVES_AUTO_TILE);
            hide();
        }
    });
    VisTextButton cancelButton = StandardWidgetsFactory.createTextButton("Cancel");
    cancelButton.addListener(new ClickListener() {

        @Override
        public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
            super.touchUp(event, x, y, pointer, button);
            hide();
        }
    });
    row();
    add(table);
    row();
    add(saveButton).center().padLeft(5).padRight(5);
    add(cancelButton).center().padLeft(5).padRight(5);
    row();
    pack();
}
Also used : VisImageButton(com.kotcrab.vis.ui.widget.VisImageButton) VisTextButton(com.kotcrab.vis.ui.widget.VisTextButton) SelectBox(com.badlogic.gdx.scenes.scene2d.ui.SelectBox) VisSelectBox(com.kotcrab.vis.ui.widget.VisSelectBox) AlternativeAutoTileVO(games.rednblack.editor.plugin.tiled.data.AlternativeAutoTileVO) AlternativeAutoTileVO(games.rednblack.editor.plugin.tiled.data.AlternativeAutoTileVO) AutoTileVO(games.rednblack.editor.plugin.tiled.data.AutoTileVO) VisTable(com.kotcrab.vis.ui.widget.VisTable) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) FloatValidator(com.kotcrab.vis.ui.util.Validators.FloatValidator) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 9 with VisTable

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

the class GraphBoxImpl method addTwoSideGraphPart.

public void addTwoSideGraphPart(GraphNodeInput graphNodeInput, GraphNodeOutput graphNodeOutput) {
    VisTable table = new VisTable();
    table.add(new VisLabel(graphNodeInput.getFieldName())).grow();
    VisLabel outputLabel = new VisLabel(graphNodeOutput.getFieldName());
    outputLabel.setAlignment(Align.right);
    table.add(outputLabel).grow();
    table.row();
    GraphBoxPartImpl graphBoxPart = new GraphBoxPartImpl(table, null);
    graphBoxPart.setInputConnector(GraphBoxInputConnector.Side.Left, graphNodeInput);
    graphBoxPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, graphNodeOutput);
    addGraphBoxPart(graphBoxPart);
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel)

Example 10 with VisTable

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

the class RemapVectorShaderBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    String x = "X";
    String y = "Y";
    String z = "Z";
    String w = "W";
    if (data != null) {
        x = data.getString("x", x);
        y = data.getString("y", y);
        z = data.getString("z", z);
        w = data.getString("W", w);
    }
    GraphBoxImpl result = createGraphBox(id);
    addConfigurationInputsAndOutputs(result);
    final VisSelectBox<String> xBox = createSelectBox(x);
    final VisSelectBox<String> yBox = createSelectBox(y);
    final VisSelectBox<String> zBox = createSelectBox(z);
    final VisSelectBox<String> wBox = createSelectBox(w);
    VisTable table = new VisTable();
    table.add("X: ");
    table.add(xBox);
    table.add("Y: ");
    table.add(yBox);
    table.row();
    table.add("Z: ");
    table.add(zBox);
    table.add("W: ");
    table.add(wBox);
    table.row();
    result.addGraphBoxPart(new GraphBoxPartImpl(table, new GraphBoxPartImpl.Callback() {

        @Override
        public void serialize(JsonValue object) {
            object.addChild("x", new JsonValue(xBox.getSelected()));
            object.addChild("y", new JsonValue(yBox.getSelected()));
            object.addChild("z", new JsonValue(zBox.getSelected()));
            object.addChild("w", new JsonValue(wBox.getSelected()));
        }
    }));
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) VisTable(com.kotcrab.vis.ui.widget.VisTable) JsonValue(com.badlogic.gdx.utils.JsonValue) GraphBoxPartImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxPartImpl)

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