// Path: src/main/java/org/gwtproject/event/shared/Event.java
// public abstract class Event<H> {
//   /**
//    * Type class used to register events with an {@link EventBus}.
//    *
//    * @param <H> handler type
//    */
//   public static class Type<H> {
//     private static int nextHashCode;
//     private final int index;
// 
//     /** Constructor. */
//     public Type() {
//       index = ++nextHashCode;
//     }
// 
//     @Override
//     public final int hashCode() {
//       return index;
//     }
// 
//     @Override
//     public String toString() {
//       return "Event type";
//     }
//   }
// 
//   private Object source;
// 
//   /** Constructor. */
//   protected Event() {}
// 
//   /**
//    * Returns the {@link Type} used to register this event, allowing an {@link EventBus} to find
//    * handlers of the appropriate class.
//    *
//    * @return the type
//    */
//   public abstract Type<H> getAssociatedType();
// 
//   /**
//    * Returns the source for this event. The type and meaning of the source is arbitrary, and is most
//    * useful as a secondary key for handler registration. (See {@link EventBus#addHandlerToSource},
//    * which allows a handler to register for events of a particular type, tied to a particular
//    * source.)
//    *
//    * <p>Note that the source is actually set at dispatch time, e.g. via {@link
//    * EventBus#fireEventFromSource(Event, Object)}.
//    *
//    * @return object representing the source of this event
//    */
//   public Object getSource() {
//     return source;
//   }
// 
//   /**
//    * This is a method used primarily for debugging. It gives a string representation of the event
//    * details. This does not override the toString method because the compiler cannot always optimize
//    * toString out correctly. Event types should override as desired.
//    *
//    * @return a string representing the event's specifics.
//    */
//   public String toDebugString() {
//     String name = this.getClass().getName();
//     name = name.substring(name.lastIndexOf(".") + 1);
//     return "event: " + name + ":";
//   }
// 
//   /**
//    * The toString() for abstract event is overridden to avoid accidently including class literals in
//    * the compiled output. Use {@link Event} #toDebugString to get more information about the event.
//    */
//   @Override
//   public String toString() {
//     return "An event type";
//   }
// 
//   /**
//    * Implemented by subclasses to to invoke their handlers in a type safe manner. Intended to be
//    * called by {@link EventBus#fireEvent(Event)} or {@link EventBus#fireEventFromSource(Event,
//    * Object)}.
//    *
//    * @param handler handler
//    * @see EventBus#dispatchEvent(Event, Object)
//    */
//   protected abstract void dispatch(H handler);
// 
//   /**
//    * Set the source that triggered this event. Intended to be called by the {@link EventBus} during
//    * dispatch.
//    *
//    * @param source the source of this event.
//    * @see EventBus#fireEventFromSource(Event, Object)
//    * @see EventBus#setSourceOfEvent(Event, Object)
//    */
//   protected void setSource(Object source) {
//     this.source = source;
//   }
// }
// 
// Path: src/main/java/org/gwtproject/event/shared/HasHandlers.java
// public interface HasHandlers {
// 
//   /**
//    * Fires the given event to the handlers listening to the event's type.
//    *
//    * <p>Any exceptions thrown by handlers will be bundled into a {@link UmbrellaException} and then
//    * re-thrown after all handlers have completed. An exception thrown by a handler will not prevent
//    * other handlers from executing.
//    *
//    * @param event the event
//    */
//   void fireEvent(Event<?> event);
// }


import org.gwtproject.event.shared.Event;
import org.gwtproject.event.shared.HasHandlers;
/*
 * Copyright 2008 The GWT Project 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 org.gwtproject.event.logical.shared;


/** Fired when the event source is resized. */
public class ResizeEvent extends Event<ResizeHandler> {

  /** The event type. */
  private static Type<ResizeHandler> TYPE;

  /**
   * Fires a resize event on all registered handlers in the handler source.
   *
   * @param <S> The handler source
   * @param source the source of the handlers
   * @param width the new width
   * @param height the new height
   */
  public static <S extends HasResizeHandlers & HasHandlers> void fire(
      S source, int width, int height) {
    if (TYPE != null) {
      ResizeEvent event = new ResizeEvent(width, height);
      source.fireEvent(event);
    }
  }

  /**
   * Ensures the existence of the handler hook and then returns it.
   *
   * @return returns a handler hook
   */
  public static Type<ResizeHandler> getType() {
// Path: src/main/java/org/gwtproject/event/shared/Event.java
// public abstract class Event<H> {
//   /**
//    * Type class used to register events with an {@link EventBus}.
//    *
//    * @param <H> handler type
//    */
//   public static class Type<H> {
//     private static int nextHashCode;
//     private final int index;
// 
//     /** Constructor. */
//     public Type() {
//       index = ++nextHashCode;
//     }
// 
//     @Override
//     public final int hashCode() {
//       return index;
//     }
// 
//     @Override
//     public String toString() {
//       return "Event type";
//     }
//   }
// 
//   private Object source;
// 
//   /** Constructor. */
//   protected Event() {}
// 
//   /**
//    * Returns the {@link Type} used to register this event, allowing an {@link EventBus} to find
//    * handlers of the appropriate class.
//    *
//    * @return the type
//    */
//   public abstract Type<H> getAssociatedType();
// 
//   /**
//    * Returns the source for this event. The type and meaning of the source is arbitrary, and is most
//    * useful as a secondary key for handler registration. (See {@link EventBus#addHandlerToSource},
//    * which allows a handler to register for events of a particular type, tied to a particular
//    * source.)
//    *
//    * <p>Note that the source is actually set at dispatch time, e.g. via {@link
//    * EventBus#fireEventFromSource(Event, Object)}.
//    *
//    * @return object representing the source of this event
//    */
//   public Object getSource() {
//     return source;
//   }
// 
//   /**
//    * This is a method used primarily for debugging. It gives a string representation of the event
//    * details. This does not override the toString method because the compiler cannot always optimize
//    * toString out correctly. Event types should override as desired.
//    *
//    * @return a string representing the event's specifics.
//    */
//   public String toDebugString() {
//     String name = this.getClass().getName();
//     name = name.substring(name.lastIndexOf(".") + 1);
//     return "event: " + name + ":";
//   }
// 
//   /**
//    * The toString() for abstract event is overridden to avoid accidently including class literals in
//    * the compiled output. Use {@link Event} #toDebugString to get more information about the event.
//    */
//   @Override
//   public String toString() {
//     return "An event type";
//   }
// 
//   /**
//    * Implemented by subclasses to to invoke their handlers in a type safe manner. Intended to be
//    * called by {@link EventBus#fireEvent(Event)} or {@link EventBus#fireEventFromSource(Event,
//    * Object)}.
//    *
//    * @param handler handler
//    * @see EventBus#dispatchEvent(Event, Object)
//    */
//   protected abstract void dispatch(H handler);
// 
//   /**
//    * Set the source that triggered this event. Intended to be called by the {@link EventBus} during
//    * dispatch.
//    *
//    * @param source the source of this event.
//    * @see EventBus#fireEventFromSource(Event, Object)
//    * @see EventBus#setSourceOfEvent(Event, Object)
//    */
//   protected void setSource(Object source) {
//     this.source = source;
//   }
// }
// 
// Path: src/main/java/org/gwtproject/event/shared/HasHandlers.java
// public interface HasHandlers {
// 
//   /**
//    * Fires the given event to the handlers listening to the event's type.
//    *
//    * <p>Any exceptions thrown by handlers will be bundled into a {@link UmbrellaException} and then
//    * re-thrown after all handlers have completed. An exception thrown by a handler will not prevent
//    * other handlers from executing.
//    *
//    * @param event the event
//    */
//   void fireEvent(Event<?> event);
// }


// Path: logical/src/main/java/org/gwtproject/event/logical/shared/ResizeEvent.java
import org.gwtproject.event.shared.Event;
import org.gwtproject.event.shared.HasHandlers;

/*
 * Copyright 2008 The GWT Project 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 org.gwtproject.event.logical.shared;


/** Fired when the event source is resized. */
public class ResizeEvent extends Event<ResizeHandler> {

  /** The event type. */
  private static Type<ResizeHandler> TYPE;

  /**
   * Fires a resize event on all registered handlers in the handler source.
   *
   * @param <S> The handler source
   * @param source the source of the handlers
   * @param width the new width
   * @param height the new height
   */
  public static <S extends HasResizeHandlers & HasHandlers> void fire(
      S source, int width, int height) {
    if (TYPE != null) {
      ResizeEvent event = new ResizeEvent(width, height);
      source.fireEvent(event);
    }
  }

  /**
   * Ensures the existence of the handler hook and then returns it.
   *
   * @return returns a handler hook
   */
  public static Type<ResizeHandler> getType() {
    if (TYPE == null) {