Search in sources :

Example 1 with ColorPaletteEvent

use of com.extjs.gxt.ui.client.event.ColorPaletteEvent in project activityinfo by bedatadriven.

the class PolygonLayerOptions method createColorPicker.

private void createColorPicker() {
    colorPicker.setValue("000000");
    // Set the selected color to the maplayer
    colorPicker.addListener(Events.Select, new Listener<ColorPaletteEvent>() {

        @Override
        public void handleEvent(ColorPaletteEvent be) {
            if (!Objects.equal(layer.getMaxColor(), colorPicker.getValue())) {
                layer.setMaxColor(colorPicker.getValue());
                ValueChangeEvent.fire(PolygonLayerOptions.this, layer);
            }
        }
    });
    LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
    add(labelColor);
    add(colorPicker);
}
Also used : ColorPaletteEvent(com.extjs.gxt.ui.client.event.ColorPaletteEvent) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 2 with ColorPaletteEvent

use of com.extjs.gxt.ui.client.event.ColorPaletteEvent in project activityinfo by bedatadriven.

the class BubbleLayerOptions method createColorPicker.

private void createColorPicker() {
    colorPicker.setValue("000000");
    // Set the selected color to the maplayer
    colorPicker.addListener(Events.Select, new Listener<ColorPaletteEvent>() {

        @Override
        public void handleEvent(ColorPaletteEvent be) {
            bubbleMapLayer.setBubbleColor(colorPicker.getValue());
            ValueChangeEvent.fire(BubbleLayerOptions.this, bubbleMapLayer);
        }
    });
    LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
    add(labelColor);
    add(colorPicker);
}
Also used : ColorPaletteEvent(com.extjs.gxt.ui.client.event.ColorPaletteEvent) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 3 with ColorPaletteEvent

use of com.extjs.gxt.ui.client.event.ColorPaletteEvent in project activityinfo by bedatadriven.

the class BubbleLayerOptions method createColorPicker.

private void createColorPicker() {
    colorPicker.setValue("000000");
    // Set the selected color to the maplayer
    colorPicker.addListener(Events.Select, new Listener<ColorPaletteEvent>() {

        @Override
        public void handleEvent(ColorPaletteEvent be) {
            bubbleMapLayer.setBubbleColor(colorPicker.getValue());
            ValueChangeEvent.fire(BubbleLayerOptions.this, bubbleMapLayer);
        }
    });
    LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
    add(labelColor);
    add(colorPicker);
}
Also used : ColorPaletteEvent(com.extjs.gxt.ui.client.event.ColorPaletteEvent) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 4 with ColorPaletteEvent

use of com.extjs.gxt.ui.client.event.ColorPaletteEvent in project activityinfo by bedatadriven.

the class PolygonLayerOptions method createColorPicker.

private void createColorPicker() {
    colorPicker.setValue("000000");
    // Set the selected color to the maplayer
    colorPicker.addListener(Events.Select, new Listener<ColorPaletteEvent>() {

        @Override
        public void handleEvent(ColorPaletteEvent be) {
            if (!Objects.equal(layer.getMaxColor(), colorPicker.getValue())) {
                layer.setMaxColor(colorPicker.getValue());
                ValueChangeEvent.fire(PolygonLayerOptions.this, layer);
            }
        }
    });
    LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
    add(labelColor);
    add(colorPicker);
}
Also used : ColorPaletteEvent(com.extjs.gxt.ui.client.event.ColorPaletteEvent) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 5 with ColorPaletteEvent

use of com.extjs.gxt.ui.client.event.ColorPaletteEvent in project activityinfo by bedatadriven.

the class ColorField method onTriggerClick.

@Override
protected void onTriggerClick(ComponentEvent ce) {
    super.onTriggerClick(ce);
    menu = new ColorMenu() {

        @Override
        protected void onClick(ComponentEvent ce) {
        // TODO Auto-generated method stub
        }
    };
    menu.getColorPalette().addListener(Events.BeforeSelect, new Listener<ColorPaletteEvent>() {

        @Override
        public void handleEvent(ColorPaletteEvent ce) {
            setValue(ce.getColor());
            menu.hide();
        }
    });
    menu.show(getElement(), "l");
}
Also used : ColorMenu(com.extjs.gxt.ui.client.widget.menu.ColorMenu) ColorPaletteEvent(com.extjs.gxt.ui.client.event.ColorPaletteEvent) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent)

Aggregations

ColorPaletteEvent (com.extjs.gxt.ui.client.event.ColorPaletteEvent)5 LabelField (com.extjs.gxt.ui.client.widget.form.LabelField)4 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 ColorMenu (com.extjs.gxt.ui.client.widget.menu.ColorMenu)1