com.google.gwt.user.client.Event.setCapture()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中com.google.gwt.user.client.Event.setCapture()方法的一些代码示例,展示了Event.setCapture()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.setCapture()方法的具体详情如下:
包路径:com.google.gwt.user.client.Event
类名称:Event
方法名:setCapture

Event.setCapture介绍

[英]Sets mouse-capture on the given element. This element will directly receive all mouse events until #releaseCapture(Element) is called on it.
[中]在给定元素上设置鼠标捕捉。此元素将直接接收所有鼠标事件,直到对其调用#releaseCapture(元素)。

代码示例

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

private void startDrag(int y) {
  Event.setCapture(getElement());
  capturing = true;
  scrollTo(y);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

Event.setCapture(getElement());
event.preventDefault();
break;

代码示例来源:origin: geogebra/geogebra

@Override
public void onTouchStart(TouchStartEvent event) {
  if (!field.isEnabled()) {
    return;
  }
  SelectionBox.touchSelection = true;
  event.preventDefault();
  handler.onPointerDown(getX(event), getY(event));
  Event.setCapture(widget.getElement());
  this.pointerIsDown = true;
  lastTouchDown = System.currentTimeMillis();
}

代码示例来源:origin: geogebra/geogebra

@Override
public void onMouseDown(MouseDownEvent event) {
  if (!field.isEnabled()
      || lastTouchDown > System.currentTimeMillis() - 200) {
    return;
  }
  SelectionBox.touchSelection = false;
  handler.onPointerDown(field.mouseX(event.getX()),
      field.mouseY(event.getY()));
  Event.setCapture(widget.getElement());
  this.pointerIsDown = true;
}

代码示例来源:origin: kiegroup/appformer

@Override
  public void onMouseDown(final MouseDownEvent event) {
    mouseDown = true;
    int width = Math.max(Window.getClientWidth(),
               Document.get().getScrollWidth());
    int height = Math.max(Window.getClientHeight(),
               Document.get().getScrollHeight());
    glassElem.getStyle().setHeight(height,
                    Style.Unit.PX);
    glassElem.getStyle().setWidth(width,
                   Style.Unit.PX);
    Document.get().getBody().appendChild(glassElem);
    buildOffset(event);
    Event.setCapture(getElement());
    event.preventDefault();
  }
},

代码示例来源:origin: kiegroup/appformer

@Override
  public void onMouseDown(MouseDownEvent event) {
    setupMoveIcon();
    mouseDown = true;
    int width = Math.max(Window.getClientWidth(),
               Document.get().getScrollWidth());
    int height = Math.max(Window.getClientHeight(),
               Document.get().getScrollHeight());
    glassElem.getStyle().setHeight(height,
                    Style.Unit.PX);
    glassElem.getStyle().setWidth(width,
                   Style.Unit.PX);
    Document.get().getBody().appendChild(glassElem);
    buildOffset(event);
    Event.setCapture(getElement());
    event.preventDefault();
  }
},

代码示例来源:origin: org.uberfire/uberfire-simple-docks-client

@Override
  public void onMouseDown(MouseDownEvent event) {
    setupMoveIcon();
    mouseDown = true;
    int width = Math.max(Window.getClientWidth(),
               Document.get().getScrollWidth());
    int height = Math.max(Window.getClientHeight(),
               Document.get().getScrollHeight());
    glassElem.getStyle().setHeight(height,
                    Style.Unit.PX);
    glassElem.getStyle().setWidth(width,
                   Style.Unit.PX);
    Document.get().getBody().appendChild(glassElem);
    buildOffset(event);
    Event.setCapture(getElement());
    event.preventDefault();
  }
},

代码示例来源:origin: org.uberfire/uberfire-runtime-plugins-client

@Override
  public void onMouseDown(final MouseDownEvent event) {
    mouseDown = true;
    int width = Math.max(Window.getClientWidth(),
               Document.get().getScrollWidth());
    int height = Math.max(Window.getClientHeight(),
               Document.get().getScrollHeight());
    glassElem.getStyle().setHeight(height,
                    Style.Unit.PX);
    glassElem.getStyle().setWidth(width,
                   Style.Unit.PX);
    Document.get().getBody().appendChild(glassElem);
    buildOffset(event);
    Event.setCapture(getElement());
    event.preventDefault();
  }
},

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

Event.setCapture(getElement());
int dragY = dragstartY - y;
if (Math.abs(deltaX / (double) dragY) > 2) {

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

Event.setCapture(getElement());
event.preventDefault();
break;

代码示例来源:origin: net.wetheinter/gwt-user

Event.setCapture(getElement());
event.preventDefault();
break;

代码示例来源:origin: kiegroup/appformer

Event.setCapture(getElement());
event.preventDefault();

相关文章