List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:com.google.gwt.maps.sample.hellomaps.client.MapUIOptionsDemo.java
License:Apache License
public MapUIOptionsDemo() { VerticalPanel vp = new VerticalPanel(); Size smallSize = Size.newInstance(250, 250); HorizontalPanel smallMapPanel = new HorizontalPanel(); new UIOptionsControl(smallMapPanel, smallSize); smallMapPanel.getElement().getStyle().setPropertyPx("marginBottom", 20); Size largeSize = Size.newInstance(500, 400); HorizontalPanel largeMapPanel = new HorizontalPanel(); new UIOptionsControl(largeMapPanel, largeSize); vp.add(new Label("Small Map with default UI style")); vp.add(smallMapPanel);/*ww w .j a va 2 s . c o m*/ vp.add(new Label("Large Map with default UI style")); vp.add(largeMapPanel); initWidget(vp); }
From source file:com.google.gwt.maps.sample.hellomaps.client.OverlayDemo.java
License:Apache License
public OverlayDemo() { VerticalPanel vertPanel = new VerticalPanel(); vertPanel.setStyleName("hm-panel"); actionListBox = new ListBox(); for (OverlayDemos od : OverlayDemos.values()) { actionListBox.addItem(od.valueOf()); }//from w w w . ja v a 2 s. c o m actionListBox.addChangeListener(new ChangeListener() { public void onChange(Widget sender) { displayOverlay(); } }); HorizontalPanel horizPanel = new HorizontalPanel(); horizPanel.add(new Label("Choose Action:")); horizPanel.add(actionListBox); horizPanel.setSpacing(10); vertPanel.add(horizPanel); map = new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13); map.setSize("500px", "300px"); map.addControl(new SmallMapControl()); map.addControl(new MapTypeControl()); vertPanel.add(map); initWidget(vertPanel); }
From source file:com.google.gwt.maps.testing.client.maps.AutocompletePlacesMapWidget.java
License:Apache License
private void draw() { pWidget.clear();//from w w w . j av a2s .c o m HTML html = new HTML("<br><br>Map with autocomplete places "); tbPlaces = new TextBox(); tbPlaces.setWidth("350px"); HorizontalPanel hp = new HorizontalPanel(); hp.add(html); hp.add(tbPlaces); pWidget.add(hp); hp.setCellVerticalAlignment(tbPlaces, HorizontalPanel.ALIGN_BOTTOM); drawMap(); drawAutoComplete(); }
From source file:com.google.gwt.maps.testing.client.maps.BasicMapWidget.java
License:Apache License
private void draw() { Button addBounceMarkerButton = new Button("Add Marker with Bounce"); addBounceMarkerButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerBouncing != null) { markerBouncing.clear();/*from w w w . j ava 2s . c o m*/ } drawMarkerWithBounceAnimation(); } }); Button addDropMarkerButton = new Button("Add Marker with Drop"); addDropMarkerButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerDrop != null) { markerDrop.clear(); } drawMarkerWithDropAnimation(); } }); Button stopAnimationsButton = new Button("Stop Animations"); stopAnimationsButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerBasic != null) { markerBasic.setAnimation(Animation.STOPANIMATION); } if (markerBouncing != null) { markerBouncing.setAnimation(Animation.STOPANIMATION); } if (markerDrop != null) { markerDrop.setAnimation(Animation.STOPANIMATION); } } }); Button startAnimationsButton = new Button("Start Animations"); startAnimationsButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerBasic != null) { markerBasic.setAnimation(Animation.BOUNCE); } if (markerBouncing != null) { markerBouncing.setAnimation(Animation.BOUNCE); } if (markerDrop != null) { markerDrop.setAnimation(Animation.DROP); } } }); // basic controls to test markers HorizontalPanel hp = new HorizontalPanel(); hp.add(new HTML("<br>Basic Map Example. With an AdUnit")); hp.add(addBounceMarkerButton); hp.add(new HTML(" ")); hp.add(addDropMarkerButton); hp.add(new HTML(" ")); hp.add(startAnimationsButton); hp.add(new HTML(" ")); hp.add(stopAnimationsButton); hp.setCellVerticalAlignment(addBounceMarkerButton, VerticalPanel.ALIGN_BOTTOM); hp.setCellVerticalAlignment(addDropMarkerButton, VerticalPanel.ALIGN_BOTTOM); hp.setCellVerticalAlignment(startAnimationsButton, VerticalPanel.ALIGN_BOTTOM); hp.setCellVerticalAlignment(stopAnimationsButton, VerticalPanel.ALIGN_BOTTOM); pWidget.clear(); pWidget.add(hp); drawMap(); drawMapAds(); drawBasicMarker(); }
From source file:com.google.gwt.maps.testing.client.maps.DirectionsServiceMapWidget.java
License:Apache License
private void draw() { pWidget.clear();//w w w.j a v a 2 s . c o m pWidget.add(new HTML("<br/>")); HorizontalPanel hp = new HorizontalPanel(); pWidget.add(hp); hp.add(new HTML("Directions Service ")); hp.add(htmlDistanceMatrixService); drawMap(); drawDirectionsWithMidPoint(); }
From source file:com.google.gwt.maps.testing.client.maps.KmlMapWidget.java
License:Apache License
private void draw() { pWidget.clear();/*from w ww. j ava 2s .c om*/ pWidget.add(new HTML(" ")); HorizontalPanel hp = new HorizontalPanel(); hp.add(new HTML("Kml Example - Try clicking on marker ")); pWidget.add(hp); drawMap(); // draw kmls // changeKmlState(); drawKml2(); }
From source file:com.google.gwt.maps.testing.client.maps.LanguageMapWidget.java
License:Apache License
private void draw() { HorizontalPanel hp = new HorizontalPanel(); hp.add(new HTML("Language use example.")); pWidget.clear();// www. ja va 2 s .com pWidget.add(hp); Runnable onload = new Runnable() { public void run() { drawMap(); } }; LoadApi.go(onload, LoadApi.LoadLibrary.values(), false, Language.CHINESE_SIMPLIFIED); }
From source file:com.google.gwt.maps.testing.client.maps.MultipleKmlMapWidget.java
License:Apache License
private void draw() { pWidget.clear();//from ww w.j a va2 s.c o m pWidget.add(new HTML(" ")); HorizontalPanel hp = new HorizontalPanel(); hp.add(new HTML( "Multiple Kml Example --- See this used on <a href='http://www.cyclingthealps.com/#tour-de-france-2012-stages'>www.cyclingthealps.com</a>")); pWidget.add(hp); drawMap(); drawRoutesPanel(); }
From source file:com.google.gwt.maps.testing.client.maps.MultipleKmlMapWidget.java
License:Apache License
private void addRoutes() { final CheckBox check1 = new CheckBox(); final CheckBox check2 = new CheckBox(); final CheckBox check3 = new CheckBox(); final CheckBox check4 = new CheckBox(); final CheckBox check5 = new CheckBox(); final CheckBox check6 = new CheckBox(); final CheckBox check7 = new CheckBox(); // Introduction HorizontalPanel pTitle = new HorizontalPanel(); Label lTitle = new Label("Enable Disable Routes"); pTitle.add(lTitle);/* w w w . j av a 2s . c om*/ HorizontalPanel pDevider = new HorizontalPanel(); Label lDevider = new Label("--------------------------"); pDevider.add(lDevider); // stage 1 HorizontalPanel stage1 = new HorizontalPanel(); check1.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check1.getValue() == true) { kmlLoad(route1); } else { kmlUnload(route1); } } }); Label stage1Label = new Label("Route 1"); stage1.add(check1); stage1.add(stage1Label); // stage 2 HorizontalPanel stage2 = new HorizontalPanel(); check2.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check2.getValue() == true) { kmlLoad(route2); } else { kmlUnload(route2); } } }); Label stage2Label = new Label("Route 2"); stage2.add(check2); stage2.add(stage2Label); // stage 3 HorizontalPanel stage3 = new HorizontalPanel(); check3.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check3.getValue() == true) { kmlLoad(route3); } else { kmlUnload(route3); } } }); Label stage3Label = new Label("Route 3"); stage3.add(check3); stage3.add(stage3Label); // stage 4 HorizontalPanel stage4 = new HorizontalPanel(); check4.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check4.getValue() == true) { kmlLoad(route4); } else { kmlUnload(route4); } } }); Label stage4Label = new Label("Route 4"); stage4.add(check4); stage4.add(stage4Label); // stage 5 HorizontalPanel stage5 = new HorizontalPanel(); check5.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check5.getValue() == true) { kmlLoad(route5); } else { kmlUnload(route5); } } }); Label stage5Label = new Label("Route 5"); stage5.add(check5); stage5.add(stage5Label); // stage 6 HorizontalPanel stage6 = new HorizontalPanel(); check6.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check6.getValue() == true) { kmlLoad(route6); } else { kmlUnload(route6); } } }); Label stage19Label = new Label("Route 6"); stage6.add(check6); stage6.add(stage19Label); // stage 7 HorizontalPanel stage7 = new HorizontalPanel(); check7.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (check7.getValue() == true) { kmlLoad(route7); } else { kmlUnload(route7); } } }); Label stage7Label = new Label("Route 7"); stage7.add(check7); stage7.add(stage7Label); // Adding all horizontal panels to the vertical panel pRoutes pRoutes.add(pTitle); pRoutes.add(pDevider); pRoutes.add(stage1); pRoutes.add(stage2); pRoutes.add(stage3); pRoutes.add(stage4); pRoutes.add(stage5); pRoutes.add(stage6); pRoutes.add(stage7); }
From source file:com.google.gwt.maps.testing.client.maps.OverlayViewMapWidget.java
License:Apache License
private void draw() { // This is just to show the effect of behind the scenes final ToggleButton groundOverlayBtn = new ToggleButton("Clear Ground Overlay", "Add Ground Overlay"); groundOverlayBtn.setStyleName("toggleButton"); groundOverlayBtn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (groundOverlayBtn.isDown()) { groundOverlay.setMap(null); } else { groundOverlay.setMap(mapWidget); }/* w ww. j a va 2s . c o m*/ } }); final ToggleButton customOverlayBtn = new ToggleButton("Clear custom Overlay", "Add custom Overlay"); customOverlayBtn.setStyleName("toggleButton"); customOverlayBtn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (customOverlayBtn.isDown()) { htmlOverlayMessage.getElement().removeFromParent(); } else { customOverlayView.setMap(mapWidget); } } }); final ToggleButton overlayViewBtn = new ToggleButton("Remove Overlay View", "Add Overlay View"); overlayViewBtn.setStyleName("toggleButton"); overlayViewBtn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (overlayViewBtn.isDown()) { customOverlayView.setMap(null); } else { customOverlayView.setMap(mapWidget); } } }); HorizontalPanel hp = new HorizontalPanel(); hp.add(overlayViewBtn); hp.add(groundOverlayBtn); hp.add(customOverlayBtn); pWidget.clear(); pWidget.add(hp); htmlOverlayMessage = new VerticalPanel(); htmlOverlayMessage.setStyleName("customOverlay"); drawMap(); drawOverlay_Generic_OverlayView(); drawOverlay_GroundOverlay(); }