Package com.ardor3d.extension.ui.util

Examples of com.ardor3d.extension.ui.util.Insets


        super(new BorderLayout());
        setHorizontal(horizontal);

        _textLabel = new UILabel("");
        _textLabel.setBorder(new EmptyBorder());
        _textLabel.setMargin(new Insets(0, 0, 0, 0));
        _textLabel.setPadding(new Insets(0, 0, 0, 0));
        _textLabel.setLayoutData(BorderLayoutData.WEST);
        setLabelText(labelText);
        add(_textLabel);

        _mainPanel = new UIPanel(new BorderLayout());
View Full Code Here


     */
    public void setMargin(final Insets margin) {
        if (margin == null) {
            _margin = null;
        } else if (_margin == null) {
            _margin = new Insets(margin);
        } else {
            _margin.set(margin);
        }
    }
View Full Code Here

     */
    public void setPadding(final Insets padding) {
        if (padding == null) {
            _padding = null;
        } else if (_padding == null) {
            _padding = new Insets(padding);
        } else {
            _padding.set(padding);
        }
    }
View Full Code Here

    }

    @Override
    protected void applyToTab(final UITab component) {

        component.setMargin(new Insets(1, 1, 1, 1));
        component.setPadding(new Insets(2, 14, 2, 14));

        // State values...
        final UIBorder defaultBorder = new ImageBorder(
        // left
                component.getPlacement() != TabPlacement.EAST ? new SubTex(_sharedTex, 47, 11, 4, 10) : new SubTex(
View Full Code Here

    @Override
    protected void applyToButton(final UIButton component) {

        component.setAlignment(Alignment.MIDDLE);
        component.setMargin(new Insets(1, 1, 1, 1));
        component.setPadding(new Insets(2, 14, 2, 14));

        // State values...
        final UIBorder defaultBorder = new ImageBorder(
        // left
                new SubTex(_sharedTex, 47, 11, 4, 10),
View Full Code Here

    }

    @Override
    protected void applyToCheckBox(final UICheckBox component) {

        component.setMargin(new Insets(1, 1, 1, 1));
        component.setPadding(new Insets(1, 1, 1, 1));
        component.setBorder(new EmptyBorder());
        component.setBackdrop(new EmptyBackdrop());
        component.setAlignment(Alignment.LEFT);
        component.setGap(4);
View Full Code Here

        // TITLE BAR
        {
            final UIFrameBar titleBar = component.getTitleBar();
            // Make sure exists and is attached
            if (titleBar != null && titleBar.getParent() == component) {
                titleBar.setMargin(new Insets(0, 0, 0, 0));
                titleBar.setPadding(new Insets(0, 0, 0, 0));
                final UIBorder border = new ImageBorder(
                // left
                        new SubTex(_sharedTex, 4, 11, 6, 6),
                        // right
                        new SubTex(_sharedTex, 30, 11, 6, 6),
                        // top
                        new SubTex(_sharedTex, 10, 5, 20, 6),
                        // bottom
                        new SubTex(_sharedTex, 9, 9, 20, 1),
                        // top left
                        new SubTex(_sharedTex, 4, 5, 6, 6),
                        // top right
                        new SubTex(_sharedTex, 30, 5, 6, 6),
                        // bottom left
                        new SubTex(_sharedTex, 4, 16, 6, 1),
                        // bottom right
                        new SubTex(_sharedTex, 30, 16, 6, 1));
                titleBar.setBorder(border);
                final ColorRGBA top = new ColorRGBA(203 / 255f, 203 / 255f, 203 / 255f, 1);
                final ColorRGBA bottom = new ColorRGBA(208 / 255f, 208 / 255f, 208 / 255f, 1);
                final GradientBackdrop grad = new GradientBackdrop(top, top, bottom, bottom);
                titleBar.setBackdrop(grad);

                titleBar.getTitleLabel().setMargin(new Insets(0, 5, 0, 0));
                titleBar.getTitleLabel().setForegroundColor(ColorRGBA.BLACK);

                // CLOSE BUTTON
                {
                    final UIButton closeButton = titleBar.getCloseButton();
                    if (closeButton != null) {
                        closeButton.setButtonText("");
                        closeButton.setButtonIcon(new SubTex(_sharedTex, 94, 76, 16, 16));
                        closeButton.getPressedState().setIcon(new SubTex(_sharedTex, 94, 94, 16, 16));
                        for (final UIState state : closeButton.getStates()) {
                            state.setBackdrop(new EmptyBackdrop());
                            state.setBorder(new EmptyBorder());
                            state.setPadding(new Insets(0, 0, 0, 0));
                            state.setMargin(new Insets(1, 1, 1, 1));
                        }
                        closeButton.refreshState();
                        closeButton.updateMinimumSizeFromContents();
                        closeButton.compact();
                        closeButton
                                .setMaximumContentSize(closeButton.getContentWidth(), closeButton.getContentHeight());
                    }
                }

                // MINIMIZE BUTTON
                {
                    final UIButton minimizeButton = titleBar.getMinimizeButton();
                    if (minimizeButton != null) {
                        minimizeButton.setButtonText("");
                        minimizeButton.setButtonIcon(new SubTex(_sharedTex, 113, 76, 16, 16));
                        minimizeButton.getPressedState().setIcon(new SubTex(_sharedTex, 113, 94, 16, 16));
                        for (final UIState state : minimizeButton.getStates()) {
                            state.setBackdrop(new EmptyBackdrop());
                            state.setBorder(new EmptyBorder());
                            state.setPadding(new Insets(0, 0, 0, 0));
                            state.setMargin(new Insets(1, 1, 1, 1));
                        }
                        minimizeButton.refreshState();
                        minimizeButton.updateMinimumSizeFromContents();
                        minimizeButton.compact();
                        minimizeButton.setMaximumContentSize(minimizeButton.getContentWidth(), minimizeButton
                                .getContentHeight());
                    }
                }

                // EXPAND BUTTON
                {
                    final UIButton expandButton = titleBar.getExpandButton();
                    if (expandButton != null) {
                        expandButton.setButtonText("");
                        expandButton.setButtonIcon(new SubTex(_sharedTex, 132, 76, 16, 16));
                        expandButton.getPressedState().setIcon(new SubTex(_sharedTex, 132, 94, 16, 16));
                        for (final UIState state : expandButton.getStates()) {
                            state.setBackdrop(new EmptyBackdrop());
                            state.setBorder(new EmptyBorder());
                            state.setPadding(new Insets(0, 0, 0, 0));
                            state.setMargin(new Insets(1, 1, 1, 1));
                        }
                        expandButton.refreshState();
                        expandButton.updateMinimumSizeFromContents();
                        expandButton.compact();
                        expandButton.setMaximumContentSize(expandButton.getContentWidth(), expandButton
                                .getContentHeight());
                    }
                }

                // MINIMIZE BUTTON
                {
                    final UIButton helpButton = titleBar.getHelpButton();
                    if (helpButton != null) {
                        helpButton.setButtonText("");
                        helpButton.setButtonIcon(new SubTex(_sharedTex, 151, 76, 16, 16));
                        helpButton.getPressedState().setIcon(new SubTex(_sharedTex, 151, 94, 16, 16));
                        for (final UIState state : helpButton.getStates()) {
                            state.setBackdrop(new EmptyBackdrop());
                            state.setBorder(new EmptyBorder());
                            state.setPadding(new Insets(0, 0, 0, 0));
                            state.setMargin(new Insets(1, 1, 1, 1));
                        }
                        helpButton.refreshState();
                        helpButton.updateMinimumSizeFromContents();
                        helpButton.compact();
                        helpButton.setMaximumContentSize(helpButton.getContentWidth(), helpButton.getContentHeight());
                    }
                }
            }
        }

        // BASE PANEL
        {
            final UIPanel base = component.getBasePanel();

            base.setMargin(new Insets(0, 0, 0, 0));
            base.setPadding(new Insets(0, 0, 0, 0));

            final UIBorder border = new ImageBorder(
            // left
                    new SubTex(_sharedTex, 4, 17, 6, 29),
                    // right
                    new SubTex(_sharedTex, 30, 17, 6, 29),
                    // top
                    new SubTex(_sharedTex, 0, 0, 0, 0),
                    // bottom
                    new SubTex(_sharedTex, 10, 46, 20, 7),
                    // top left
                    null,
                    // top right
                    null,
                    // bottom left
                    new SubTex(_sharedTex, 4, 46, 6, 7),
                    // bottom right
                    new SubTex(_sharedTex, 30, 46, 6, 7));
            base.setBorder(border);
            final ColorRGBA top = new ColorRGBA(210 / 255f, 210 / 255f, 210 / 255f, 1);
            final ColorRGBA bottom = new ColorRGBA(244 / 255f, 244 / 255f, 244 / 255f, 1);
            final GradientBackdrop grad = new GradientBackdrop(top, top, bottom, bottom);
            base.setBackdrop(grad);
        }

        // STATUS BAR
        {
            final UIFrameStatusBar statusBar = component.getStatusBar();
            // Make sure exists and is attached
            if (statusBar != null && statusBar.getParent() == component.getBasePanel()) {
                statusBar.setLocalComponentHeight(12);
                statusBar.setMaximumContentHeight(statusBar.getContentHeight());

                final UIButton resize = statusBar.getResizeButton();
                if (resize != null && resize.getParent() == statusBar) {
                    for (final UIState state : resize.getStates()) {
                        state.setBackdrop(new EmptyBackdrop());
                        state.setBorder(new EmptyBorder());
                        state.setPadding(new Insets(0, 0, 0, 0));
                        state.setMargin(new Insets(0, 0, 0, 0));
                        state.setForegroundColor(ColorRGBA.GRAY);
                    }
                    resize.refreshState();
                    resize.updateMinimumSizeFromContents();
                    resize.setMinimumContentSize(resize.getContentWidth(), resize.getContentHeight());
View Full Code Here

        border.setRightColor(ColorRGBA.LIGHT_GRAY);
        border.setBottomColor(ColorRGBA.LIGHT_GRAY);

        final SolidBackdrop backdrop = new SolidBackdrop(ColorRGBA.WHITE);

        component.setPadding(new Insets(1, 1, 1, 1));

        for (final UIState state : component.getStates()) {
            state.setBorder(border);
            state.setBackdrop(backdrop);
            if (state.equals(component.getDisabledState())) {
View Full Code Here

        border.setRightColor(ColorRGBA.LIGHT_GRAY);
        border.setBottomColor(ColorRGBA.LIGHT_GRAY);

        final SolidBackdrop backdrop = new SolidBackdrop(ColorRGBA.WHITE);

        component.setPadding(new Insets(1, 1, 1, 1));

        for (final UIState state : component.getStates()) {
            state.setBorder(border);
            state.setBackdrop(backdrop);
            if (state.equals(component.getDisabledState())) {
View Full Code Here

    }

    @Override
    protected void applyToRadioButton(final UIRadioButton component) {

        component.setMargin(new Insets(1, 1, 1, 1));
        component.setPadding(new Insets(1, 1, 1, 1));
        component.setBorder(new EmptyBorder());
        component.setBackdrop(new EmptyBackdrop());
        component.setAlignment(Alignment.LEFT);
        component.setGap(4);
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.ui.util.Insets

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.