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

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

        public com.google.gwt.event.shared.HandlerRegistration 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.
        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 Gesture

        All 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:
        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()