Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.ColorChooserButton


        return colorChooserButton;
    }

    private void updateColorControl(Dictionary<String, Object> dictionary, String key) {
        ColorChooserButton colorChooserButton = (ColorChooserButton)controls.get(key);

        if (colorChooserButton != null) {
            Color value = (Color)dictionary.get(key);
            colorChooserButton.setSelectedColor(value);
        }
    }
View Full Code Here


    private static Component addColorControl(final Dictionary<String, Object> dictionary,
        final String key, Form.Section section) {
        Color color = (Color)dictionary.get(key);

        ColorChooserButton colorChooserButton = new ColorChooserButton();
        colorChooserButton.setSelectedColor(color);
        section.add(colorChooserButton);
        Form.setLabel(colorChooserButton, key);

        colorChooserButton.getColorChooserButtonSelectionListeners().add
            (new ColorChooserButtonSelectionListener() {
            @Override
            public void selectedColorChanged(ColorChooserButton colorChooserButtonArgument,
                Color previousSelectedColor) {
                try {
View Full Code Here

        return colorChooserButton;
    }

    private void updateColorControl(Dictionary<String, Object> dictionary, String key) {
        ColorChooserButton colorChooserButton = (ColorChooserButton)controls.get(key);

        if (colorChooserButton != null) {
            Color value = (Color)dictionary.get(key);
            colorChooserButton.setSelectedColor(value);
        }
    }
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        ColorChooserButton colorChooserButton = (ColorChooserButton)component;
        colorChooserButton.getColorChooserButtonSelectionListeners().add(this);
    }
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        ColorChooserButton colorChooserButton = (ColorChooserButton)component;
        colorChooserButton.getColorChooserButtonSelectionListeners().add(this);
    }
View Full Code Here

    private static Component addColorControl(final Dictionary<String, Object> dictionary,
        final String key, Form.Section section) {
        Color color = (Color)dictionary.get(key);

        ColorChooserButton colorChooserButton = new ColorChooserButton();
        colorChooserButton.setSelectedColor(color);
        section.add(colorChooserButton);
        Form.setLabel(colorChooserButton, key);

        colorChooserButton.getColorChooserButtonSelectionListeners().add
            (new ColorChooserButtonSelectionListener() {
            @Override
            public void selectedColorChanged(ColorChooserButton colorChooserButton,
                Color previousSelectedColor) {
                try {
                    dictionary.put(key, colorChooserButton.getSelectedColor());
                } catch (Exception exception) {
                    displayErrorMessage(exception, colorChooserButton.getWindow());
                    dictionary.put(key, previousSelectedColor);
                }
            }
        });
View Full Code Here

        return colorChooserButton;
    }

    private void updateColorControl(Dictionary<String, Object> dictionary, String key) {
        ColorChooserButton colorChooserButton = (ColorChooserButton)controls.get(key);

        if (colorChooserButton != null) {
            Color value = (Color)dictionary.get(key);
            colorChooserButton.setSelectedColor(value);
        }
    }
View Full Code Here

        colorChooserPopup.getDecorators().add(dropShadowDecorator);
    }

    @Override
    public int getPreferredWidth(int height) {
        ColorChooserButton colorChooserButton = (ColorChooserButton)getComponent();
        Button.DataRenderer dataRenderer = colorChooserButton.getDataRenderer();

        dataRenderer.render(colorChooserButton.getButtonData(), colorChooserButton, false);

        int preferredWidth = dataRenderer.getPreferredWidth(-1) + TRIGGER_WIDTH
            + padding.left + padding.right + 2;

        return preferredWidth;
View Full Code Here

        return preferredWidth;
    }

    @Override
    public int getPreferredHeight(int width) {
        ColorChooserButton colorChooserButton = (ColorChooserButton)getComponent();
        Button.DataRenderer dataRenderer = colorChooserButton.getDataRenderer();

        dataRenderer.render(colorChooserButton.getButtonData(), colorChooserButton, false);

        int preferredHeight = dataRenderer.getPreferredHeight(-1)
            + padding.top + padding.bottom + 2;

        return preferredHeight;
View Full Code Here

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        ColorChooserButton colorChooserButton = (ColorChooserButton)getComponent();

        Button.DataRenderer dataRenderer = colorChooserButton.getDataRenderer();
        dataRenderer.render(colorChooserButton.getButtonData(), colorChooserButton, false);

        Dimensions contentSize = dataRenderer.getPreferredSize();
        int preferredWidth = contentSize.width + TRIGGER_WIDTH + padding.left + padding.right + 2;
        int preferredHeight = contentSize.height + padding.top + padding.bottom + 2;
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.ColorChooserButton

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.