Search in sources :

Example 1 with LayerOptionsPanel

use of org.activityinfo.ui.client.component.report.editor.map.layerOptions.LayerOptionsPanel in project activityinfo by bedatadriven.

the class MapEditor method createLayersOptionsPanel.

protected void createLayersOptionsPanel() {
    optionsPanel = new LayerOptionsPanel(dispatcher);
    optionsPanel.setVisible(false);
    optionsPanel.addListener(Events.Hide, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            mapPanel.setZoomControlOffsetX(ZOOM_CONTROL_LEFT_MARGIN);
        }
    });
    optionsPanel.addListener(Events.Show, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            mapPanel.setZoomControlOffsetX(LayerOptionsPanel.WIDTH + ZOOM_CONTROL_LEFT_MARGIN);
        }
    });
    optionsPanel.addValueChangeHandler(new ValueChangeHandler<MapLayer>() {

        @Override
        public void onValueChange(ValueChangeEvent<MapLayer> event) {
            MapEditor.this.mapReportElement.setFilter(event.getValue().getFilter());
            reportEventBus.fireChange();
        }
    });
    add(optionsPanel, new AbsoluteData(0, CONTROL_TOP_MARGIN));
}
Also used : MapLayer(org.activityinfo.legacy.shared.reports.model.layers.MapLayer) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent) AbsoluteData(com.extjs.gxt.ui.client.widget.layout.AbsoluteData) LayerOptionsPanel(org.activityinfo.ui.client.component.report.editor.map.layerOptions.LayerOptionsPanel)

Aggregations

BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)1 AbsoluteData (com.extjs.gxt.ui.client.widget.layout.AbsoluteData)1 MapLayer (org.activityinfo.legacy.shared.reports.model.layers.MapLayer)1 LayerOptionsPanel (org.activityinfo.ui.client.component.report.editor.map.layerOptions.LayerOptionsPanel)1