org.cruxframework.crux.widgets.client.util.draganddrop
Class GenericDragEventHandler

java.lang.Object
  extended by org.cruxframework.crux.widgets.client.util.draganddrop.GenericDragEventHandler
All Implemented Interfaces:
com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.MouseMoveHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.shared.EventHandler

public class GenericDragEventHandler
extends Object
implements com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.dom.client.MouseMoveHandler

A generic handler which captures mouse events, translates them into drag events and invokes actions associated to them.

Author:
Gesse Dafe

Nested Class Summary
static class GenericDragEventHandler.DragAction<D extends GenericDragEventHandler.Draggable<?>>
          The contract to implement the logic associated to a drag action
static class GenericDragEventHandler.DragAndDropFeature
          Features offered by existing drag and drop capabilities
static interface GenericDragEventHandler.Draggable<K extends com.google.gwt.user.client.ui.IsWidget & com.google.gwt.event.dom.client.HasAllMouseHandlers>
          The contract to implement a widget which can be resized
 
Constructor Summary
GenericDragEventHandler(GenericDragEventHandler.DragAction<?> action)
           
 
Method Summary
 void applyTo(GenericDragEventHandler.Draggable<?> draggable)
          Apply this handler to a given draggable
 void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
           
 void onMouseMove(com.google.gwt.event.dom.client.MouseMoveEvent event)
           
 void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericDragEventHandler

public GenericDragEventHandler(GenericDragEventHandler.DragAction<?> action)
Parameters:
action -
Method Detail

applyTo

public void applyTo(GenericDragEventHandler.Draggable<?> draggable)
Apply this handler to a given draggable

Parameters:
draggable -

onMouseDown

public void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
Specified by:
onMouseDown in interface com.google.gwt.event.dom.client.MouseDownHandler

onMouseMove

public void onMouseMove(com.google.gwt.event.dom.client.MouseMoveEvent event)
Specified by:
onMouseMove in interface com.google.gwt.event.dom.client.MouseMoveHandler

onMouseUp

public void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
Specified by:
onMouseUp in interface com.google.gwt.event.dom.client.MouseUpHandler


Copyright © 2015. All rights reserved.