Class Gesture

  • Direct Known Subclasses:
    AbstractWranglerGesture, MoveGesture, PanForceTool.PanForceGesture, RotatedAnnotationsResizeGesture

    public abstract class Gesture
    extends Object
    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,...

    • Constructor Detail

      • Gesture

        public Gesture()
    • Method Detail

      • currentGestureStop

        public static void currentGestureStop()
        Stops the current running Gesture, for test-Applications only!
      • addHandler

        public addHandler​(Gesture.GestureHandler handler)
      • getSnapToForSelection

        protected Grid.SnapTo getSnapToForSelection​(List<ShapeBasedAnnotation> selectedAnnos)
        Returns the Grid.SnapTo for 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.
        selectedAnnos - The selected annotations that are moved
        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 Gesture

        All Events will be routed to this Gesture

      • addDomHandler

        protected <H extends> void addDomHandler​(H handler,
                                                                                <H> type)
        Adds a new Handler called when the Gesture has been started
        Type Parameters:
        H - the type of handler to add
        type - the event key
        handler - the handler
      • 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

        public String getDescription()