final TextBox textBox = new TextBox();
textBox.setReadOnly(true);
textBox.setSize("30em", "1em");
handlerTable.setWidget(rowNumber, 2, textBox);
Button clearButton = new Button("Clear Text");
clearButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
textBox.setText("");
}
});
handlerTable.setWidget(rowNumber, 3, clearButton);
Button removeHandlerButton = new Button("Remove Handler");
handlerTable.setWidget(rowNumber, 4, removeHandlerButton);
// Add event specific handlers
switch (a) {
case INFO_WINDOW_CLOSE_CLICK_HANDLER: {
final InfoWindowCloseClickHandler h = new InfoWindowCloseClickHandler() {
public void onCloseClick(InfoWindowCloseClickEvent event) {
textBox.setText(textBox.getText() + "onCloseClick()");
}
};
map.getInfoWindow().addInfoWindowCloseClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.getInfoWindow().removeInfoWindowCloseClickHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case INFO_WINDOW_MAXIMIZE_CLICK_HANDLER: {
final InfoWindowMaximizeClickHandler h = new InfoWindowMaximizeClickHandler() {
public void onMaximizeClick(InfoWindowMaximizeClickEvent event) {
textBox.setText(textBox.getText() + "onMaximizeClick()");
}
};
map.getInfoWindow().addInfoWindowMaximizeClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.getInfoWindow().removeInfoWindowMaximizeClickHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case INFO_WINDOW_MAXIMIZE_END_HANDLER: {
final InfoWindowMaximizeEndHandler h = new InfoWindowMaximizeEndHandler() {
public void onMaximizeEnd(InfoWindowMaximizeEndEvent event) {
textBox.setText(textBox.getText() + "onMaximizeEnd()");
}
};
map.getInfoWindow().addInfoWindowMaximizeEndHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.getInfoWindow().removeInfoWindowMaximizeEndHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case INFO_WINDOW_RESTORE_CLICK_HANDLER: {
final InfoWindowRestoreClickHandler h = new InfoWindowRestoreClickHandler() {
public void onRestoreClick(InfoWindowRestoreClickEvent event) {
textBox.setText(textBox.getText() + "onRestoreClick()");
}
};
map.getInfoWindow().addInfoWindowRestoreClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.getInfoWindow().removeInfoWindowRestoreClickHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case INFO_WINDOW_RESTORE_END_HANDLER: {
final InfoWindowRestoreEndHandler h = new InfoWindowRestoreEndHandler() {
public void onRestoreEnd(InfoWindowRestoreEndEvent event) {
textBox.setText(textBox.getText() + "onRestoreEnd()");
}
};
map.getInfoWindow().addInfoWindowRestoreEndHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.getInfoWindow().removeInfoWindowRestoreEndHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_INFO_WINDOW_BEFORE_CLOSE_HANDLER: {
final MapInfoWindowBeforeCloseHandler h = new MapInfoWindowBeforeCloseHandler() {
public void onInfoWindowBeforeClose(
MapInfoWindowBeforeCloseEvent event) {
textBox.setText(textBox.getText() + "onInfoWindowBeforeClose()");
}
};
map.addInfoWindowBeforeCloseHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeInfoWindowBeforeCloseHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_INFO_WINDOW_CLOSE_HANDLER: {
final MapInfoWindowCloseHandler h = new MapInfoWindowCloseHandler() {
public void onInfoWindowClose(MapInfoWindowCloseEvent event) {
textBox.setText(textBox.getText() + "onInfoWindowClose()");
}
};
map.addInfoWindowCloseHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeInfoWindowCloseHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_INFO_WINDOW_OPEN_HANDLER: {
final MapInfoWindowOpenHandler h = new MapInfoWindowOpenHandler() {
public void onInfoWindowOpen(MapInfoWindowOpenEvent event) {
textBox.setText(textBox.getText() + "onInfoWindowOpen()");
}
};
map.addInfoWindowOpenHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeInfoWindowOpenHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_CLEAR_OVERLAYS_HANDLER: {
final MapClearOverlaysHandler h = new MapClearOverlaysHandler() {
public void onClearOverlays(MapClearOverlaysEvent event) {
textBox.setText(textBox.getText() + "onClearOverlays()");
}
};
map.addMapClearOverlaysHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapClearOverlaysHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_ADD_MAP_TYPE_HANDLER: {
final MapAddMapTypeHandler h = new MapAddMapTypeHandler() {
public void onAddMapType(MapAddMapTypeEvent event) {
textBox.setText(textBox.getText() + "onAddMapType("
+ event.getType().getName(true) + ")");
}
};
map.addMapAddMapTypeHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapAddMapTypeHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_ADD_OVERLAY_HANDLER: {
final MapAddOverlayHandler h = new MapAddOverlayHandler() {
public void onAddOverlay(MapAddOverlayEvent event) {
textBox.setText(textBox.getText() + "onAddOverlay("
+ event.getOverlay() + ")");
}
};
map.addMapAddOverlayHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapAddOverlayHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_CLICK_HANDLER: {
final MapClickHandler h = new MapClickHandler() {
public void onClick(MapClickEvent e) {
String additionalText = "";
if (e.getOverlay() != null) {
additionalText = " Overlay clicked" + e.getOverlayLatLng();
}
textBox.setText(textBox.getText() + "onClick(" + e.getLatLng()
+ ")" + additionalText);
}
};
map.addMapClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapClickHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_DOUBLE_CLICK_HANDLER: {
final MapDoubleClickHandler h = new MapDoubleClickHandler() {
public void onDoubleClick(MapDoubleClickEvent e) {
textBox.setText(textBox.getText() + "onDoubleClick("
+ e.getLatLng() + ")");
}
};
map.addMapDoubleClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapDoubleClickHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_DRAG_END_HANDLER: {
final MapDragEndHandler h = new MapDragEndHandler() {
public void onDragEnd(MapDragEndEvent event) {
textBox.setText(textBox.getText() + "onDragEnd()");
}
};
map.addMapDragEndHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapDragEndHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_DRAG_HANDLER: {
final MapDragHandler h = new MapDragHandler() {
public void onDrag(MapDragEvent event) {
textBox.setText(textBox.getText() + "onDrag()");
}
};
map.addMapDragHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapDragHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_DRAG_START_HANDLER: {
final MapDragStartHandler h = new MapDragStartHandler() {
public void onDragStart(MapDragStartEvent event) {
textBox.setText(textBox.getText() + "onDragStart()");
}
};
map.addMapDragStartHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapDragStartHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_MOUSE_OUT_HANDLER: {
final MapMouseOutHandler h = new MapMouseOutHandler() {
public void onMouseOut(MapMouseOutEvent event) {
textBox.setText(textBox.getText() + "onMouseOut("
+ event.getLatLng() + ")");
}
};
map.addMapMouseOutHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapMouseOutHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_MOUSE_OVER_HANDLER: {
final MapMouseOverHandler h = new MapMouseOverHandler() {
public void onMouseOver(MapMouseOverEvent event) {
textBox.setText(textBox.getText() + "onMouseOver("
+ event.getLatLng() + ")");
}
};
map.addMapMouseOverHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapMouseOverHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_MOUSE_MOVE_HANDLER: {
final MapMouseMoveHandler h = new MapMouseMoveHandler() {
public void onMouseMove(MapMouseMoveEvent event) {
textBox.setText(textBox.getText() + "onMouseMove("
+ event.getLatLng() + ")");
}
};
map.addMapMouseMoveHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapMouseMoveHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_MOVE_END_HANDLER: {
final MapMoveEndHandler h = new MapMoveEndHandler() {
public void onMoveEnd(MapMoveEndEvent e) {
textBox.setText(textBox.getText() + "onMoveEnd()");
}
};
map.addMapMoveEndHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapMoveEndHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_MOVE_HANDLER: {
final MapMoveHandler h = new MapMoveHandler() {
public void onMove(MapMoveEvent e) {
textBox.setText(textBox.getText() + "onMove()");
}
};
map.addMapMoveHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapMoveHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_MOVE_START_HANDLER: {
final MapMoveStartHandler h = new MapMoveStartHandler() {
public void onMoveStart(MapMoveStartEvent e) {
textBox.setText(textBox.getText() + "onMoveStart()");
}
};
map.addMapMoveStartHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapMoveStartHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_REMOVE_MAP_TYPE_HANDLER: {
final MapRemoveMapTypeHandler h = new MapRemoveMapTypeHandler() {
public void onRemoveMapType(MapRemoveMapTypeEvent event) {
textBox.setText(textBox.getText() + "onRemoveMapType("
+ event.getType().getName(true) + ")");
}
};
map.addMapRemoveMapTypeHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapRemoveMapTypeHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_REMOVE_OVERLAY_HANDLER: {
final MapRemoveOverlayHandler h = new MapRemoveOverlayHandler() {
public void onRemoveOverlay(MapRemoveOverlayEvent event) {
textBox.setText(textBox.getText() + "onRemoveOverlay("
+ event.getOverlay().toString() + ")");
}
};
map.addMapRemoveOverlayHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapRemoveOverlayHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_RIGHT_CLICK_HANDLER: {
final MapRightClickHandler h = new MapRightClickHandler() {
public void onRightClick(MapRightClickEvent e) {
textBox.setText(textBox.getText() + "onRightClick(" + e.getPoint()
+ ")");
}
};
map.addMapRightClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapRightClickHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_TYPE_CHANGED_HANDLER: {
final MapTypeChangedHandler h = new MapTypeChangedHandler() {
public void onTypeChanged(MapTypeChangedEvent e) {
textBox.setText(textBox.getText() + "onTypeChanged()");
}
};
map.addMapTypeChangedHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapTypeChangedHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MAP_ZOOM_END_HANDLER: {
final MapZoomEndHandler h = new MapZoomEndHandler() {
public void onZoomEnd(MapZoomEndEvent e) {
textBox.setText(textBox.getText() + "onZoomEnd("
+ e.getNewZoomLevel() + "," + e.getOldZoomLevel() + ")");
}
};
map.addMapZoomEndHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
map.removeMapZoomEndHandler(h);
// removeRowFromTable(nextListenerId);
}
});
}
break;
case MARKER_CLICK_HANDLER: {
final MarkerClickHandler h = new MarkerClickHandler() {
public void onClick(MarkerClickEvent e) {
textBox.setText(textBox.getText() + "onClick()");
}
};
marker.addMarkerClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerClickHandler(h);
}
});
}
break;
case MARKER_DOUBLE_CLICK_HANDLER: {
final MarkerDoubleClickHandler h = new MarkerDoubleClickHandler() {
public void onDoubleClick(MarkerDoubleClickEvent e) {
textBox.setText(textBox.getText() + "onDoubleClick()");
}
};
marker.addMarkerDoubleClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerDoubleClickHandler(h);
}
});
}
break;
case MARKER_MOUSE_DOWN_HANDLER: {
final MarkerMouseDownHandler h = new MarkerMouseDownHandler() {
public void onMouseDown(MarkerMouseDownEvent e) {
textBox.setText(textBox.getText() + "onMouseDown()");
}
};
marker.addMarkerMouseDownHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerMouseDownHandler(h);
}
});
}
break;
case MARKER_MOUSE_UP_HANDLER: {
final MarkerMouseUpHandler h = new MarkerMouseUpHandler() {
public void onMouseUp(MarkerMouseUpEvent e) {
textBox.setText(textBox.getText() + "onMouseUp()");
}
};
marker.addMarkerMouseUpHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerMouseUpHandler(h);
}
});
}
break;
case MARKER_MOUSE_OVER_HANDLER: {
final MarkerMouseOverHandler h = new MarkerMouseOverHandler() {
public void onMouseOver(MarkerMouseOverEvent e) {
textBox.setText(textBox.getText() + "onMouseOver()");
}
};
marker.addMarkerMouseOverHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerMouseOverHandler(h);
}
});
}
break;
case MARKER_MOUSE_OUT_HANDLER: {
final MarkerMouseOutHandler h = new MarkerMouseOutHandler() {
public void onMouseOut(MarkerMouseOutEvent e) {
textBox.setText(textBox.getText() + "onMouseOut()");
}
};
marker.addMarkerMouseOutHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerMouseOutHandler(h);
}
});
}
break;
case MARKER_INFO_WINDOW_OPEN_HANDLER: {
final MarkerInfoWindowOpenHandler h = new MarkerInfoWindowOpenHandler() {
public void onInfoWindowOpen(MarkerInfoWindowOpenEvent e) {
textBox.setText(textBox.getText() + "onInfoWindowOpen()");
}
};
marker.addMarkerInfoWindowOpenHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerInfoWindowOpenHandler(h);
}
});
}
break;
case MARKER_INFO_WINDOW_BEFORECLOSE_HANDLER: {
final MarkerInfoWindowBeforeCloseHandler h = new MarkerInfoWindowBeforeCloseHandler() {
public void onInfoWindowBeforeClose(MarkerInfoWindowBeforeCloseEvent e) {
textBox.setText(textBox.getText() + "onInfoWindowBeforeClose()");
}
};
marker.addMarkerInfoWindowBeforeCloseHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerInfoWindowBeforeCloseHandler(h);
}
});
}
break;
case MARKER_INFO_WINDOW_CLOSE_HANDLER: {
final MarkerInfoWindowCloseHandler h = new MarkerInfoWindowCloseHandler() {
public void onInfoWindowClose(MarkerInfoWindowCloseEvent e) {
textBox.setText(textBox.getText() + "onInfoWindowClose()");
}
};
marker.addMarkerInfoWindowCloseHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerInfoWindowCloseHandler(h);
}
});
}
break;
case MARKER_REMOVE_HANDLER: {
final MarkerRemoveHandler h = new MarkerRemoveHandler() {
public void onRemove(MarkerRemoveEvent e) {
textBox.setText(textBox.getText() + "onRemove()");
}
};
marker.addMarkerRemoveHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerRemoveHandler(h);
}
});
}
break;
case MARKER_DRAG_START_HANDLER: {
final MarkerDragStartHandler h = new MarkerDragStartHandler() {
public void onDragStart(MarkerDragStartEvent e) {
textBox.setText(textBox.getText() + "onDragStart()");
}
};
marker.addMarkerDragStartHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerDragStartHandler(h);
}
});
}
break;
case MARKER_DRAG_HANDLER: {
final MarkerDragHandler h = new MarkerDragHandler() {
public void onDrag(MarkerDragEvent e) {
textBox.setText(textBox.getText() + "onDrag()");
}
};
marker.addMarkerDragHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerDragHandler(h);
}
});
}
break;
case MARKER_DRAG_END_HANDLER: {
final MarkerDragEndHandler h = new MarkerDragEndHandler() {
public void onDragEnd(MarkerDragEndEvent e) {
textBox.setText(textBox.getText() + "onDragEnd()");
}
};
marker.addMarkerDragEndHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerDragEndHandler(h);
}
});
}
break;
case MARKER_VISIBILITY_CHANGED_HANDLER: {
final MarkerVisibilityChangedHandler h = new MarkerVisibilityChangedHandler() {
public void onVisibilityChanged(MarkerVisibilityChangedEvent e) {
textBox.setText(textBox.getText() + "onVisibilityChanged("
+ e.isVisible() + ")");
}
};
marker.addMarkerVisibilityChangedHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
marker.removeMarkerVisibilityChangedHandler(h);
}
});
}
break;
case POLYLINE_CLICK_HANDLER: {
final PolylineClickHandler h = new PolylineClickHandler() {
public void onClick(PolylineClickEvent e) {
textBox.setText(textBox.getText() + "onClick(" + e.getLatLng()
+ ")");
}
};
polyline.addPolylineClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polyline.removePolylineClickHandler(h);
}
});
}
break;
case POLYLINE_REMOVE_HANDLER: {
final PolylineRemoveHandler h = new PolylineRemoveHandler() {
public void onRemove(PolylineRemoveEvent e) {
textBox.setText(textBox.getText() + "onRemove()");
}
};
polyline.addPolylineRemoveHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polyline.removePolylineRemoveHandler(h);
}
});
}
break;
case POLYLINE_VISIBILITY_CHANGED_HANDLER: {
final PolylineVisibilityChangedHandler h = new PolylineVisibilityChangedHandler() {
public void onVisibilityChanged(PolylineVisibilityChangedEvent e) {
textBox.setText(textBox.getText() + "onVisibilityChanged("
+ e.isVisible() + ")");
}
};
polyline.addPolylineVisibilityChangedHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polyline.removePolylineVisibilityChangedHandler(h);
}
});
}
break;
case POLYLINE_MOUSEOUT_HANDLER: {
final PolylineMouseOutHandler h = new PolylineMouseOutHandler() {
public void onMouseOut(PolylineMouseOutEvent e) {
textBox.setText(textBox.getText() + "onMouseOut()");
}
};
polyline.addPolylineMouseOutHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polyline.removePolylineMouseOutHandler(h);
}
});
}
break;
case POLYLINE_MOUSEOVER_HANDLER: {
final PolylineMouseOverHandler h = new PolylineMouseOverHandler() {
public void onMouseOver(PolylineMouseOverEvent e) {
textBox.setText(textBox.getText() + "onMouseOver()");
}
};
polyline.addPolylineMouseOverHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polyline.removePolylineMouseOverHandler(h);
}
});
}
break;
case POLYGON_CLICK_HANDLER: {
final PolygonClickHandler h = new PolygonClickHandler() {
public void onClick(PolygonClickEvent e) {
textBox.setText(textBox.getText() + "onClick(" + e.getLatLng()
+ ")");
}
};
polygon.addPolygonClickHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polygon.removePolygonClickHandler(h);
}
});
}
break;
case POLYGON_REMOVE_HANDLER: {
final PolygonRemoveHandler h = new PolygonRemoveHandler() {
public void onRemove(PolygonRemoveEvent e) {
textBox.setText(textBox.getText() + "onRemove()");
}
};
polygon.addPolygonRemoveHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polygon.removePolygonRemoveHandler(h);
}
});
}
break;
case POLYGON_VISIBILITY_CHANGED_HANDLER: {
final PolygonVisibilityChangedHandler h = new PolygonVisibilityChangedHandler() {
public void onVisibilityChanged(PolygonVisibilityChangedEvent e) {
textBox.setText(textBox.getText() + "onVisibilityChanged("
+ e.isVisible() + ")");
}
};
polygon.addPolygonVisibilityChangedHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polygon.removePolygonVisibilityChangedHandler(h);
}
});
}
break;
case POLYGON_MOUSEOUT_HANDLER: {
final PolygonMouseOutHandler h = new PolygonMouseOutHandler() {
public void onMouseOut(PolygonMouseOutEvent e) {
textBox.setText(textBox.getText() + "onMouseOut()");
}
};
polygon.addPolygonMouseOutHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polygon.removePolygonMouseOutHandler(h);
}
});
}
break;
case POLYGON_MOUSEOVER_HANDLER: {
final PolygonMouseOverHandler h = new PolygonMouseOverHandler() {
public void onMouseOver(PolygonMouseOverEvent e) {
textBox.setText(textBox.getText() + "onMouseOver()");
}
};
polygon.addPolygonMouseOverHandler(h);
removeHandlerButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
polygon.removePolygonMouseOverHandler(h);
}