All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.czyzby.lml.parser.impl.attribute.table.TablePadBottomLmlAttribute Maven / Gradle / Ivy

Go to download

Templates for LibGDX Scene2D UI with HTML-like syntax and FreeMarker-inspired macros.

There is a newer version: 1.9.1.9.6
Show newest version
package com.github.czyzby.lml.parser.impl.attribute.table;

import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.Value;
import com.github.czyzby.lml.parser.LmlParser;
import com.github.czyzby.lml.parser.tag.LmlAttribute;
import com.github.czyzby.lml.parser.tag.LmlTag;
import com.github.czyzby.lml.util.LmlUtilities;

/** See {@link Table#padBottom(Value)} . See
 * {@link LmlUtilities#parseHorizontalValue(LmlParser, LmlTag, com.badlogic.gdx.scenes.scene2d.Actor, String)} and
 * {@link LmlUtilities#parseVerticalValue(LmlParser, LmlTag, com.badlogic.gdx.scenes.scene2d.Actor, String)} for more
 * info on value parsing. To avoid collision with cell attributes, this attribute is mapped to "tablePadBottom".
 *
 * @author MJ */
public class TablePadBottomLmlAttribute implements LmlAttribute {
    @Override
    public Class
getHandledType() { return Table.class; } @Override public void process(final LmlParser parser, final LmlTag tag, final Table actor, final String rawAttributeData) { final Value verticalPad = LmlUtilities.parseVerticalValue(parser, tag, actor, rawAttributeData); actor.padBottom(verticalPad); } }