Search in sources :

Example 1 with SliderEvent

use of com.extjs.gxt.ui.client.event.SliderEvent 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 2 with SliderEvent

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

the class PiechartLayerOptions method createMinMaxSliders.

private void createMinMaxSliders() {
    setSliderDefaults(sliderMinSize);
    setSliderDefaults(sliderMaxSize);
    sliderMinSize.setValue(16);
    sliderMaxSize.setValue(48);
    sliderfieldMinSize = new SliderField(sliderMinSize);
    sliderfieldMinSize.setFieldLabel(I18N.CONSTANTS.radiusMinimum());
    sliderfieldMaxSize = new SliderField(sliderMaxSize);
    sliderfieldMaxSize.setFieldLabel(I18N.CONSTANTS.radiusMaximum());
    panel.add(sliderfieldMinSize, formData);
    panel.add(sliderfieldMaxSize, formData);
    // 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) {
            timerMinSlider.cancel();
            timerMaxSlider.schedule(250);
        }
    });
    timerMinSlider = new Timer() {

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

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

Example 3 with SliderEvent

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

the class PiechartLayerOptions method createMinMaxSliders.

private void createMinMaxSliders() {
    setSliderDefaults(sliderMinSize);
    setSliderDefaults(sliderMaxSize);
    sliderMinSize.setValue(16);
    sliderMaxSize.setValue(48);
    SliderField sliderfieldMinSize = new SliderField(sliderMinSize);
    sliderfieldMinSize.setFieldLabel(I18N.CONSTANTS.radiusMinimum());
    SliderField sliderfieldMaxSize = new SliderField(sliderMaxSize);
    sliderfieldMaxSize.setFieldLabel(I18N.CONSTANTS.radiusMaximum());
    panel.add(sliderfieldMinSize, formData);
    panel.add(sliderfieldMaxSize, formData);
    // 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) {
            timerMinSlider.cancel();
            timerMaxSlider.schedule(250);
        }
    });
    timerMinSlider = new Timer() {

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

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

Example 4 with SliderEvent

use of com.extjs.gxt.ui.client.event.SliderEvent 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)

Aggregations

SliderEvent (com.extjs.gxt.ui.client.event.SliderEvent)4 Timer (com.google.gwt.user.client.Timer)4 LabelField (com.extjs.gxt.ui.client.widget.form.LabelField)2 SliderField (com.extjs.gxt.ui.client.widget.form.SliderField)2