Java 类com.vaadin.ui.components.colorpicker.ColorChangeEvent 实例源码

项目:VaadinUtils    文件:ColorPickerField.java   
public ColorPickerField(iColorFactory colorFactory)
{
    this.colorFactory = colorFactory;
    this.colorPicker = new ColorPicker();
    this.colorPicker.addColorChangeListener(new ColorChangeListener()
    {
        private static final long serialVersionUID = 1L;

        @Override
        public void colorChanged(ColorChangeEvent event)
        {
            setValue(ColorPickerField.this.colorFactory.createColor(event.getColor()));

        }
    });

}
项目:hybridbpm    文件:ChartColorLayout.java   
private void fillTable() {
        colorTable.removeAllItems();

        int rowIndex = 0;
        final Map<String, String> valueColourMap = getPreferenceValue(DiagrammePreference.VALUE_COLOUR_MAP, preferences);
        Iterator<Map.Entry<String, String>> it = valueColourMap.entrySet().iterator();
        while (it.hasNext()) {
            final Map.Entry<String, String> entry = it.next();

            int[] d = ColourUtil.decode(entry.getValue());

            final Color c = new SolidColor(d[0], d[1], d[2]);

            ColorPicker picker = new ColorPicker();
            picker.setColor(new com.vaadin.shared.ui.colorpicker.Color(ColourUtil.decode(c.toString())[0],
                    ColourUtil.decode(c.toString())[1], ColourUtil.decode(c.toString())[2]));
            picker.setPosition(Page.getCurrent().getBrowserWindowWidth() / 2 - 246 / 2,
                    Page.getCurrent().getBrowserWindowHeight() / 2 - 507 / 2);

            picker.addColorChangeListener(new ColorChangeListener() {

                @Override
                public void colorChanged(ColorChangeEvent event) {
                    valueColourMap.put(entry.getKey(), event.getColor().getCSS());

                    preferences.getItemDataSource().getItemProperty(DiagrammePreference.VALUE_COLOUR_MAP).setValue(valueColourMap);

//                    chartLayout.getConfigurationLayout().getLookAndFeelLayout().renderChart();
                }
            });
            colorTable.addItem(new Object[]{entry.getKey(), picker}, rowIndex);
            rowIndex++;
        }
    }
项目:hawkbit    文件:CreateUpdateTypeLayout.java   
@Override
public void colorChanged(final ColorChangeEvent event) {
    setColor(event.getColor());
    for (final ColorSelector select : getColorPickerLayout().getSelectors()) {
        if (!event.getSource().equals(select) && select.equals(this)
                && !select.getColor().equals(getColorPickerLayout().getSelectedColor())) {
            select.setColor(getColorPickerLayout().getSelectedColor());
        }
    }
    ColorPickerHelper.setRgbSliderValues(getColorPickerLayout());
    getPreviewButtonColor(event.getColor().getCSS());
    createDynamicStyleForComponents(tagName, typeKey, tagDesc, event.getColor().getCSS());
}
项目:hawkbit    文件:AbstractCreateUpdateTagLayout.java   
/**
 * On change of color in color picker ,change RGB sliders, components border
 * color and color of preview button.
 */
@Override
public void colorChanged(final ColorChangeEvent event) {
    setColor(event.getColor());
    for (final ColorSelector select : colorPickerLayout.getSelectors()) {
        if (!event.getSource().equals(select) && select.equals(this)
                && !select.getColor().equals(colorPickerLayout.getSelectedColor())) {
            select.setColor(colorPickerLayout.getSelectedColor());
        }
    }
    ColorPickerHelper.setRgbSliderValues(colorPickerLayout);
    getPreviewButtonColor(event.getColor().getCSS());
    createDynamicStyleForComponents(tagName, tagDesc, event.getColor().getCSS());
}
项目:ilves    文件:ColorPickerField.java   
public ColorPickerField() {
    colorPicker = new ColorPicker();
    colorPicker.addColorChangeListener(new ColorChangeListener() {
        @Override
        public void colorChanged(ColorChangeEvent event) {
            setColorToField(event.getColor().getRGB());
        }
    });
    colorPicker.setHistoryVisibility(false);
}