All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.maps.gwt.client.InfoWindow Maven / Gradle / Ivy

/*
 * Copyright 2011 The Google Web Toolkit Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.maps.gwt.client;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Node;

/**
 * An overlay that looks like a bubble and is often connected to a marker.
 *
 * THIS SOURCE CODE IS GENERATED, DO NOT MODIFY
 */
public class InfoWindow extends MVCObject {

  /**
   * This event is fired when the close button was clicked.
   */
  public interface CloseClickHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the content property changes.
   */
  public interface ContentChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the 
   * <div>
   * 
   * containing the 
   * InfoWindow
   * 
   * 's content is attached to the DOM. You may wish to monitor this
   * event if you are building out your info window content dynamically.
   */
  public interface DomReadyHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the position property changes.
   */
  public interface PositionChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the InfoWindow's zIndex changes.
   */
  public interface ZIndexChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * Creates an info window with the given options.  An InfoWindow can be
   * placed on a map at a particular position or above a marker, depending
   * on what is specified in the options. Unless auto-pan is disabled, an
   * InfoWindow will pan the map to make itself visible when it is opened.
   * After constructing an InfoWindow, you must call open to display it on
   * the map.  The user can  click the close button on the InfoWindow to
   * remove it from the map, or the developer can call close() for the
   * same effect.
   */ 
  public static native InfoWindow create(InfoWindowOptions opts)/*-{
    var _opts;
    if(@com.google.gwt.core.client.GWT::isScript()()) {
      _opts = opts;
    } else {
      _opts = {};
      for(k in opts) {
        if(k != "__gwt_ObjectId") {
          _opts[k] = opts[k];
        }
      }
    } 
    return new $wnd.google.maps.InfoWindow(_opts);
  }-*/;

  /**
   * Creates an info window with the given options.  An InfoWindow can be
   * placed on a map at a particular position or above a marker, depending
   * on what is specified in the options. Unless auto-pan is disabled, an
   * InfoWindow will pan the map to make itself visible when it is opened.
   * After constructing an InfoWindow, you must call open to display it on
   * the map.  The user can  click the close button on the InfoWindow to
   * remove it from the map, or the developer can call close() for the
   * same effect.
   */ 
  public static native InfoWindow create()/*-{
    return new $wnd.google.maps.InfoWindow();
  }-*/;


  /**
   * Protected constructor avoids default public constructor.
   */
  protected InfoWindow() {
    /* Java constructor is protected, */
  }

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addCloseClickListener(CloseClickHandler handler)/*-{
    var _handler = $entry(function() {
      [email protected]::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "closeclick", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addCloseClickListenerOnce(CloseClickHandler handler)/*-{
    var _handler = $entry(function() {
      [email protected]::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "closeclick", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addContentChangedListener(ContentChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.InfoWindow.ContentChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "content_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addContentChangedListenerOnce(ContentChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.InfoWindow.ContentChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "content_changed", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addDomReadyListener(DomReadyHandler handler)/*-{
    var _handler = $entry(function() {
      [email protected]::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "domready", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addDomReadyListenerOnce(DomReadyHandler handler)/*-{
    var _handler = $entry(function() {
      [email protected]::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "domready", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addPositionChangedListener(PositionChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.InfoWindow.PositionChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "position_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addPositionChangedListenerOnce(PositionChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.InfoWindow.PositionChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "position_changed", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addZIndexChangedListener(ZIndexChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.InfoWindow.ZIndexChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "zindex_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addZIndexChangedListenerOnce(ZIndexChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.InfoWindow.ZIndexChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "zindex_changed", _handler);
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearCloseClickListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "closeclick");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearContentChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "content_changed");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearDomReadyListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "domready");
  }-*/;

  /**
   * Removes all listeners for all events for the given instance.
   */ 
  public final native void clearInstanceListeners()/*-{
    $wnd.google.maps.event.clearInstanceListeners(this);
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearPositionChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "position_changed");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearZIndexChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "zindex_changed");
  }-*/;

  /**
   * Closes this InfoWindow by removing it from the DOM structure.
   */ 
  public final native void close()/*-{
    this.close();

  }-*/;

  public final native LatLng getPosition()/*-{
    return this.getPosition();

  }-*/;

  public final native double getZIndex()/*-{
    return this.getZIndex();

  }-*/;

  /**
   * Opens this InfoWindow on the given map.  Optionally, an InfoWindow
   * can be associated with an anchor.  In the core API, the only anchor
   * is the Marker class.  However, an anchor can be any MVCObject that
   * exposes the position property and optionally anchorPoint for
   * calculating the pixelOffset (see InfoWindowOptions).  The anchorPoint
   * is the offset from the anchor's position to the tip of the
   * InfoWindow.
   */ 
  public final native void open(GoogleMap map, MVCObject anchor)/*-{
    this.open(map, anchor);

  }-*/;

  /**
   * Opens this InfoWindow on the given map.  Optionally, an InfoWindow
   * can be associated with an anchor.  In the core API, the only anchor
   * is the Marker class.  However, an anchor can be any MVCObject that
   * exposes the position property and optionally anchorPoint for
   * calculating the pixelOffset (see InfoWindowOptions).  The anchorPoint
   * is the offset from the anchor's position to the tip of the
   * InfoWindow.
   */ 
  public final native void open(GoogleMap map)/*-{
    this.open(map);

  }-*/;

  /**
   * Opens this InfoWindow on the given map.  Optionally, an InfoWindow
   * can be associated with an anchor.  In the core API, the only anchor
   * is the Marker class.  However, an anchor can be any MVCObject that
   * exposes the position property and optionally anchorPoint for
   * calculating the pixelOffset (see InfoWindowOptions).  The anchorPoint
   * is the offset from the anchor's position to the tip of the
   * InfoWindow.
   */ 
  public final native void open(StreetViewPanorama map, MVCObject anchor)/*-{
    this.open(map, anchor);

  }-*/;

  /**
   * Opens this InfoWindow on the given map.  Optionally, an InfoWindow
   * can be associated with an anchor.  In the core API, the only anchor
   * is the Marker class.  However, an anchor can be any MVCObject that
   * exposes the position property and optionally anchorPoint for
   * calculating the pixelOffset (see InfoWindowOptions).  The anchorPoint
   * is the offset from the anchor's position to the tip of the
   * InfoWindow.
   */ 
  public final native void open(StreetViewPanorama map)/*-{
    this.open(map);

  }-*/;

  /**
   * Opens this InfoWindow on the given map.  Optionally, an InfoWindow
   * can be associated with an anchor.  In the core API, the only anchor
   * is the Marker class.  However, an anchor can be any MVCObject that
   * exposes the position property and optionally anchorPoint for
   * calculating the pixelOffset (see InfoWindowOptions).  The anchorPoint
   * is the offset from the anchor's position to the tip of the
   * InfoWindow.
   */ 
  public final native void open(MVCObject anchor)/*-{
    this.open(anchor);

  }-*/;

  /**
   * Opens this InfoWindow on the given map.  Optionally, an InfoWindow
   * can be associated with an anchor.  In the core API, the only anchor
   * is the Marker class.  However, an anchor can be any MVCObject that
   * exposes the position property and optionally anchorPoint for
   * calculating the pixelOffset (see InfoWindowOptions).  The anchorPoint
   * is the offset from the anchor's position to the tip of the
   * InfoWindow.
   */ 
  public final native void open()/*-{
    this.open();

  }-*/;

  public final native void setContent(String content)/*-{
    this.setContent(content);

  }-*/;

  public final native void setContent(Node content)/*-{
    this.setContent(content);

  }-*/;

  public final native void setOptions(InfoWindowOptions options)/*-{
    var _options;
    if(@com.google.gwt.core.client.GWT::isScript()()) {
      _options = options;
    } else {
      _options = {};
      for(k in options) {
        if(k != "__gwt_ObjectId") {
          _options[k] = options[k];
        }
      }
    } 
    this.setOptions(_options);

  }-*/;

  public final native void setPosition(LatLng position)/*-{
    this.setPosition(position);

  }-*/;

  public final native void setZIndex(double zIndex)/*-{
    this.setZIndex(zIndex);

  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerCloseClick(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "closeclick", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerContentChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "content_changed", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerDomReady(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "domready", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerPositionChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "position_changed", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerZIndexChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "zindex_changed", _varargs);
  }-*/;

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy