List of usage examples for com.google.gwt.user.client.ui ResizeLayoutPanel setWidget
@Override
public void setWidget(Widget w)
From source file:ch.unifr.pai.twice.layout.client.eclipseLayout.MiceSplitLayoutPanel.java
License:Apache License
/** * Adds a widget to the panel. If the widget is a {@link ResizeLayoutPanel}, this means that it is a container and therefore should be added directly. * Otherwise it has to be wrapped with such a {@link ResizeLayoutPanel} to ensure, that it is resizing accordingly to changing dimensions. * //from w ww . j a v a 2s . co m * If the widget that shall be added is {@link MiceSplitLayoutPanel} or a {@link MiceLayoutTabPanel}, it can be added to the newly created * {@link ResizeLayoutPanel} directly. For all other widgets, a new {@link MiceLayoutTabPanel} has to be introduced and the widget (or if it is a * {@link ComplexPanel} the children of the widget) has/have to be added to this tab. * * @see com.google.gwt.user.client.ui.SplitLayoutPanel#insert(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.ui.DockLayoutPanel.Direction, * double, com.google.gwt.user.client.ui.Widget) */ @Override public void insert(Widget child, Direction direction, double size, Widget before) { if (child instanceof ResizeLayoutPanel) { super.insert(child, direction, size, before); } else { ResizeLayoutPanel panel = new ResizeLayoutPanel(); if (child instanceof MiceSplitLayoutPanel || child instanceof MiceLayoutTabPanel) { panel.setWidget(child); super.insert(panel, direction, size, before); } else { MiceLayoutTabPanel slot = new MiceLayoutTabPanel(20); if (child instanceof ComplexPanel) { ComplexPanel p = (ComplexPanel) child; for (int i = p.getWidgetCount(); i > 0; i--) { slot.add(p.getWidget(i - 1)); } if (slot.getWidgetCount() > 0) slot.selectTab(0); } else { slot.add(child); } panel.setWidget(slot); super.insert(panel, direction, size, before); } } }
From source file:org.geomajas.gwt2.example.client.sample.general.AlternativeControlsPanel.java
License:Open Source License
public Widget asWidget() { // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); // Create the MapPresenter and add to the layout: mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); layout.setPresenter(mapPresenter);// w ww .j a v a 2 s . c o m // Initialize the map, and return the layout: GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm", new DefaultMapWidget[] { DefaultMapWidget.ZOOM_TO_RECTANGLE_CONTROL, DefaultMapWidget.PAN_CONTROL, DefaultMapWidget.ZOOM_STEP_CONTROL, DefaultMapWidget.SCALEBAR }); return resizeLayoutPanel; }
From source file:org.geomajas.gwt2.example.client.sample.general.MapFillPanel.java
License:Open Source License
public Widget asWidget() { // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); // Create the MapPresenter and add to the layout: mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler()); layout.setPresenter(mapPresenter);/* ww w.j a v a2 s . com*/ // Initialize the map, and return the layout: GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm"); return resizeLayoutPanel; }
From source file:org.geomajas.gwt2.example.client.sample.general.MapTraceNavigationPanel.java
License:Open Source License
public Widget asWidget() { // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); // Create the MapPresenter and add to the layout: mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); mapPresenter.getConfiguration().setHintValue(MapConfiguration.ANIMATION_TIME, 1000); mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler()); layout.setPresenter(mapPresenter);//from w w w . j ava 2s . c om // Initialize the map, and return the layout: GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm"); return resizeLayoutPanel; }
From source file:org.geomajas.gwt2.plugin.corewidget.example.client.sample.feature.FeatureClickedExample.java
License:Open Source License
/** * Default constructor./*from w w w . java 2 s . c om*/ */ public FeatureClickedExample() { rootElement = UIBINDER.createAndBindUi(this); // Create the MapPresenter mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); // add FeatureClickedHandler where we handle FeaturesClickedEvent mapPresenter.getEventBus().addHandler(FeatureClickedHandler.TYPE, new MyFeatureClickedHandler()); // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); layout.setPresenter(mapPresenter); mapPanel.add(resizeLayoutPanel); // Initialize the map GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "appCoreWidget", "mapCoreWidget"); // add feature clicked listener. FeatureClickedListener mapListener = new FeatureClickedListener(); mapPresenter.addMapListener(mapListener); // Create the tooltip. toolTip = new ToolTip(); }
From source file:org.geomajas.gwt2.plugin.corewidget.example.client.sample.feature.FeatureMouseOverExample.java
License:Open Source License
/** * Default constructor./*w ww.j a v a 2s . c o m*/ */ public FeatureMouseOverExample() { rootElement = UIBINDER.createAndBindUi(this); // Create the MapPresenter mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); // add FeatureClickedHandler where we handle FeaturesClickedEvent mapPresenter.getEventBus().addHandler(FeatureMouseOverHandler.TYPE, new MyFeatureMouseOverHandler()); // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); layout.setPresenter(mapPresenter); mapPanel.add(resizeLayoutPanel); // Initialize the map GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "appCoreWidget", "mapCoreWidget"); /////////////////////////////////////////////////////////////////////////////////////////// // We have to add the FeatureMouseOverListener after the map has been initialized. /////////////////////////////////////////////////////////////////////////////////////////// // add feature mouse over listener. mapPresenter.getEventBus().addMapInitializationHandler(new MapInitializationHandler() { @Override public void onMapInitialized(MapInitializationEvent event) { FeatureMouseOverListener listener = new FeatureMouseOverListener(); mapPresenter.addMapListener(listener); } }); /////////////////////////////////////////////////////////////////////////////////////////// // Create the tooltip and keep track of the mouse pointer position. /////////////////////////////////////////////////////////////////////////////////////////// toolTip = new ToolTip(); }
From source file:org.geomajas.gwt2.plugin.geocoder.example.client.sample.GeoCoderExample.java
License:Open Source License
public GeoCoderExample() { rootElement = UIBINDER.createAndBindUi(this); // Create the MapPresenter mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); // Initialize the map mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler()); GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "geocoder-app", "mapOsm"); ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); layout.setPresenter(mapPresenter);/* w w w. ja v a 2 s . co m*/ // create geocoder widget GeocoderWidget geocoder = new GeocoderWidget(mapPresenter); geocoder.asWidget().getElement().getStyle().setTop(7, Style.Unit.PX); geocoder.asWidget().getElement().getStyle().setLeft(100, Style.Unit.PX); // add geocoder widget to the map mapPresenter.getWidgetPane().add(geocoder.asWidget()); mapPanel.setWidget(resizeLayoutPanel); }
From source file:org.geomajas.gwt2.widget.example.client.sample.featureselectbox.FeatureSelectedExample.java
License:Open Source License
public FeatureSelectedExample() { rootElement = UIBINDER.createAndBindUi(this); // Create the MapPresenter mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); // add FeatureClickedHandler where we handle FeatureClickedEvent mapPresenter.getEventBus().addHandler(FeatureClickedHandler.TYPE, new MyFeatureClickedHandler()); // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); layout.setPresenter(mapPresenter);/* ww w . j av a 2s. c om*/ mapPanel.add(resizeLayoutPanel); // Initialize the map GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt2-widget-app", "mapGhent"); // add featured clicked listener. mapPresenter.addMapListener(new FeatureClickedListener(7)); }
From source file:org.geomajas.gwt2.widget.example.client.sample.mouseover.FeatureMouseOverExample.java
License:Open Source License
public FeatureMouseOverExample() { rootElement = UIBINDER.createAndBindUi(this); // Create the MapPresenter mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); // Define the layout: ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); layout.setPresenter(mapPresenter);//from w w w .ja v a 2s . co m mapPanel.add(resizeLayoutPanel); // Initialize the map GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt2-widget-app", "mapGhent"); // add feature mouse over listener. MouseOverListener listener = new MouseOverListener(7); mapPresenter.addMapListener(listener); }
From source file:org.geomajas.plugin.geocoder.puregwt.example.client.sample.GeoCoderExample.java
License:Open Source License
public GeoCoderExample() { rootElement = UIBINDER.createAndBindUi(this); // Create the MapPresenter mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); // Initialize the map mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler()); GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "geocoder-app", "mapOsm"); ResizeLayoutPanel resizeLayoutPanel = new ResizeLayoutPanel(); final MapLayoutPanel layout = new MapLayoutPanel(); resizeLayoutPanel.setWidget(layout); resizeLayoutPanel.setSize("100%", "100%"); layout.setPresenter(mapPresenter);//from w w w.j av a2 s . c om // create geocoder widget GeocoderWidget geocoder = new GeocoderWidget(mapPresenter); geocoder.getElement().getStyle().setTop(7, Style.Unit.PX); geocoder.getElement().getStyle().setLeft(100, Style.Unit.PX); // add geocoder widget to the map mapPresenter.getWidgetPane().add(geocoder); mapPanel.setWidget(resizeLayoutPanel); }