Package com.vaadin.ui

Examples of com.vaadin.ui.Slider$ValueOutOfBoundsException


        return rgbLayout;
    }

    private Slider createRGBSlider(String caption, String styleName) {
        Slider redSlider = new Slider(caption, 0, 255);
        redSlider.setImmediate(true);
        redSlider.setStyleName("rgb-slider");
        redSlider.setWidth("220px");
        redSlider.addStyleName(styleName);
        return redSlider;
    }
View Full Code Here


        selectors.add(hsvGradient);

        VerticalLayout sliders = new VerticalLayout();
        sliders.setStyleName("hsv-sliders");

        hueSlider = new Slider("Hue", 0, 360);
        saturationSlider = new Slider("Saturation", 0, 100);
        valueSlider = new Slider("Value", 0, 100);

        float[] hsv = color.getHSV();
        setHsvSliderValues(hsv);

        hueSlider.setStyleName("hsv-slider");
View Full Code Here

        return rgbLayout;
    }

    private Slider createRGBSlider(String caption, String styleName) {
        Slider redSlider = new Slider(caption, 0, 255);
        redSlider.setImmediate(true);
        redSlider.setStyleName("rgb-slider");
        redSlider.setWidth("220px");
        redSlider.addStyleName(styleName);
        return redSlider;
    }
View Full Code Here

        selectors.add(hsvGradient);

        VerticalLayout sliders = new VerticalLayout();
        sliders.setStyleName("hsv-sliders");

        hueSlider = new Slider("Hue", 0, 360);
        saturationSlider = new Slider("Saturation", 0, 100);
        valueSlider = new Slider("Value", 0, 100);

        float[] hsv = color.getHSV();
        setHsvSliderValues(hsv);

        hueSlider.setStyleName("hsv-slider");
View Full Code Here

        return rgbLayout;
    }

    private Slider createRGBSlider(String caption, String styleName) {
        Slider redSlider = new Slider(caption, 0, 255);
        redSlider.setImmediate(true);
        redSlider.setStyleName("rgb-slider");
        redSlider.setWidth("220px");
        redSlider.addStyleName(styleName);
        return redSlider;
    }
View Full Code Here

        float[] hsv = color.getHSV();
        VerticalLayout sliders = new VerticalLayout();
        sliders.setStyleName("hsv-sliders");

        hueSlider = new Slider("Hue", 0, 360);
        try {
            hueSlider.setValue(((Float) hsv[0]).doubleValue());
        } catch (ValueOutOfBoundsException e1) {
        }

        hueSlider.setStyleName("hsv-slider");
        hueSlider.addStyleName("hue-slider");
        hueSlider.setWidth("220px");
        hueSlider.setImmediate(true);
        hueSlider.addValueChangeListener(new ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                if (!updatingColors) {
                    float hue = (Float.parseFloat(event.getProperty()
                            .getValue().toString())) / 360f;
                    float saturation = (Float.parseFloat(saturationSlider
                            .getValue().toString())) / 100f;
                    float value = (Float.parseFloat(valueSlider.getValue()
                            .toString())) / 100f;

                    // Set the color
                    Color color = new Color(Color.HSVtoRGB(hue, saturation,
                            value));
                    setColor(color);

                    /*
                     * Set the background color of the hue gradient. This has to
                     * be done here since in the conversion the base color
                     * information is lost when color is black/white
                     */
                    Color bgColor = new Color(Color.HSVtoRGB(hue, 1f, 1f));
                    hsvGradient.setBackgroundColor(bgColor);
                }
            }
        });
        sliders.addComponent(hueSlider);

        saturationSlider = new Slider("Saturation", 0, 100);

        try {
            saturationSlider.setValue(((Float) hsv[1]).doubleValue());
        } catch (ValueOutOfBoundsException e1) {
        }

        saturationSlider.setStyleName("hsv-slider");
        saturationSlider.setWidth("220px");
        saturationSlider.setImmediate(true);
        saturationSlider.addValueChangeListener(new ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                if (!updatingColors) {
                    float hue = (Float.parseFloat(hueSlider.getValue()
                            .toString())) / 360f;
                    float saturation = (Float.parseFloat(event.getProperty()
                            .getValue().toString())) / 100f;
                    float value = (Float.parseFloat(valueSlider.getValue()
                            .toString())) / 100f;
                    Color color = new Color(Color.HSVtoRGB(hue, saturation,
                            value));
                    setColor(color);
                }
            }
        });
        sliders.addComponent(saturationSlider);

        valueSlider = new Slider("Value", 0, 100);

        try {
            valueSlider.setValue(((Float) hsv[2]).doubleValue());
        } catch (ValueOutOfBoundsException e1) {
        }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Slider$ValueOutOfBoundsException

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.