001    package com.google.gwt.maps.client.events;
002    
003    import com.google.gwt.ajaxloader.client.Properties;
004    import com.google.gwt.core.client.JavaScriptObject;
005    import com.google.gwt.event.shared.GwtEvent;
006    
007    /**
008     * Inherit this into unique Map Event
009     *
010     * @param <H> {@link MapHandler}
011     * @param <E> {@link MapEvent}
012     */
013    public abstract class MapEvent<H extends MapHandler<E>, E> extends GwtEvent<H> {
014    
015      /**
016       * properties from the map event call back
017       * {@link com.google.gwt.ajaxloader.client.Properties}
018       */
019      protected Properties properties;
020    
021      /**
022       * create a new map event
023       * @param properties
024       */
025      public MapEvent(Properties properties) {
026        this.properties = properties;
027      }
028    
029      /**
030       * get the raw properties
031       * @return {@link com.google.gwt.ajaxloader.client.Properties}
032       */
033      public Properties getProperties() {
034        return properties;
035      }
036    
037      /**
038       * implement in the event that inherits this
039       */
040      @Override
041      public abstract Type<H> getAssociatedType();
042    
043      /**
044       * implement in the event that inherits this
045       */
046      @Override
047      protected abstract void dispatch(H handler);
048    
049      /**
050       * get property object as json
051       * @param jso
052       */
053      protected native String getAsJson(JavaScriptObject jso) /*-{
054        return jso.toSource ? jso.toSource() : "NO SOURCE";
055      }-*/;
056      
057    }