Example usage for com.badlogic.gdx.scenes.scene2d.ui Cell pad

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Cell pad

Introduction

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

Prototype

public Cell<T> pad(float pad) 

Source Link

Document

Sets the padTop, padLeft, padBottom, and padRight to the specified value.

Usage

From source file:com.forerunnergames.peril.client.ui.widgets.Widgets.java

License:Open Source License

public static void padCell(final Cell<?> cell, final float paddingAmount, final CellPadding paddingType) {
    Arguments.checkIsNotNull(cell, "cell");
    Arguments.checkIsNotNegative(paddingAmount, "paddingAmount");
    Arguments.checkIsNotNull(paddingType, "paddingType");

    switch (paddingType) {
    case LEFT: {//from w  ww .  java  2s. c  om
        cell.padLeft(paddingAmount);
        break;
    }
    case RIGHT: {
        cell.padRight(paddingAmount);
        break;
    }
    case TOP: {
        cell.padTop(paddingAmount);
        break;
    }
    case BOTTOM: {
        cell.padBottom(paddingAmount);
        break;
    }
    case ALL: {
        cell.pad(paddingAmount);
    }
    default: {
        throw new IllegalStateException(
                "Unknown " + CellPadding.class.getSimpleName() + " value [" + paddingType + "]");
    }
    }
}