Search in sources :

Example 1 with ScaleChangeEvent

use of org.geosdi.geoplatform.gui.configuration.map.puregwt.event.ScaleChangeEvent in project geo-platform by geosdi.

the class GeoPlatformLayoutManager method createCenter.

/**
 * Create Center Panel in Main UI
 */
private void createCenter() {
    center = new ContentPanel();
    center.setHeaderVisible(false);
    BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);
    data.setMargins(new Margins(5, 5, 5, 5));
    center.setLayoutOnChange(true);
    center.addWidgetListener(new WidgetListener() {

        @Override
        public void widgetResized(ComponentEvent ce) {
            Dispatcher.forwardEvent(GeoPlatformEvents.UPDATE_CENTER);
            MapHandlerManager.fireEvent(new ScaleChangeEvent(XDOM.getViewportSize()));
        }
    });
    ToolBar toolBar = new ToolBar();
    statusMap = new Status();
    statusMap.setText(ApiModuleMessages.INSTANCE.GeoPlatformLayoutManager_wellcomeMessage(GWT.getModuleName()));
    statusMap.setWidth(150);
    toolBar.add(statusMap);
    toolBar.add(new FillToolItem());
    center.setBottomComponent(toolBar);
    viewport.add(center, data);
}
Also used : WidgetListener(com.extjs.gxt.ui.client.event.WidgetListener) Status(com.extjs.gxt.ui.client.widget.Status) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) ToolBar(com.extjs.gxt.ui.client.widget.toolbar.ToolBar) Margins(com.extjs.gxt.ui.client.util.Margins) ScaleChangeEvent(org.geosdi.geoplatform.gui.configuration.map.puregwt.event.ScaleChangeEvent) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) FillToolItem(com.extjs.gxt.ui.client.widget.toolbar.FillToolItem) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Aggregations

ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 WidgetListener (com.extjs.gxt.ui.client.event.WidgetListener)1 Margins (com.extjs.gxt.ui.client.util.Margins)1 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 Status (com.extjs.gxt.ui.client.widget.Status)1 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)1 FillToolItem (com.extjs.gxt.ui.client.widget.toolbar.FillToolItem)1 ToolBar (com.extjs.gxt.ui.client.widget.toolbar.ToolBar)1 ScaleChangeEvent (org.geosdi.geoplatform.gui.configuration.map.puregwt.event.ScaleChangeEvent)1