Package com.extjs.gxt.ui.client.event

Examples of com.extjs.gxt.ui.client.event.DragEvent


        proxyEl.setVisibility(false);
        proxyEl.remove();
      } else {
        dragWidget.el().setPagePosition(startBounds.x, startBounds.y);
      }
      DragEvent de = new DragEvent(this);
      de.setStartElement(startElement);
      fireEvent(Events.DragCancel, de);
      afterDrag();
    }
    startElement = null;
  }
View Full Code Here


    }

  }

  protected void startDrag(Event event) {
    DragEvent de = new DragEvent(this);
    de.setComponent(dragWidget);
    de.setEvent(event);
    de.setX(startBounds.x);
    de.setY(startBounds.y);
    de.setStartElement(startElement);

    if (fireEvent(Events.DragStart, de)) {
      dragging = true;
      XDOM.getBodyEl().addStyleName("x-unselectable");
      XDOM.getBodyEl().addStyleName("x-dd-cursor");
      dragWidget.el().makePositionable();

      event.preventDefault();
      Shim.get().cover(true);

      lastX = startBounds.x;
      lastY = startBounds.y;

      if (dragEvent == null) {
        dragEvent = new DragEvent(this);
      }

      if (useProxy) {
        if (proxyEl == null) {
          createProxy();
        }
        if (container == null) {
          XDOM.getBody().appendChild(proxyEl.dom);
        } else {
          container.el().appendChild(proxyEl.dom);
        }
        proxyEl.setVisibility(true);
        proxyEl.setZIndex(XDOM.getTopZIndex());
        proxyEl.makePositionable(true);

        if (sizeProxyToSource) {
          proxyEl.setBounds(startBounds);
        } else {
          proxyEl.setXY(startBounds.x, startBounds.y);
        }

        // did listeners change size?
        if (de.getHeight() > 0 && de.getWidth() > 0) {
          proxyEl.setSize(de.getWidth(), de.getHeight(), true);
        } else if (de.getHeight() > 0) {
          proxyEl.setHeight(de.getHeight(), true);
        } else if (de.getWidth() > 0) {
          proxyEl.setWidth(de.getWidth(), true);
        }
      } else if (updateZIndex) {
        dragWidget.setZIndex(XDOM.getTopZIndex());
      }
    } else {
View Full Code Here

        }
        proxyEl.setVisibility(false);
        proxyEl.disableTextSelection(false);
        proxyEl.remove();
      }
      DragEvent de = new DragEvent(this);
      de.setStartElement(startElement);
      de.setComponent(dragWidget);
      de.setEvent(event);
      de.setX(lastX);
      de.setY(lastY);
      fireEvent(Events.DragEnd, de);
      afterDrag();
    }
    startElement = null;
  }
View Full Code Here

        proxyEl.setVisibility(false);
        proxyEl.remove();
      } else {
        dragWidget.el().setPagePosition(startBounds.x, startBounds.y);
      }
      DragEvent de = new DragEvent(this);
      de.setStartElement(startElement);
      fireEvent(Events.DragCancel, de);
      afterDrag();
    }
    startElement = null;
  }
View Full Code Here

    }

  }

  protected void startDrag(Event event) {
    DragEvent de = new DragEvent(this);
    de.setComponent(dragWidget);
    de.setEvent(event);
    de.setX(startBounds.x);
    de.setY(startBounds.y);
    de.setStartElement(startElement);

    if (fireEvent(Events.DragStart, de)) {
      dragging = true;
      XDOM.getBodyEl().addStyleName("x-unselectable");
      XDOM.getBodyEl().addStyleName("x-dd-cursor");
      dragWidget.el().makePositionable();

      event.preventDefault();
      Shim.get().cover(true);

      lastX = startBounds.x;
      lastY = startBounds.y;

      if (dragEvent == null) {
        dragEvent = new DragEvent(this);
      }

      if (useProxy) {
        if (proxyEl == null) {
          createProxy();
        }
        if (container == null) {
          XDOM.getBody().appendChild(proxyEl.dom);
        } else {
          container.el().appendChild(proxyEl.dom);
        }
        proxyEl.setVisibility(true);
        proxyEl.setZIndex(XDOM.getTopZIndex());
        proxyEl.makePositionable(true);

        if (sizeProxyToSource) {
          proxyEl.setBounds(startBounds);
        } else {
          proxyEl.setXY(startBounds.x, startBounds.y);
        }

        // did listeners change size?
        if (de.getHeight() > 0 && de.getWidth() > 0) {
          proxyEl.setSize(de.getWidth(), de.getHeight(), true);
        } else if (de.getHeight() > 0) {
          proxyEl.setHeight(de.getHeight(), true);
        } else if (de.getWidth() > 0) {
          proxyEl.setWidth(de.getWidth(), true);
        }
      } else if (updateZIndex) {
        dragWidget.setZIndex(XDOM.getTopZIndex());
      }
    } else {
View Full Code Here

              proxyEl.remove();
            }
          }
        });
      }
      DragEvent de = new DragEvent(this);
      de.setStartElement(startElement);
      de.setComponent(dragWidget);
      de.setEvent(event);
      de.setX(lastX);
      de.setY(lastY);
      fireEvent(Events.DragEnd, de);
      afterDrag();
    }
    startElement = null;
  }
View Full Code Here

        proxyEl.remove();
      } else {
        dragWidget.el().setPagePosition(startBounds.x, startBounds.y);
      }

      fireEvent(Events.DragCancel, new DragEvent(this));
      afterDrag();
    }
  }
View Full Code Here

    }

  }

  protected void startDrag(Event event) {
    DragEvent de = new DragEvent(this);
    de.setComponent(dragWidget);
    de.setEvent(event);
    de.setX(startBounds.x);
    de.setY(startBounds.y);

    if (fireEvent(Events.DragStart, de)) {
      dragging = true;
      XDOM.getBodyEl().addStyleName("x-unselectable");
      XDOM.getBodyEl().addStyleName("x-dd-cursor");
      dragWidget.el().makePositionable();

      event.preventDefault();

      Shim.get().cover(true);

      lastX = startBounds.x;
      lastY = startBounds.y;

      if (dragEvent == null) {
        dragEvent = new DragEvent(this);
      }

      if (useProxy) {
        if (proxyEl == null) {
          createProxy();
        }
        if (container == null) {
          XDOM.getBody().appendChild(proxyEl.dom);
        } else {
          container.el().appendChild(proxyEl.dom);
        }
        proxyEl.setVisibility(true);
        proxyEl.setZIndex(XDOM.getTopZIndex());
        proxyEl.makePositionable(true);

        if (sizeProxyToSource) {
          proxyEl.setBounds(startBounds);
        } else {
          proxyEl.setXY(startBounds.x, startBounds.y);
        }

        // did listeners change size?
        if (de.getHeight() > 0 && de.getWidth() > 0) {
          proxyEl.setSize(de.getWidth(), de.getHeight(), true);
        } else if (de.getHeight() > 0) {
          proxyEl.setHeight(de.getHeight(), true);
        } else if (de.getWidth() > 0) {
          proxyEl.setWidth(de.getWidth(), true);
        }
      } else if (updateZIndex) {
        dragWidget.setZIndex(XDOM.getTopZIndex());
      }
    } else {
View Full Code Here

        }
        proxyEl.setVisibility(false);
        proxyEl.disableTextSelection(false);
        proxyEl.remove();
      }
      DragEvent de = new DragEvent(this);
      de.setComponent(dragWidget);
      de.setEvent(event);
      de.setX(lastX);
      de.setY(lastY);
      fireEvent(Events.DragEnd, de);
      afterDrag();
    }
  }
View Full Code Here

      }
      if (!isUseProxy()) {
        dragWidget.el().setPagePosition(startBounds.x, startBounds.y);
      }

      fireEvent(Events.DragCancel, new DragEvent(this));
      afterDrag();
    }
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.event.DragEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.