Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.FlowPanel


  private TrafficOverlay trafficInfo;

  private boolean trafficShown;

  public TrafficOverlayDemo() {
    Panel panel = new FlowPanel();

    map = new MapWidget(LatLng.newInstance(40.652513, -73.936615), 12);
    map.setSize("640px", "480px");
    panel.add(map);
    Button toggleTraffic = new Button("Toggle Traffic");
    toggleTraffic.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (trafficShown) {
          map.removeOverlay(trafficInfo);
        } else {
          map.addOverlay(trafficInfo);
        }
        trafficShown = !trafficShown;
      }
    });
    panel.add(toggleTraffic);
    final Label changeLabel = new Label();
    panel.add(changeLabel);
    initWidget(panel);
    trafficInfo = new TrafficOverlay();
    trafficInfo.addTrafficOverlayChangedHandler(new TrafficOverlayChangedHandler() {

      public void onChanged(TrafficOverlayChangedEvent event) {
View Full Code Here


  private final MapWidget map;
  private final Button removeAddButton;
  private final Button showHideButton;

  public KmlOverlayDemo() {
    Panel panel = new FlowPanel();
    map = new MapWidget(LatLng.newInstance(41.875696, -87.624207), 11);
    map.setSize("640px", "480px");
    map.setUIToDefault();
    panel.add(map);

    // Toggle the visibility of the overlays by
    // adding and removing the overlay.
    removeAddButton = new Button("Add KML Overlay");
    // Toggle the visibility of the overlays
    // using the show() and hide() methods
    showHideButton = new Button("Hide");
    removeAddButton.setEnabled(false);
    removeAddButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        toggleOverlay();
      }
    });
    panel.add(removeAddButton);

    showHideButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (geoXml == null) {
          return;
        }
        if (geoXml.isHidden()) {
          geoXml.setVisible(true);
          showHideButton.setText("Hide");
        } else {
          geoXml.setVisible(false);
          showHideButton.setText("Show");
        }
      }
    });

    panel.add(showHideButton);
    initWidget(panel);

    GeoXmlOverlay.load(KML_DEMO_URI, new GeoXmlLoadCallback() {

      @Override
View Full Code Here

  private boolean geoXmlShown;
  private MapWidget map;
  private Button toggleButton;

  public GeoRssOverlayDemo() {
    Panel panel = new FlowPanel();

    map = new MapWidget(LatLng.newInstance(49.496675, -102.65625), 3);
    map.setSize("640px", "480px");
    map.setUIToDefault();
    panel.add(map);
    toggleButton = new Button("Toggle Markers");
    toggleButton.setEnabled(false);
    toggleButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (geoXml == null) {
          return;
        }
        if (geoXmlShown) {
          map.removeOverlay(geoXml);
        } else {
          map.addOverlay(geoXml);
        }
        geoXmlShown = !geoXmlShown;
      }
    });
    panel.add(toggleButton);
    initWidget(panel);

    GeoXmlOverlay.load(
        "http://api.flickr.com/services/feeds/groups_pool.gne?id=322338@N20&format=rss_200&georss=1",
        new GeoXmlLoadCallback() {
View Full Code Here

  }

  private MapWidget map;

  public EarthPluginDemo() {
    Panel panel = new FlowPanel();
    map = new MapWidget(LatLng.newInstance(37.42317, -122.08364), 16);
    map.setSize("500px", "500px");
    map.setUIToDefault();
    map.addMapType(MapType.getEarthMap());
    map.setCurrentMapType(MapType.getEarthMap());
    panel.add(map);
    initWidget(panel);
    map.getEarthInstance(new EarthInstanceHandler() {

      public void onEarthInstance(EarthInstanceEvent event) {
        final JavaScriptObject earth = event.getEarthInstance();
View Full Code Here

        public TimeBoxMenu() {
            super(true);
            setStyleName("gwt-TimeBox-menu");
            addAutoHidePartner(textbox.getElement());

            FlowPanel container = new FlowPanel();

            int numOptions = (int) (DAY / INTERVAL);
            options = new TimeBoxMenuOption[numOptions];

            // we need to use times for formatting, but we don't keep
            // them around. the purpose is only to generate text to
            // insert into the textbox.
            for (int i = 0; i < numOptions; i++) {
                options[i] = new TimeBoxMenuOption(i * INTERVAL);
                container.add(options[i]);
            }

            add(container);
        }
View Full Code Here

  private StreetviewOverlay svOverlay;

  private boolean svShown;

  public StreetviewOverlayDemo() {
    Panel panel = new FlowPanel();

    map = new MapWidget(LatLng.newInstance(40.652513, -73.936615), 12);
    map.setSize("640px", "480px");
    panel.add(map);
    Button toggleStreetview = new Button("Toggle Street View Overlay");
    toggleStreetview.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (svShown) {
          map.removeOverlay(svOverlay);
        } else {
          map.addOverlay(svOverlay);
        }
        svShown = !svShown;
      }
    });
    panel.add(toggleStreetview);
    final Label changeLabel = new Label();
    panel.add(changeLabel);
    initWidget(panel);
    svOverlay = new StreetviewOverlay();
    svOverlay.addStreetviewOverlayChangedHandler(new StreetviewOverlayChangedHandler() {

      public void onChanged(StreetviewOverlayChangedEvent event) {
View Full Code Here

  private Label lngLabel;

  private MapWidget map;

  public GeocoderDemo() {
    Panel panel = new FlowPanel();
    final FormPanel form = new FormPanel();
    form.setAction("#");

    Panel formElements = new FlowPanel();
    final TextBox address = new TextBox();
    address.setVisibleLength(60);
    address.setText("10 10th Street, Atlanta, GA");
    formElements.add(address);
    formElements.add(buildLatLngPanel());
    this.displayLatLng(ATLANTA);

    Button submit = new Button("Go!");
    submit.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        form.submit();
      }
    });
    formElements.add(submit);
    form.add(formElements);
    form.addSubmitHandler(new SubmitHandler() {
      public void onSubmit(SubmitEvent event) {
        showAddress(address.getText());
        event.cancel();
View Full Code Here

  private final Geocoder geocoder;

  private final MapWidget map;

  public Geocoder2Demo() {
    Panel panel = new FlowPanel();
    final FormPanel form = new FormPanel();
    form.setAction("#");
    Panel formElements = new FlowPanel();
    Label label = new Label("Search for an address:");
    formElements.add(label);
    final TextBox addressBox = new TextBox();
    addressBox.setVisibleLength(40);
    formElements.add(addressBox);
    Button submit = new Button("Search");
    submit.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        form.submit();
      }
    });
    formElements.add(submit);
    form.add(formElements);
    form.addSubmitHandler(new SubmitHandler() {
      public void onSubmit(SubmitEvent event) {
        showAddress(addressBox.getText());
        event.cancel();
View Full Code Here

      return false;
    }

    @Override
    protected Widget initialize(final MapWidget map) {
      Panel container = new FlowPanel();
      Button zoomInButton = new Button("Zoom In");
      zoomInButton.setStyleName("textualZoomControl");
      zoomInButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent clickEvent) {
          map.zoomIn();
        }
      });
      Button zoomOutButton = new Button("Zoom Out");
      zoomOutButton.setStyleName("textualZoomControl");
      zoomOutButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent clickEvent) {
          map.zoomOut();
        }
      });

      container.add(zoomInButton);
      container.add(zoomOutButton);
      return container;
    }
View Full Code Here

  private MapWidget map;

  public EventDemo() {
    Panel panel =
        new FlowPanel();
    map =
        new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13);
    map.setSize("500px", "300px");
    map.setUIToDefault();
    panel.add(map);
    final Label message =
        new Label();
    panel.add(message);
    initWidget(panel);
   
    map.addMapMoveEndHandler(new MapMoveEndHandler() {
      public void onMoveEnd(MapMoveEndEvent event) {
        message.setText(map.getCenter().toString());
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.FlowPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.