|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.maryanovsky.gwtutils.client.UserEventManager
public class UserEventManager
Converts low-level user events fired by the browser (mouse, keyboard events) to high level events (mouse clicked, key pressed) and invokes a specified action when such an event occurs.
| Constructor Summary | |
|---|---|
UserEventManager(Widget actionTarget,
SourcesMouseEvents mouseEventsSource,
SourcesMouseWheelEvents mouseWheelEventsSource)
Creates a new UserEventManager to listen to events from
the specified sources. |
|
| Method Summary | |
|---|---|
void |
addMouseListener(MouseListener listener)
SourcesMouseEvents implementation. |
void |
addMouseWheelListener(MouseWheelListener listener)
SourcesMouseWheelEvents implementation. |
void |
removeMouseListener(MouseListener listener)
SourcesMouseEvents implementation. |
void |
removeMouseWheelListener(MouseWheelListener listener)
SourcesMouseWheelEvents implementation. |
void |
setClickAction(ClickAction clickAction)
Sets the action invoked when the (left) mouse button is clicked once. |
void |
setDoubleClickAction(ClickAction doubleClickAction)
Sets the action invoked when the (left) mouse button is clicked twice. |
void |
setDragAction(DragAction dragAction)
Sets the action invoked when the mouse is dragged. |
void |
setMiddleClickAction(ClickAction middleClickAction)
Sets the action invoked when the middle mouse button is clicked. |
void |
setMoveAction(MoveAction moveAction)
Sets the action invoked when the mouse is moved without any buttons being pressed. |
void |
setRightClickAction(ClickAction rightClickAction)
Sets the action invoked when the right mouse button is clicked. |
void |
setTripleClickAction(ClickAction tripleClickAction)
Sets the action invoked when the (left) mouse button is clicked three times. |
void |
setWheelAction(WheelAction wheelAction)
Sets the action invoked when the mouse wheel is scrolled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserEventManager(Widget actionTarget,
SourcesMouseEvents mouseEventsSource,
SourcesMouseWheelEvents mouseWheelEventsSource)
UserEventManager to listen to events from
the specified sources. Either of the sources may be null,
in which case the corresponding class of low-level events is not handled.
If mouseSource is null, however, not only will
mouse events not be reported, but the mouse coordinates reported for
other events are unspecified.
actionTarget - The widget passed as the target to the actions.mouseEventsSource - The source for mouse events.mouseWheelEventsSource - The source for mouse wheel events.| Method Detail |
|---|
public void setClickAction(ClickAction clickAction)
null to specify that no action is to be invoked.
public void setDoubleClickAction(ClickAction doubleClickAction)
null to specify that no action is to be invoked.
public void setTripleClickAction(ClickAction tripleClickAction)
null to specify that no action is to be invoked.
public void setRightClickAction(ClickAction rightClickAction)
null to specify that no action is to be invoked. Note that
to enable right click detection, you need to call
UiUtils.disableContextMenu(Element) on the source
widget or one of its ancestors.
public void setMiddleClickAction(ClickAction middleClickAction)
null to specify that no action is to be invoked.
public void setMoveAction(MoveAction moveAction)
null to specify that no action is to be
invoked.
public void setDragAction(DragAction dragAction)
null
to specify that no action is to be invoked.
public void setWheelAction(WheelAction wheelAction)
null to specify that no action is to be invoked.
public void addMouseListener(MouseListener listener)
addMouseListener in interface SourcesMouseEventspublic void removeMouseListener(MouseListener listener)
removeMouseListener in interface SourcesMouseEventspublic void addMouseWheelListener(MouseWheelListener listener)
addMouseWheelListener in interface SourcesMouseWheelEventspublic void removeMouseWheelListener(MouseWheelListener listener)
removeMouseWheelListener in interface SourcesMouseWheelEvents
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||