예제 #1
0
  private void onDragEvent(Event event) {
    if (!Util.isTouchEventOrLeftMouseButton(event)) {
      return;
    }

    switch (DOM.eventGetType(event)) {
      case Event.ONTOUCHSTART:
        if (event.getTouches().length() > 1) {
          return;
        }
      case Event.ONMOUSEDOWN:
        if (!isActive()) {
          bringToFront();
        }
        beginMovingWindow(event);
        break;
      case Event.ONMOUSEUP:
      case Event.ONTOUCHEND:
      case Event.ONTOUCHCANCEL:
      case Event.ONLOSECAPTURE:
        stopMovingWindow();
        break;
      case Event.ONMOUSEMOVE:
      case Event.ONTOUCHMOVE:
        moveWindow(event);
        break;
      default:
        break;
    }
  }
예제 #2
0
    @Override
    public void onTouchMove(Event event) {

      if (SliderView.this.isDisabled()) {
        return;
      }

      event.preventDefault();

      if (event.getTouches().length() > 0) {

        double oldValue = getValue();

        Touch first = event.getTouches().get(0);
        calcValue(first);

        showValueTooltip();

        if (continuous && oldValue != getValue()) {
          ActionEvent.fire(SliderView.this, SliderView.this);
        }
      }
    }