本文整理汇总了Java中com.leapmotion.leap.Gesture类的典型用法代码示例。如果您正苦于以下问题:Java Gesture类的具体用法?Java Gesture怎么用?Java Gesture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gesture类属于com.leapmotion.leap包,在下文中一共展示了Gesture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: circleGestureListener
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void circleGestureListener(CircleGesture circle) {
if(mouseOn){
String clockwiseness;
if (circle.state() == Gesture.State.STATE_STOP && circle.radius() < 10){
if (circle.pointable().direction().angleTo(circle.normal()) <= Math.PI/4) {
// Clockwise if angle is less than 90 degrees
clockwiseness = "clockwise";
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
Debug.getInstance().mouse("raduis:" + circle.radius());
} else {
clockwiseness = "counterclockwise";
robot.mousePress(InputEvent.BUTTON3_MASK);
robot.mouseRelease(InputEvent.BUTTON3_MASK);
}
Debug.getInstance().mouse("end of swipe "+ clockwiseness);
}
}
}
开发者ID:francoiscabrol,项目名称:LoCALISM,代码行数:23,代码来源:MouseReplacement.java
示例2: start
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
/**
* Initializes LeapManager and the Leap.
*/
public void start() {
System.out.println("## Leap: Starting LeapManager.");
this.controller = new Controller();
this.listener = new LeapListener(this);
this.frame = controller.frame();
this.controller.addListener(this.listener);
controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
if (controller.config().setFloat("Gesture.Swipe.MinLength", 10.0f)
&& controller.config().setFloat("Gesture.Swipe.MinVelocity", 50.0f)
&& controller.config().setFloat("Gesture.KeyTap.MinDownVelocity", 20.0f)
&& controller.config().setFloat("Gesture.ScreenTap.MinForwardVelocity", 10.0f)) {
System.out.println("## Leap: Updated device configuration.");
controller.config().save();
}
}
开发者ID:forairan,项目名称:Leapcraft,代码行数:23,代码来源:LeapManager.java
示例3: circleGestureRecognized
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void circleGestureRecognized(CircleGesture detectedGesture) {
if (detectedGesture.state() == Gesture.State.STATE_STOP) {
//This may have been already consumed, we are not sure.
if (!consumedCircleGestureBuffer.contains(detectedGesture.id()))
circleGestureBuffer.put(detectedGesture.id(), detectedGesture);
logger.debug("//////////////////////////////////////");
logger.debug("Gesture type: " + detectedGesture.type().toString());
logger.debug("ID: " + detectedGesture.id());
logger.debug("Radius: " + detectedGesture.radius());
logger.debug("Normal: " + detectedGesture.normal());
logger.debug("Clockwise: " + JitterSystem.isClockwise(detectedGesture));
logger.debug("Turns: " + detectedGesture.progress());
logger.debug("Center: " + detectedGesture.center());
logger.debug("Duration: " + detectedGesture.durationSeconds() + "s");
logger.debug("//////////////////////////////////////");
} else if (detectedGesture.state() == Gesture.State.STATE_START) {
circleGestureBuffer.put(detectedGesture.id(), detectedGesture);
} else if (detectedGesture.state() == Gesture.State.STATE_UPDATE) {
if (!consumedCircleGestureBuffer.contains(detectedGesture.id()))
circleGestureBuffer.put(detectedGesture.id(), detectedGesture);
}
}
开发者ID:openleap,项目名称:jitter,代码行数:25,代码来源:BufferedJitterSystem.java
示例4: swipeGestureRecognized
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void swipeGestureRecognized(SwipeGesture detectedGesture) {
logger.info("Swipe gesture recognizeD.");
if (detectedGesture.state() == Gesture.State.STATE_STOP) {
if(!consumedSwipeGestureBuffer.contains(detectedGesture.id()))
swipeGestureBuffer.put(detectedGesture.id(), detectedGesture);
logger.debug("//////////////////////////////////////");
logger.debug("Gesture type: " + detectedGesture.type());
logger.debug("ID: " + detectedGesture.id());
logger.debug("Position: " + detectedGesture.position());
logger.debug("Direction: " + detectedGesture.direction());
logger.debug("Duration: " + detectedGesture.durationSeconds() + "s");
logger.debug("Speed: " + detectedGesture.speed());
logger.debug("//////////////////////////////////////");
} else if (detectedGesture.state() == Gesture.State.STATE_START) {
logger.info("Swipe gesture recognized.");
swipeGestureBuffer.put(detectedGesture.id(), detectedGesture);
} else if (detectedGesture.state() == Gesture.State.STATE_UPDATE) {
logger.info("Swipe gesture recognizEd.");
if(!consumedSwipeGestureBuffer.contains(detectedGesture.id()))
swipeGestureBuffer.put(detectedGesture.id(), detectedGesture);
}
}
开发者ID:openleap,项目名称:jitter,代码行数:25,代码来源:BufferedJitterSystem.java
示例5: screenTapGestureRecognized
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void screenTapGestureRecognized(ScreenTapGesture detectedGesture) {
if (detectedGesture.state() == Gesture.State.STATE_STOP) {
if(!consumedScreenTapGestureBuffer.contains(detectedGesture.id()))
screenTapGestureBuffer.put(detectedGesture.id(), detectedGesture);
logger.debug("//////////////////////////////////////");
logger.debug("Gesture type: " + detectedGesture.type());
logger.debug("ID: " + detectedGesture.id());
logger.debug("Position: " + detectedGesture.position());
logger.debug("Direction: " + detectedGesture.direction());
logger.debug("Duration: " + detectedGesture.durationSeconds() + "s");
logger.debug("//////////////////////////////////////");
} else if (detectedGesture.state() == Gesture.State.STATE_START) {
screenTapGestureBuffer.put(detectedGesture.id(), detectedGesture);
} else if (detectedGesture.state() == Gesture.State.STATE_UPDATE) {
if(!consumedScreenTapGestureBuffer.contains(detectedGesture.id()))
screenTapGestureBuffer.put(detectedGesture.id(), detectedGesture);
}
}
开发者ID:openleap,项目名称:jitter,代码行数:21,代码来源:BufferedJitterSystem.java
示例6: keyTapGestureRecognized
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void keyTapGestureRecognized(KeyTapGesture detectedGesture) {
if (detectedGesture.state() == Gesture.State.STATE_STOP) {
if(!consumedKeyTapGestureBuffer.contains(detectedGesture.id()))
keyTapGestureBuffer.put(detectedGesture.id(), detectedGesture);
logger.debug("//////////////////////////////////////");
logger.debug("Gesture type: " + detectedGesture.type());
logger.debug("ID: " + detectedGesture.id());
logger.debug("Position: " + detectedGesture.position());
logger.debug("Direction: " + detectedGesture.direction());
logger.debug("Duration: " + detectedGesture.durationSeconds() + "s");
logger.debug("//////////////////////////////////////");
} else if (detectedGesture.state() == Gesture.State.STATE_START) {
keyTapGestureBuffer.put(detectedGesture.id(), detectedGesture);
} else if (detectedGesture.state() == Gesture.State.STATE_UPDATE) {
if(!consumedKeyTapGestureBuffer.contains(detectedGesture.id()))
keyTapGestureBuffer.put(detectedGesture.id(), detectedGesture);
}
}
开发者ID:openleap,项目名称:jitter,代码行数:21,代码来源:BufferedJitterSystem.java
示例7: onFrame
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
public void onFrame(Controller controller)
{
Frame frame = controller.frame();
GestureList gestures = frame.gestures();
for (Gesture gesture : gestures)
{
processGestureEvent(gesture);
}
if (frame.hands().isEmpty())
{
processNoDetectionEvent();
} else
{
Hand hand = frame.hands().get(0);
processDetectionEvent(hand);
}
}
开发者ID:theone1984,项目名称:parroteer,代码行数:21,代码来源:LeapMotionListener.java
示例8: onConnect
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void onConnect(Controller controller) {
log.info("Connected");
controller.enableGesture(Gesture.Type.TYPE_SWIPE);
controller.enableGesture(Gesture.Type.TYPE_CIRCLE);
controller.enableGesture(Gesture.Type.TYPE_SCREEN_TAP);
controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
log.info("Connected");
myService.invoke("publishConnect", controller);
}
开发者ID:glaudiston,项目名称:project-bianca,代码行数:11,代码来源:LeapMotionListener.java
示例9: onConnect
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void onConnect(Controller controller) {
System.out.println("Connected");
controller.enableGesture(Gesture.Type.TYPE_SWIPE);
controller.enableGesture(Gesture.Type.TYPE_CIRCLE);
controller.enableGesture(Gesture.Type.TYPE_SCREEN_TAP);
controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
}
开发者ID:glaudiston,项目名称:project-bianca,代码行数:9,代码来源:SampleListener.java
示例10: GestureListObj
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
public GestureListObj(GestureList list, FrameObj frame, ControllerObj controller) {
this.controller = controller;
gestures = new ArrayList<GestureObj>();
for (Gesture g : list) {
gestures.add(new GestureObj(g, frame, controller));
}
}
开发者ID:paluka,项目名称:Multi-Leap,代码行数:9,代码来源:GestureListObj.java
示例11: GestureObj
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
public GestureObj(Gesture g, FrameObj f, ControllerObj controller) {
this.controller = controller;
duration = g.duration();
id = g.id();
//handList = new HandListObj(g.hands());
//pointableList = new PointableListObj(g.pointables());
type = g.type();
state = g.state();
frame = f;
}
开发者ID:paluka,项目名称:Multi-Leap,代码行数:11,代码来源:GestureObj.java
示例12: setGestureState
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
public Gesture.State setGestureState(String state) {
if (state.equalsIgnoreCase("start")) {
return Gesture.State.STATE_START;
} else if (state.equalsIgnoreCase("update")) {
return Gesture.State.STATE_UPDATE;
} else if (state.equalsIgnoreCase("stop")) {
return Gesture.State.STATE_STOP;
} else {
return Gesture.State.STATE_INVALID;
}
}
开发者ID:paluka,项目名称:Multi-Leap,代码行数:12,代码来源:LeapParser.java
示例13: onConnect
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void onConnect(Controller controller) {
log.info("Connected");
controller.enableGesture(Gesture.Type.TYPE_SWIPE);
controller.enableGesture(Gesture.Type.TYPE_CIRCLE);
controller.enableGesture(Gesture.Type.TYPE_SCREEN_TAP);
controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
log.info("Connected");
myService.invoke("publishConnect", controller);
}
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:11,代码来源:LeapMotionListener.java
示例14: onConnect
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void onConnect(Controller controller) {
System.out.println("Connected");
controller.enableGesture(Gesture.Type.TYPE_SWIPE);
controller.enableGesture(Gesture.Type.TYPE_CIRCLE);
controller.enableGesture(Gesture.Type.TYPE_SCREEN_TAP);
controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
}
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:9,代码来源:SampleListener.java
示例15: onConnect
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
@Override
public void onConnect(Controller controller) {
System.out.println(LeapMotionListenerC.onConnect);
if (controller.config().setFloat("Gesture.Swipe.MinLength", LeapMotionListenerC.swipe_minlength))
controller.config().save();
controller.enableGesture(Gesture.Type.TYPE_SWIPE);
controller.enableGesture(Gesture.Type.TYPE_CIRCLE);
controller.enableGesture(Gesture.Type.TYPE_SCREEN_TAP);
controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
controller.setPolicyFlags(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
}
开发者ID:valenbg1,项目名称:protoboard,代码行数:15,代码来源:LeapMotionListener.java
示例16: setup
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
protected void setup() {
super.setup();
SoundPlayAgentNickName = (String) getArguments()[0];
System.out.println("SoundPlayAgentNickName = " + SoundPlayAgentNickName);
System.out.println(getLocalName()+"--> Installed");
changes = new PropertyChangeSupport(this);
menu_view = new MenuView(this);
instrument_view = new InstrumentSelectView(this);
game_view = new GameView(this);
room_view = new RoomSelectView(this);
wait_view = new MultiwaitRoom(this);
changeCurrentViewTo(menu_view);
listener = new LeapListener(this);
controller = new Controller();
//controller.enableGesture( Gesture.Type.TYPE_KEY_TAP );
controller.enableGesture( Gesture.Type.TYPE_CIRCLE);
controller.enableGesture( Gesture.Type.TYPE_SWIPE);
//controller.enableGesture( Gesture.Type.TYPE_SCREEN_TAP);
//listener.setDebug(true);
listener.setClickType(1);
listener.setCalibratedScren(true);
controller.addListener(listener);
// Remove the listener when done
//controller.removeListener(listener);
}
开发者ID:hukewei,项目名称:leapband,代码行数:29,代码来源:UserAgent.java
示例17: onConnect
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
public void onConnect(Controller controller) {
System.out.println("Connected");
controller.enableGesture(Gesture.Type.TYPE_SWIPE);
//controller.enableGesture(Gesture.Type.TYPE_CIRCLE);
//controller.enableGesture(Gesture.Type.TYPE_SCREEN_TAP);
//controller.enableGesture(Gesture.Type.TYPE_KEY_TAP);
}
开发者ID:andrewgu,项目名称:leapmotion-spotify-controller,代码行数:8,代码来源:SwipeListener.java
示例18: processGestures
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
private void processGestures(Controller controller) {
GestureList list = controller.frame().gestures();
//TODO: Hmm, this if isn't actually needed, is it? list.count() == 0 will skip the loop anyway
if (!list.isEmpty()) {
for (int i = 0; i < list.count(); i++) {
Gesture gesture = list.get(i);
invokeCallback(gesture);
printGestureDetails(gesture, controller);
}
}
}
开发者ID:openleap,项目名称:jitter,代码行数:12,代码来源:InternalLeapListener.java
示例19: removeStoppedCircles
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
private void removeStoppedCircles(CircleGesture circleGesture) {
if (circleGesture.state() == Gesture.State.STATE_STOP) {
circleGestureBuffer.remove(circleGesture.id());
if (consumptionEnabled) {
consumedCircleGestureBuffer.remove(circleGesture.id());
logger.debug("Just removed gesture with id " + circleGesture.id() + " from the 'consumed' list");
}
}
}
开发者ID:openleap,项目名称:jitter,代码行数:10,代码来源:BufferedJitterSystem.java
示例20: removeStoppedSwipes
import com.leapmotion.leap.Gesture; //导入依赖的package包/类
private void removeStoppedSwipes(SwipeGesture swipeGesture) {
if(swipeGesture.state() == Gesture.State.STATE_STOP) {
swipeGestureBuffer.remove(swipeGesture.id());
if(consumptionEnabled) {
consumedSwipeGestureBuffer.remove(swipeGesture.id());
logger.debug("Removed the swipe gesture from the consumed buffer with the id {}", swipeGesture.id());
}
}
}
开发者ID:openleap,项目名称:jitter,代码行数:10,代码来源:BufferedJitterSystem.java
注:本文中的com.leapmotion.leap.Gesture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论