com.vaadin.client.ui.dd.

Class DDUtil

  • public class DDUtil
    extends Object

    Utility class for drag and drop handling.

    Author:

    Vaadin Ltd

    • Method Detail

      • getVerticalDropLocation

        public static VerticalDropLocation getVerticalDropLocation​(com.google.gwt.dom.client.Element element,
                                                                   com.google.gwt.dom.client.NativeEvent event,
                                                                   double topBottomRatio)

        Get vertical drop location.

        Parameters:

        element - the drop target element

        event - the latest NativeEvent that relates to this drag operation

        topBottomRatio - the ratio that determines how big portion of the element on each end counts for indicating desire to drop above or below the element rather than on top of it

        Returns:

        the drop location

      • getVerticalDropLocation

        public static VerticalDropLocation getVerticalDropLocation​(com.google.gwt.dom.client.Element element,
                                                                   int offsetHeight,
                                                                   com.google.gwt.dom.client.NativeEvent event,
                                                                   double topBottomRatio)

        Get vertical drop location.

        Parameters:

        element - the drop target element

        offsetHeight - the height of an element relative to the layout

        event - the latest NativeEvent that relates to this drag operation

        topBottomRatio - the ratio that determines how big portion of the element on each end counts for indicating desire to drop above or below the element rather than on top of it

        Returns:

        the drop location

      • getVerticalDropLocation

        public static VerticalDropLocation getVerticalDropLocation​(com.google.gwt.dom.client.Element element,
                                                                   int offsetHeight,
                                                                   int clientY,
                                                                   double topBottomRatio)

        Get vertical drop location.

        Parameters:

        element - the drop target element

        offsetHeight - the height of an element relative to the layout

        clientY - the y-coordinate of the latest event that relates to this drag operation

        topBottomRatio - the ratio that determines how big portion of the element on each end counts for indicating desire to drop above or below the element rather than on top of it

        Returns:

        the drop location

      • getHorizontalDropLocation

        public static HorizontalDropLocation getHorizontalDropLocation​(com.google.gwt.dom.client.Element element,
                                                                       com.google.gwt.dom.client.NativeEvent event,
                                                                       double leftRightRatio)

        Get horizontal drop location.

        Parameters:

        element - the drop target element

        event - the latest NativeEvent that relates to this drag operation

        leftRightRatio - the ratio that determines how big portion of the element on each end counts for indicating desire to drop beside the element rather than on top of it

        Returns:

        the drop location