当前位置: 首页>>代码示例>>Java>>正文


Java Pose.WAVE_OUT属性代码示例

本文整理汇总了Java中com.thalmic.myo.Pose.WAVE_OUT属性的典型用法代码示例。如果您正苦于以下问题:Java Pose.WAVE_OUT属性的具体用法?Java Pose.WAVE_OUT怎么用?Java Pose.WAVE_OUT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.thalmic.myo.Pose的用法示例。


在下文中一共展示了Pose.WAVE_OUT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPose

@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
  if(!myo.isUnlocked() && pose != Pose.DOUBLE_TAP) { return; }
  // Swap wave poses if the Myo is on the left arm. Allows user to "wave" right or left
  // regardless of the Myo arm and have the swipes be in the appropriate direction.
  if (mArm == Arm.LEFT) {
    if (pose == Pose.WAVE_IN) {
      pose = Pose.WAVE_OUT;
    } else if (pose == Pose.WAVE_OUT) {
      pose = Pose.WAVE_IN;
    }
  }

  // Dispatch touch pad events for the standard navigation controls based on the
  // current pose.
  switch (pose) {
    case DOUBLE_TAP:
      if(myo.isUnlocked()) {
        lock(myo);
      } else {
        unlock(myo);
      }
      break;
    case FIST:
      mStartingRoll = mCurrentRoll;
      break;
    case FINGERS_SPREAD:
      if(mPanningEnabled) {
        stopPanning(myo);
      } else {
        startPanning(myo);
      }
      break;
    case WAVE_IN:
      if(!mZoomingEnabled) {
        startZooming(mZoomoutFactor);
      }
      break;
    case WAVE_OUT:
      if(!mZoomingEnabled) {
        startZooming(mZoominFactor);
      }
      break;
    case REST:
      switch(mCurrentPose) {
        case WAVE_IN:
        case WAVE_OUT:
          stopZooming();
          break;
      }
      break;
  }
  mCurrentPose = pose;
}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:54,代码来源:MyoMapListener.java

示例2: onPose

@Override
  public void onPose(Myo myo, long timestamp, Pose pose) {
    if(!myo.isUnlocked() && pose != Pose.DOUBLE_TAP) { return; }
    // Swap wave poses if the Myo is on the left arm. Allows user to "wave" right or left
    // regardless of the Myo arm and have the swipes be in the appropriate direction.
    if (mArm == Arm.LEFT) {
      if (pose == Pose.WAVE_IN) {
        pose = Pose.WAVE_OUT;
      } else if (pose == Pose.WAVE_OUT) {
        pose = Pose.WAVE_IN;
      }
    }

    // Dispatch events for the standard navigation controls based on the
    // current pose.
    switch (pose) {
      case DOUBLE_TAP:
        if(myo.isUnlocked()) {
          lock(myo);
        } else {
          unlock(myo);
        }
        break;
      case FIST:
        mStartingRoll = mCurrentRoll;
        break;
      case FINGERS_SPREAD:
        if(mPanningEnabled) {
          stopPanning(myo);
        } else {
          startPanning(myo);
        }
        break;
      case WAVE_IN:
        mMapView.zoomout();
        // This is the code that was demo'd at the Developer Summit. I had to modify
        // the accessor of the doubleTapZoom method (something we introduced for smaller
        // screened devices, allowing you to double-tap-then-drag to zoom) to be public.
        // The above code will require the pose to be repeated every time you want to zoom
        // out/in, which feels a little worse on your wrist.
//        if(!mZoomingEnabled) {
//          startZooming(ZOOMOUT_FACTOR);
//        }
        break;
      case WAVE_OUT:
        mMapView.zoomin();
//        if(!mZoomingEnabled) {
//          startZooming(ZOOMIN_FACTOR);
//        }
        break;
      case REST:
//        if(mZoomingEnabled) {
//          stopZooming();
//        }
        break;
    }
    mCurrentPose = pose;
  }
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:58,代码来源:MyoMapControlListener.java


注:本文中的com.thalmic.myo.Pose.WAVE_OUT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。