asquare.gwt.tk.client.ui.behavior
Class DragController
java.lang.Object
asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
asquare.gwt.tk.client.ui.behavior.ControllerAdaptor
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 0gesture - a delegate object
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 eventevent - 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)
© 2007 Mat Gessel