Example usage for com.google.gwt.query.client.plugins UiPlugin GQueryUi

List of usage examples for com.google.gwt.query.client.plugins UiPlugin GQueryUi

Introduction

In this page you can find the example usage for com.google.gwt.query.client.plugins UiPlugin GQueryUi.

Prototype

Class GQueryUi

To view the source code for com.google.gwt.query.client.plugins UiPlugin GQueryUi.

Click Source Link

Usage

From source file:gwtquery.plugins.draggable.client.DraggableHandler.java

License:Apache License

public void initialize(Element element, GqEvent e) {

    helperCssPosition = helper.css("position");
    helperScrollParent = helper.as(UiPlugin.GQueryUi).scrollParent();
    helperOffsetParent = helper.offsetParent();

    if ("html".equalsIgnoreCase(helperOffsetParent.get(0).getTagName())) {
        helperOffsetParent = $(body);/*from  w w w . j  av a 2 s  .  c  o m*/
    }

    setMarginCache(element);

    absPosition = new Offset(element.getAbsoluteLeft(), element.getAbsoluteTop());

    offset = new Offset(absPosition.left - margin.left, absPosition.top - margin.top);

    offsetClick = new Offset(e.pageX() - offset.left, e.pageY() - offset.top);

    parentOffset = calculateParentOffset(element);
    relativeOffset = calculateRelativeHelperOffset(element);

    originalEventPageX = e.pageX();
    originalEventPageY = e.pageY();

    position = calculateOriginalPosition(element, e);
    originalPosition = new Offset(position.left, position.top);

    if (options.getCursorAt() != null) {
        adjustOffsetFromHelper(options.getCursorAt());
    }
    calculateContainment();

}