Search in sources :

Example 1 with ContainerInteger

use of org.terasology.rendering.nui.widgets.browser.ui.style.ContainerInteger in project Terasology by MovingBlocks.

the class HTMLUtils method createParagraphRenderStyleFromCommonAttributes.

public static ParagraphRenderStyle createParagraphRenderStyleFromCommonAttributes(Attributes attributes) {
    Color textColor = getTextColor(attributes);
    ParagraphRenderStyle.FloatStyle floatStyle = getFloatStyle(attributes);
    ParagraphRenderStyle.ClearStyle clearStyle = getClearStyle(attributes);
    HorizontalAlign horizontalAlign = getHorizontalAlign(attributes);
    Color backgroundColor = getBackgroundColor(attributes);
    ContainerInteger paragraphMarginTop = getParagraphMarginTop(attributes);
    ContainerInteger paragraphMarginBottom = getParagraphMarginBottom(attributes);
    ContainerInteger paragraphMarginLeft = getParagraphMarginLeft(attributes);
    ContainerInteger paragraphMarginRight = getParagraphMarginRight(attributes);
    ContainerInteger paragraphPaddingTop = getParagraphPaddingTop(attributes);
    ContainerInteger paragraphPaddingBottom = getParagraphPaddingBottom(attributes);
    ContainerInteger paragraphPaddingLeft = getParagraphPaddingLeft(attributes);
    ContainerInteger paragraphPaddingRight = getParagraphPaddingRight(attributes);
    ContainerInteger minimumWidth = getMinimumWidth(attributes);
    return new ParagraphRenderStyle() {

        @Override
        public Color getColor(boolean hyperlink) {
            return textColor;
        }

        @Override
        public FloatStyle getFloatStyle() {
            return floatStyle;
        }

        @Override
        public ClearStyle getClearStyle() {
            return clearStyle;
        }

        @Override
        public HorizontalAlign getHorizontalAlignment() {
            return horizontalAlign;
        }

        @Override
        public Color getParagraphBackground() {
            return backgroundColor;
        }

        @Override
        public ContainerInteger getParagraphMarginTop() {
            return paragraphMarginTop;
        }

        @Override
        public ContainerInteger getParagraphMarginBottom() {
            return paragraphMarginBottom;
        }

        @Override
        public ContainerInteger getParagraphMarginLeft() {
            return paragraphMarginLeft;
        }

        @Override
        public ContainerInteger getParagraphMarginRight() {
            return paragraphMarginRight;
        }

        @Override
        public ContainerInteger getParagraphPaddingTop() {
            return paragraphPaddingTop;
        }

        @Override
        public ContainerInteger getParagraphPaddingBottom() {
            return paragraphPaddingBottom;
        }

        @Override
        public ContainerInteger getParagraphPaddingLeft() {
            return paragraphPaddingLeft;
        }

        @Override
        public ContainerInteger getParagraphPaddingRight() {
            return paragraphPaddingRight;
        }

        @Override
        public ContainerInteger getParagraphMinimumWidth() {
            return minimumWidth;
        }
    };
}
Also used : PercentageContainerInteger(org.terasology.rendering.nui.widgets.browser.ui.style.PercentageContainerInteger) ContainerInteger(org.terasology.rendering.nui.widgets.browser.ui.style.ContainerInteger) FixedContainerInteger(org.terasology.rendering.nui.widgets.browser.ui.style.FixedContainerInteger) Color(org.terasology.rendering.nui.Color) HorizontalAlign(org.terasology.rendering.nui.HorizontalAlign) ParagraphRenderStyle(org.terasology.rendering.nui.widgets.browser.ui.style.ParagraphRenderStyle)

Aggregations

Color (org.terasology.rendering.nui.Color)1 HorizontalAlign (org.terasology.rendering.nui.HorizontalAlign)1 ContainerInteger (org.terasology.rendering.nui.widgets.browser.ui.style.ContainerInteger)1 FixedContainerInteger (org.terasology.rendering.nui.widgets.browser.ui.style.FixedContainerInteger)1 ParagraphRenderStyle (org.terasology.rendering.nui.widgets.browser.ui.style.ParagraphRenderStyle)1 PercentageContainerInteger (org.terasology.rendering.nui.widgets.browser.ui.style.PercentageContainerInteger)1