本文整理汇总了Java中javafx.scene.input.RotateEvent类的典型用法代码示例。如果您正苦于以下问题:Java RotateEvent类的具体用法?Java RotateEvent怎么用?Java RotateEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RotateEvent类属于javafx.scene.input包,在下文中一共展示了RotateEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: sendRotateEvent
import javafx.scene.input.RotateEvent; //导入依赖的package包/类
private void sendRotateEvent(EventType<RotateEvent> fxEventType,
final GestureEvent event,
TKSceneListener sceneListener) {
Point screenPosition = canvas.toDisplay(event.x, event.y);
double rotation = (fxEventType == RotateEvent.ROTATION_FINISHED)
? currentState.lastRotation
: -event.rotation;
// System.out.println(fxEventType + " " + rotation);
sceneListener.rotateEvent(fxEventType,
rotation - currentState.lastRotation, // rotation
rotation, // totalRotation
event.x, event.y, // x, y
screenPosition.x, screenPosition.y, // screenX, screenY
isShift(event), isControl(event), isAlt(event), isMeta(event),
false, // direct
false); // inertia
currentState.lastRotation = rotation;
}
开发者ID:JanKoehnlein,项目名称:JavaFX-SWT-Gesture-Bridge,代码行数:19,代码来源:SwtToFXGestureConverter.java
示例2: compositeTokenPane_OnRotate
import javafx.scene.input.RotateEvent; //导入依赖的package包/类
@FXML
void compositeTokenPane_OnRotate(RotateEvent event) {
log.info("isDirect(): " + event.isDirect());
log.info("getTotalAngle" + event.getTotalAngle());
double r = portraitImageView.getRotate() + (event.getAngle() * 0.75);
if (r < -360d || r > 360d)
r = 0d;
portraitImageView.setRotate(r);
event.consume();
}
开发者ID:RPTools,项目名称:tokentool,代码行数:13,代码来源:TokenTool_Controller.java
示例3: changeState
import javafx.scene.input.RotateEvent; //导入依赖的package包/类
protected boolean changeState(StateType newStateType, GestureEvent event, TKSceneListener sceneListener) {
if(newStateType != currentState.type) {
switch (currentState.type) {
case SCROLLING:
sendScrollEvent(ScrollEvent.SCROLL_FINISHED, event, sceneListener);
break;
case ROTATING:
sendRotateEvent(RotateEvent.ROTATION_FINISHED, event, sceneListener);
break;
case ZOOMING:
sendZoomEvent(ZoomEvent.ZOOM_FINISHED, event, sceneListener);
break;
default:
// do nothing
}
switch (newStateType) {
case SCROLLING:
sendScrollEvent(ScrollEvent.SCROLL_STARTED, event, sceneListener);
break;
case ROTATING:
sendRotateEvent(RotateEvent.ROTATION_STARTED, event, sceneListener);
break;
case ZOOMING:
sendZoomEvent(ZoomEvent.ZOOM_STARTED, event, sceneListener);
break;
case IDLE:
if(event.detail == SWT.GESTURE_SWIPE)
sendSwipeEvent(event, sceneListener);
break;
default:
// do nothing
}
currentState = new State(newStateType);
return true;
}
switch (newStateType) {
case SCROLLING:
sendScrollEvent(ScrollEvent.SCROLL, event, sceneListener);
break;
case ROTATING:
sendRotateEvent(RotateEvent.ROTATE, event, sceneListener);
break;
case ZOOMING:
sendZoomEvent(ZoomEvent.ZOOM, event, sceneListener);
break;
case IDLE:
if(event.detail == SWT.GESTURE_SWIPE)
sendSwipeEvent(event, sceneListener);
default:
// do nothing
}
return false;
}
开发者ID:JanKoehnlein,项目名称:JavaFX-SWT-Gesture-Bridge,代码行数:54,代码来源:SwtToFXGestureConverter.java
注:本文中的javafx.scene.input.RotateEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论