Package com.ardor3d.math

Examples of com.ardor3d.math.ColorRGBA


     */
    public void setForegroundColor(final ReadOnlyColorRGBA color) {
        if (color == null) {
            _foregroundColor = null;
        } else if (_foregroundColor == null) {
            _foregroundColor = new ColorRGBA(color);
        } else {
            _foregroundColor.set(color);
        }
        fireStyleChanged();
        fireComponentDirty();
View Full Code Here


            SubTexUtil._mesh.setRenderState(SubTexUtil._tstate);
            SubTexUtil._mesh.updateWorldRenderStates(false);
        }

        // Setup our tint color and alpha value.
        final ColorRGBA defaultColor = ColorRGBA.fetchTempInstance();
        if (tintOverride != null) {
            defaultColor.set(tintOverride);
            defaultColor.setAlpha(UIComponent.getCurrentOpacity() * tintOverride.getAlpha());
        } else if (subTex.getTint() != null) {
            defaultColor.set(subTex.getTint());
            defaultColor.setAlpha(UIComponent.getCurrentOpacity() * subTex.getTint().getAlpha());
        } else {
            defaultColor.set(ColorRGBA.WHITE);
            defaultColor.setAlpha(UIComponent.getCurrentOpacity());
        }
        SubTexUtil._mesh.setDefaultColor(defaultColor);
        ColorRGBA.releaseTempInstance(defaultColor);

        final float endY = subTex.getEndY();
View Full Code Here

        if (getSelectionLength() == 0) {
            return;
        }

        // set our alpha
        final ColorRGBA color = ColorRGBA.fetchTempInstance();
        color.set(_standin.getDefaultColor()).setAlpha(UIComponent.getCurrentOpacity());
        _standin.setDefaultColor(color);
        ColorRGBA.releaseTempInstance(color);

        // set our location
        _standin.setWorldTransform(xform);
View Full Code Here

            SubTexUtil._mesh.setRenderState(SubTexUtil._tstate);
            SubTexUtil._mesh.updateWorldRenderStates(false);
        }

        // Setup our tint color and alpha value.
        final ColorRGBA defaultColor = ColorRGBA.fetchTempInstance();
        if (subTex.getTint() != null) {
            defaultColor.set(subTex.getTint());
            defaultColor.setAlpha(UIComponent.getCurrentOpacity() * subTex.getTint().getAlpha());
        } else {
            defaultColor.set(ColorRGBA.WHITE);
            defaultColor.setAlpha(UIComponent.getCurrentOpacity());
        }
        SubTexUtil._mesh.setDefaultColor(defaultColor);
        ColorRGBA.releaseTempInstance(defaultColor);

        final float endY = subTex.getEndY();
View Full Code Here

    public void setTint(final ReadOnlyColorRGBA tint) {
        if (tint == null) {
            _tint = null;
        } else if (_tint == null) {
            _tint = new ColorRGBA(tint);
        } else {
            _tint.set(tint);
        }
    }
View Full Code Here

        }
    }

    public void setTintAlpha(final float alpha) {
        if (_tint == null) {
            _tint = new ColorRGBA(1.0f, 1.0f, 1.0f, alpha);
        } else {
            _tint.setAlpha(alpha);
        }
    }
View Full Code Here

                // bottom right
                component.getPlacement() != TabPlacement.NORTH && component.getPlacement() != TabPlacement.WEST ? new SubTex(
                        _sharedTex, 77, 65, 4, 4)
                        : null);

        final ColorRGBA upTop = new ColorRGBA(235 / 255f, 235 / 255f, 235 / 255f, 1);
        final ColorRGBA upBottom = new ColorRGBA(200 / 255f, 200 / 255f, 200 / 255f, 1);
        final GradientBackdrop upBack = new GradientBackdrop(upTop, upTop, upBottom, upBottom);
        final ColorRGBA downTop = new ColorRGBA(181 / 255f, 181 / 255f, 181 / 255f, 1);
        final ColorRGBA downBottom = new ColorRGBA(232 / 255f, 232 / 255f, 232 / 255f, 1);
        final GradientBackdrop downBack = new GradientBackdrop(downTop, downTop, downBottom, downBottom);
        // DEFAULT
        {
            component.getDefaultState().setBorder(defaultBorder);
            component.getDefaultState().setBackdrop(upBack);
            component.getDefaultState().setForegroundColor(ColorRGBA.BLACK);
        }
        // DISABLED
        {
            component.getDisabledState().setBorder(defaultBorder);
            component.getDisabledState().setBackdrop(upBack);
            component.getDisabledState().setForegroundColor(ColorRGBA.GRAY);

            component.getDisabledSelectedState().setBorder(pressedBorder);
            component.getDisabledSelectedState().setBackdrop(downBack);
            component.getDisabledSelectedState().setForegroundColor(ColorRGBA.GRAY);
        }
        // MOUSE OVER
        {
            final ColorRGBA top = new ColorRGBA(241 / 255f, 241 / 255f, 241 / 255f, 1);
            final ColorRGBA bottom = new ColorRGBA(216 / 255f, 216 / 255f, 216 / 255f, 1);
            final GradientBackdrop back = new GradientBackdrop(top, top, bottom, bottom);

            component.getMouseOverState().setBorder(overBorder);
            component.getMouseOverState().setBackdrop(back);
            component.getMouseOverState().setForegroundColor(ColorRGBA.BLACK);
View Full Code Here

                // bottom left
                new SubTex(_sharedTex, 47, 65, 4, 4),
                // bottom right
                new SubTex(_sharedTex, 77, 65, 4, 4));

        final ColorRGBA upTop = new ColorRGBA(235 / 255f, 235 / 255f, 235 / 255f, 1);
        final ColorRGBA upBottom = new ColorRGBA(200 / 255f, 200 / 255f, 200 / 255f, 1);
        final GradientBackdrop upBack = new GradientBackdrop(upTop, upTop, upBottom, upBottom);
        final ColorRGBA downTop = new ColorRGBA(181 / 255f, 181 / 255f, 181 / 255f, 1);
        final ColorRGBA downBottom = new ColorRGBA(232 / 255f, 232 / 255f, 232 / 255f, 1);
        final GradientBackdrop downBack = new GradientBackdrop(downTop, downTop, downBottom, downBottom);
        // DEFAULT
        {
            component.getDefaultState().setBorder(defaultBorder);
            component.getDefaultState().setBackdrop(upBack);
            component.getDefaultState().setForegroundColor(ColorRGBA.BLACK);
        }
        // DISABLED
        {
            component.getDisabledState().setBorder(defaultBorder);
            component.getDisabledState().setBackdrop(upBack);
            component.getDisabledState().setForegroundColor(ColorRGBA.GRAY);

            component.getDisabledSelectedState().setBorder(pressedBorder);
            component.getDisabledSelectedState().setBackdrop(downBack);
            component.getDisabledSelectedState().setForegroundColor(ColorRGBA.GRAY);
        }
        // MOUSE OVER
        {
            final ColorRGBA top = new ColorRGBA(241 / 255f, 241 / 255f, 241 / 255f, 1);
            final ColorRGBA bottom = new ColorRGBA(216 / 255f, 216 / 255f, 216 / 255f, 1);
            final GradientBackdrop back = new GradientBackdrop(top, top, bottom, bottom);

            component.getMouseOverState().setBorder(overBorder);
            component.getMouseOverState().setBackdrop(back);
            component.getMouseOverState().setForegroundColor(ColorRGBA.BLACK);
View Full Code Here

                        // 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
View Full Code Here

        ; // nothing to do
    }

    @Override
    protected void applyToProgressBar(final UIProgressBar component) {
        final ColorRGBA top = new ColorRGBA(235 / 255f, 235 / 255f, 235 / 255f, 1);
        final ColorRGBA bottom = new ColorRGBA(200 / 255f, 200 / 255f, 200 / 255f, 1);
        final GradientBackdrop mainBack = new GradientBackdrop(top, top, bottom, bottom);
        component.getMainPanel().setBackdrop(mainBack);
        component.getMainPanel().setBorder(new EmptyBorder(0, 0, 0, 0));

        final ImageBackdrop barBack = new ImageBackdrop(new SubTex(_sharedTex, 11, 59, 22, 15));
View Full Code Here

TOP

Related Classes of com.ardor3d.math.ColorRGBA

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.