Package com.ardor3d.math

Examples of com.ardor3d.math.ColorRGBA


        applyToFrame(component);
    }

    @Override
    protected void applyToComboBox(final UIComboBox component) {
        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);

        // value label
        {
            final UIBorder labelBorder = new ImageBorder(
            // left
                    new SubTex(_sharedTex, 155, 11, 4, 10),
                    // right
                    new SubTex(_sharedTex, 185, 11, 4, 10),
                    // top
                    new SubTex(_sharedTex, 159, 7, 16, 4),
                    // bottom
                    new SubTex(_sharedTex, 159, 21, 16, 4),
                    // top left
                    new SubTex(_sharedTex, 155, 7, 4, 4),
                    // top right
                    new SubTex(_sharedTex, 177, 7, 1, 4),
                    // bottom left
                    new SubTex(_sharedTex, 155, 21, 4, 4),
                    // bottom right
                    new SubTex(_sharedTex, 177, 21, 1, 4));

            final UILabel label = component.getValueLabel();
            label.setBackdrop(upBack);
            label.setBorder(labelBorder);
            label.setAlignment(Alignment.LEFT);
            label.setPadding(new Insets(0, 2, 0, 2));
        }

        // drop down button
        {
            final UIBorder buttonBorder = new ImageBorder(
            // left
                    new SubTex(_sharedTex, 177, 11, 1, 10),
                    // right
                    new SubTex(_sharedTex, 185, 11, 4, 10),
                    // top
                    new SubTex(_sharedTex, 178, 7, 7, 4),
                    // bottom
                    new SubTex(_sharedTex, 178, 21, 7, 4),
                    // top left
                    new SubTex(_sharedTex, 177, 7, 1, 4),
                    // top right
                    new SubTex(_sharedTex, 185, 7, 4, 4),
                    // bottom left
                    new SubTex(_sharedTex, 177, 21, 1, 4),
                    // bottom right
                    new SubTex(_sharedTex, 185, 21, 4, 4));

            final UIButton button = component.getOpenButton();
            button.setButtonText("");
            button.setButtonIcon(new SubTex(_sharedTex, 196, 12, 10, 9));
            button.getMouseOverState().setIcon(new SubTex(_sharedTex, 210, 12, 10, 9));
            button.setBorder(buttonBorder);
            button.setBackdrop(upBack);
            button.setMargin(new Insets(0, 0, 0, 0));
            button.setPadding(new Insets(0, 1, 0, 1));
            for (final UIState state : button.getStates()) {
                state.setBorder(buttonBorder);
                state.setBackdrop(upBack);
            }
        }

        // skin for menuitems
        {
            final EmptyBorder itemBorder = new EmptyBorder();
            final EmptyBackdrop itemBackdrop = new EmptyBackdrop();
            final SolidBackdrop overBackdrop = new SolidBackdrop(new ColorRGBA(50 / 255f, 50 / 255f, 200 / 255f, 1));
            component.setItemSkinCallback(new SkinningTask() {
                @Override
                public void skinComponent(final UIComponent c) {
                    c.setBorder(itemBorder);
                    c.setBackdrop(itemBackdrop);
View Full Code Here


    }

    @Override
    protected void applyToScrollBar(final UIScrollBar component) {
        final SolidBorder border = new SolidBorder(1, 1, 1, 1);
        border.setColor(new ColorRGBA(165 / 255f, 165 / 255f, 165 / 255f, 1f));
        component.setMargin(new Insets());
        component.setPadding(new Insets());
        component.setBorder(border);
        {
            final UIButton button = component.getBtTopLeft();
            button.setBackdrop(null);
            button.setBorder(new EmptyBorder());
            button.setPadding(new Insets(0, 0, 0, 0));
            button.setMargin(new Insets(0, 0, 0, 0));
            for (final UIState state : button.getStates()) {
                state.setBorder(null);
                state.setBackdrop(null);
            }
            button.setButtonText("");
            if (component.getOrientation() == Orientation.Horizontal) {
                button.setButtonIcon(new SubTex(_sharedTex, 130, 121, 16, 15));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 130, 137, 16, 15));
            } else {
                button.setButtonIcon(new SubTex(_sharedTex, 97, 120, 15, 16));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 113, 120, 15, 16));
            }
        }
        {
            final UIButton button = component.getBtBottomRight();
            button.setBackdrop(null);
            button.setBorder(new EmptyBorder());
            button.setPadding(new Insets(0, 0, 0, 0));
            button.setMargin(new Insets(0, 0, 0, 0));
            for (final UIState state : button.getStates()) {
                state.setBorder(null);
                state.setBackdrop(null);
            }
            button.setButtonText("");
            if (component.getOrientation() == Orientation.Horizontal) {
                button.setButtonIcon(new SubTex(_sharedTex, 147, 121, 16, 15));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 147, 137, 16, 15));
            } else {
                button.setButtonIcon(new SubTex(_sharedTex, 97, 137, 15, 16));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 113, 137, 15, 16));
            }
        }
        {
            final UISlider slider = component.getSlider();
            slider.getBackPanel().setBorder(new EmptyBorder());
            slider.setMargin(new Insets());
            slider.setPadding(new Insets());
            slider.getBackPanel().setLayout(new RowLayout(false));

            final UISliderKnob knob = slider.getKnob();
            knob.getKnobLabel().setIcon(null);
            knob.setPadding(new Insets(0, 0, 0, 0));
            knob.setMargin(new Insets());
            final ColorRGBA colorTop = new ColorRGBA(235 / 255f, 235 / 255f, 235 / 255f, 1);
            final ColorRGBA colorBtm = new ColorRGBA(200 / 255f, 200 / 255f, 200 / 255f, 1);
            final GradientBackdrop knobColor = new GradientBackdrop(colorTop, colorTop, colorBtm, colorBtm);
            knob.getKnobLabel().setBackdrop(knobColor);
            knob.getKnobLabel().setBorder(border);
        }
    }
View Full Code Here

        _handle.attachChild(_yArrow);
        return this;
    }

    public MoveWidget withZAxis() {
        return withZAxis(new ColorRGBA(0, 0, 1, .65f));
    }
View Full Code Here

    protected ReadOnlyVector3 _arrowDirection;

    public SimpleScaleWidget() {}

    public SimpleScaleWidget withArrow(final ReadOnlyVector3 arrowDirection) {
        return withArrow(arrowDirection, new ColorRGBA(1.0f, 0.0f, 0.0f, 0.4f), 0, 0);
    }
View Full Code Here

    public MaterialState getMaterialState() {
        if (Ka != null || Kd != null || Ks != null || d != -1 || Ns != -1) {
            final MaterialState material = new MaterialState();
            final float alpha = d != -1 ? MathUtils.clamp(d, 0, 1) : 1;
            if (Ka != null) {
                material.setAmbient(new ColorRGBA(Ka[0], Ka[1], Ka[2], alpha));
            }
            if (Kd != null) {
                material.setDiffuse(new ColorRGBA(Kd[0], Kd[1], Kd[2], alpha));
            }
            if (Ks != null) {
                material.setSpecular(new ColorRGBA(Ks[0], Ks[1], Ks[2], alpha));
            }

            if (Ns != -1) {
                material.setShininess(Ns);
            }
View Full Code Here

            _zRing.setTexture(texture);
        }
    }

    public RotateWidget withXAxis() {
        return withXAxis(new ColorRGBA(1, 0, 0, .65f));
    }
View Full Code Here

        _handle.attachChild(_xRing);
        return this;
    }

    public RotateWidget withYAxis() {
        return withYAxis(new ColorRGBA(0, 1, 0, .65f));
    }
View Full Code Here

        _handle.attachChild(_yRing);
        return this;
    }

    public RotateWidget withZAxis() {
        return withZAxis(new ColorRGBA(0, 0, 1, .65f));
    }
View Full Code Here

    }

    private void setData() {
        getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(getMeshData().getVertexBuffer(), trailVertices));
        getMeshData().setNormalBuffer(BufferUtils.createVector3Buffer(getMeshData().getNormalBuffer(), trailVertices));
        setDefaultColor(new ColorRGBA(ColorRGBA.WHITE));
        setTextureData();
        setIndexData();
    }
View Full Code Here

        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        _root.setRenderState(ts);

        // Set up a basic, default light.
        final PointLight light = new PointLight();
        light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 0.75f, 0.75f));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(100, 100, 100));
        light.setEnabled(true);

        // Attach the light to a lightState and the lightState to rootNode.
        final LightState lightState = new LightState();
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.