Search in sources :

Example 16 with LabelField

use of com.extjs.gxt.ui.client.widget.form.LabelField in project activityinfo by bedatadriven.

the class BubbleLayerOptions method createMinMaxSliders.

private void createMinMaxSliders() {
    setSliderDefaults(sliderMinSize);
    setSliderDefaults(sliderMaxSize);
    sliderMinSize.setValue(16);
    sliderMaxSize.setValue(48);
    LabelField labelMin = new LabelField(I18N.CONSTANTS.radiusMinimum());
    LabelField labelMax = new LabelField(I18N.CONSTANTS.radiusMaximum());
    add(labelMin);
    add(sliderMinSize);
    add(labelMax);
    add(sliderMaxSize);
    // Ensure min can't be more then max, and max can't be less then min
    sliderMinSize.addListener(Events.Change, new Listener<SliderEvent>() {

        @Override
        public void handleEvent(SliderEvent be) {
            timerMinSlider.cancel();
            timerMinSlider.schedule(250);
        }
    });
    sliderMaxSize.addListener(Events.Change, new Listener<SliderEvent>() {

        @Override
        public void handleEvent(SliderEvent be) {
            timerMaxSlider.cancel();
            timerMaxSlider.schedule(250);
        }
    });
    timerMinSlider = new Timer() {

        @Override
        public void run() {
            if (sliderMinSize.getValue() > sliderMaxSize.getValue()) {
                sliderMinSize.setValue(sliderMaxSize.getValue());
            }
            bubbleMapLayer.setMinRadius(sliderMinSize.getValue());
            ValueChangeEvent.fire(BubbleLayerOptions.this, bubbleMapLayer);
        }
    };
    timerMaxSlider = new Timer() {

        @Override
        public void run() {
            if (sliderMaxSize.getValue() < sliderMinSize.getValue()) {
                sliderMaxSize.setValue(sliderMinSize.getValue());
            }
            bubbleMapLayer.setMaxRadius(sliderMaxSize.getValue());
            ValueChangeEvent.fire(BubbleLayerOptions.this, bubbleMapLayer);
        }
    };
}
Also used : SliderEvent(com.extjs.gxt.ui.client.event.SliderEvent) Timer(com.google.gwt.user.client.Timer) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 17 with LabelField

use of com.extjs.gxt.ui.client.widget.form.LabelField 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)

Aggregations

LabelField (com.extjs.gxt.ui.client.widget.form.LabelField)17 DateField (com.extjs.gxt.ui.client.widget.form.DateField)5 ColorPaletteEvent (com.extjs.gxt.ui.client.event.ColorPaletteEvent)4 HorizontalPanel (com.extjs.gxt.ui.client.widget.HorizontalPanel)4 SliderEvent (com.extjs.gxt.ui.client.event.SliderEvent)2 VerticalPanel (com.extjs.gxt.ui.client.widget.VerticalPanel)2 Timer (com.google.gwt.user.client.Timer)2 Axis (org.activityinfo.shared.report.content.PivotTableData.Axis)2 FieldEvent (com.extjs.gxt.ui.client.event.FieldEvent)1 CheckBox (com.extjs.gxt.ui.client.widget.form.CheckBox)1 FieldSet (com.extjs.gxt.ui.client.widget.form.FieldSet)1 Radio (com.extjs.gxt.ui.client.widget.form.Radio)1 RadioGroup (com.extjs.gxt.ui.client.widget.form.RadioGroup)1 Hyperlink (com.google.gwt.user.client.ui.Hyperlink)1 Image (com.google.gwt.user.client.ui.Image)1 DataEntryPlace (org.activityinfo.client.page.entry.place.DataEntryPlace)1 ActivityDTO (org.activityinfo.shared.dto.ActivityDTO)1 AdminEntityDTO (org.activityinfo.shared.dto.AdminEntityDTO)1 ProjectDTO (org.activityinfo.shared.dto.ProjectDTO)1 EntityCategory (org.activityinfo.shared.report.content.EntityCategory)1