Class Gesture
java.lang.Object
com.levigo.jadice.web.client.util.Gesture
- Direct Known Subclasses:
AbstractWranglerGesture,MoveGesture,PanForceTool.PanForceGesture,RotatedAnnotationsResizeGesture
A Gesture is a user-interaction thats more than a single Event.
When a Gesture has been started, all Browser-Events will be brought directly to the Gesture-Object, so no other Element will be able to capture some Events.
Gestures needs to call stop(), when they think, that they are finished, to reset to the normal Event-Flow.
use for example as PanGestures, ZoomGestures, MouseGestures, SelectionGestures,...
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <H extends com.google.gwt.event.shared.EventHandler>
voidaddDomHandler(H handler, com.google.gwt.event.dom.client.DomEvent.Type<H> type) Adds a new Handler called when the Gesture has been startedcom.google.gwt.event.shared.HandlerRegistrationaddHandler(Gesture.GestureHandler handler) static voidDeprecated.protected Grid.SnapTogetSnapToForSelection(List<ShapeBasedAnnotation> selectedAnnos) Returns theGrid.SnapTofor the current selection.protected abstract voidinit()Add your Dom-Handlers hereprotected voidonStart()Called when the Gesture is startedprotected voidonStop()Called when the Gesture is stoppedfinal voidstart()Starts the Gesturefinal voidstop()Stops the Gesture.
-
Field Details
-
snapTo
-
-
Constructor Details
-
Gesture
public Gesture()
-
-
Method Details
-
currentGestureStop
Deprecated.Stops the current running Gesture, for test-Applications only! -
addHandler
-
getSnapToForSelection
Returns theGrid.SnapTofor the current selection. When all selected annotations are configured to be aligned on the same SnapTo this SnapTo is returned. Defaults to the top left corner if annotations are configured to be aligned on different SnapTos.- Parameters:
selectedAnnos- The selected annotations that are moved- Returns:
- The SnapTo each selected annotation will be positioned on
-
init
protected abstract void init()Add your Dom-Handlers here -
start
public final void start()Starts the GestureAll Events will be routed to this Gesture
-
addDomHandler
protected <H extends com.google.gwt.event.shared.EventHandler> void addDomHandler(H handler, com.google.gwt.event.dom.client.DomEvent.Type<H> type) Adds a new Handler called when the Gesture has been started- Type Parameters:
H- the type of handler to add- Parameters:
handler- the handlertype- the event key
-
stop
public final void stop()Stops the Gesture. Call this when your Gesture has been finished.Releases the Capture on the Gesture, so the Events will be routed normal.
-
onStop
protected void onStop()Called when the Gesture is stopped -
onStart
protected void onStart()Called when the Gesture is started -
getDescription
-