GWT Tk 0.2.3

asquare.gwt.tk.client.ui.behavior
Class DragController

java.lang.Object
  extended by asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
      extended by asquare.gwt.tk.client.ui.behavior.ControllerAdaptor
          extended by asquare.gwt.tk.client.ui.behavior.DragController
All Implemented Interfaces:
Controller, EventDelegate

public class DragController
extends ControllerAdaptor

A controller which interprets drag events and delegates the mouse drag operation to a delegate.

See Also:
DragGesture

Constructor Summary
DragController(DragGesture gesture)
          Creates a new DragController which delegates to the specified DragGesture.
DragController(DragGesture gesture, int distance)
          Creates a new DragController which delegates to the specified DragGesture.
 
Method Summary
 void onBrowserEvent(Widget widget, Event event)
          Call this from your widget's onBrowserEvent() method to to delegate events.
 void onMouseDown(Widget sender, int x, int y)
           
 void onMouseMove(Widget sender, int x, int y)
           
 void onMouseUp(Widget sender, int x, int y)
           
 
Methods inherited from class asquare.gwt.tk.client.ui.behavior.ControllerAdaptor
getId, plugIn, unplug
 
Methods inherited from class asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
doBrowserEvent, getEventBits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface asquare.gwt.tk.client.ui.behavior.EventDelegate
getEventBits
 

Constructor Detail

DragController

public DragController(DragGesture gesture)
Creates a new DragController which delegates to the specified DragGesture.

Parameters:
gesture - a delegate object

DragController

public DragController(DragGesture gesture,
                      int distance)
Creates a new DragController which delegates to the specified DragGesture. The DragGesture is not activated until the mouse movement equals the specified distance; this prevents accidental movement.

Parameters:
distance - the distance in screen pixels to move before taking an action, or 0
gesture - a delegate object
Method Detail

onBrowserEvent

public void onBrowserEvent(Widget widget,
                           Event event)
Description copied from interface: EventDelegate
Call this from your widget's onBrowserEvent() method to to delegate events.

Example:

 public void onBrowserEvent(Event event)
 {
   super.onBrowserEvent(event);
   delegate.onBrowserEvent(this, event);
 }
 

Specified by:
onBrowserEvent in interface EventDelegate
Overrides:
onBrowserEvent in class EventDelegateAdaptor
Parameters:
widget - the wiget that originated the event
event - the event

onMouseDown

public void onMouseDown(Widget sender,
                        int x,
                        int y)

onMouseMove

public void onMouseMove(Widget sender,
                        int x,
                        int y)

onMouseUp

public void onMouseUp(Widget sender,
                      int x,
                      int y)

GWT Tk 0.2.3

© 2007 Mat Gessel