com.google.gwt.visualization.client.events
Class Handler

java.lang.Object
  extended by com.google.gwt.visualization.client.events.Handler
Direct Known Subclasses:
CollapseHandler, OnMouseOutHandler, OnMouseOverHandler, PageHandler, RangeChangeHandler, ReadyHandler, RegionClickHandler, SelectHandler, SortHandler, StateChangeHandler, ZoomOutHandler

public abstract class Handler
extends java.lang.Object

The base class for visualization event handlers.


Constructor Summary
Handler()
           
 
Method Summary
static void addHandler(Visualization<?> viz, java.lang.String eventName, Handler handler)
          Add a Handler to a visualization.
protected abstract  void onEvent(Properties properties)
          This method should be overridden by event-specific Handler subclasses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Handler

public Handler()
Method Detail

addHandler

public static void addHandler(Visualization<?> viz,
                              java.lang.String eventName,
                              Handler handler)
Add a Handler to a visualization.

Parameters:
viz - a Visualization supporting the given event.
eventName - The name of the event.
handler - A Handler to add.

onEvent

protected abstract void onEvent(Properties properties)
                         throws Properties.TypeException
This method should be overridden by event-specific Handler subclasses. The subclass should extract the event properties (if any), create a GWT Event bean object, and pass it to the event-specific callback.

Parameters:
properties - The JavaScriptObject containing data about the event.
Throws:
Properties.TypeException - If some property of the event has an unexpected type.