public final class RotateEvent extends GestureEvent
イベントは、ジェスチャの開始時にジェスチャ座標で選択された最上位ノードに配信されます。ジェスチャ時に座標が変更された場合でも、ジェスチャ全体が同じノードに配信されます。
イベントによって2つの値が提供されます。angle
はこのイベントの回転角度で、totalAngle
はジェスチャ全体の回転角度です。どちらの値も度数で表し、ノードのrotate
プロパティの値(時計回りの回転の場合は正の値)に加算することで機能します。
すべてのジェスチャと同様に、回転は直接的に実行(タッチ画面のように具体的な座標で直接実行 - 通常、すべてのタッチの中心点をジェスチャ座標として使用)するか、間接的に実行(トラック・パッドの場合のように間接的に実行 - 通常、マウス・カーソルの位置をジェスチャ座標として使用)できます。
ジェスチャのROTATE
イベントは、ROTATION_STARTED
イベントとROTATION_FINISHED
イベントの間に発生します。該当するプラットフォームで回転慣性がアクティブになっている場合、isInertia()
でtrue
が返されたROTATE
イベントがROTATION_FINISHED
より後になることがあります。
修飾子と型 | フィールドと説明 |
---|---|
static EventType<RotateEvent> |
ANY
すべての回転イベント・タイプに共通のスーパータイプ。
|
static EventType<RotateEvent> |
ROTATE
このイベントは、2本の指を互いを支点にしてドラッグするなど、ユーザーが回転ジェスチャを実行したときに発生します。
|
static EventType<RotateEvent> |
ROTATION_FINISHED
このイベントは、回転ジェスチャが終了したときに発生します。
|
static EventType<RotateEvent> |
ROTATION_STARTED
このイベントは、回転ジェスチャが検出されたときに発生します。
|
consumed、eventType、NULL_SOURCE_TARGET、target
source
コンストラクタと説明 |
---|
RotateEvent(EventType<RotateEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double angle, double totalAngle, PickResult pickResult)
nullのソースとターゲットを使用した新しいRotateEventイベントを構築します。
|
RotateEvent(Object source, EventTarget target, EventType<RotateEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double angle, double totalAngle, PickResult pickResult)
新しいRotateEventイベントを構築します。
|
修飾子と型 | メソッドと説明 |
---|---|
RotateEvent |
copyFor(Object newSource, EventTarget newTarget)
指定したイベント・ソースとターゲットを持つこのイベントのコピーを作成して返します。
|
RotateEvent |
copyFor(Object newSource, EventTarget newTarget, EventType<RotateEvent> type)
指定のフィールドが置換された特定のイベントのコピーを作成します。
|
double |
getAngle()
このイベントの回転角度を取得します。
|
EventType<RotateEvent> |
getEventType()
このイベントのイベント・タイプを取得します。
|
double |
getTotalAngle()
このジェスチャの累計回転角度を取得します。
|
String |
toString()
この
RotateEvent オブジェクトの文字列表現を返します。 |
getPickResult、getSceneX、getSceneY、getScreenX、getScreenY、getX、getY、getZ、isAltDown、isControlDown、isDirect、isInertia、isMetaDown、isShiftDown、isShortcutDown
getSource
public static final EventType<RotateEvent> ANY
public static final EventType<RotateEvent> ROTATE
public static final EventType<RotateEvent> ROTATION_STARTED
public static final EventType<RotateEvent> ROTATION_FINISHED
public RotateEvent(Object source, EventTarget target, EventType<RotateEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double angle, double totalAngle, PickResult pickResult)
source
- イベントのソース。nullに設定できます。target
- イベントのターゲット。nullに設定できます。eventType
- イベントのタイプ。x
- シーンに関連するx。y
- シーンに関連するy。screenX
- 画面に対して相対的なx座標。screenY
- 画面に対して相対的なy座標。shiftDown
- Shift修飾子が押された場合はtrueです。controlDown
- Ctrl修飾子が押された場合はtrueです。altDown
- Alt修飾子が押された場合はtrueです。metaDown
- Meta修飾子が押された場合はtrueです。direct
- イベントが直接入力デバイスによって発生した場合はtrueです。GestureEvent.isDirect()
を参照してください。inertia
- すでに終了したジェスチャの慣性を表す場合。angle
- 回転角度totalAngle
- 累計回転角度pickResult
- 選択結果。nullに設定でき、その場合は、シーン座標とターゲットに基づいて、追加の値のない2D選択結果が構築されます。public RotateEvent(EventType<RotateEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double angle, double totalAngle, PickResult pickResult)
eventType
- イベントのタイプ。x
- シーンに関連するx。y
- シーンに関連するy。screenX
- 画面に対して相対的なx座標。screenY
- 画面に対して相対的なy座標。shiftDown
- Shift修飾子が押された場合はtrueです。controlDown
- Ctrl修飾子が押された場合はtrueです。altDown
- Alt修飾子が押された場合はtrueです。metaDown
- Meta修飾子が押された場合はtrueです。direct
- イベントが直接入力デバイスによって発生した場合はtrueです。GestureEvent.isDirect()
を参照してください。inertia
- すでに終了したジェスチャの慣性を表す場合。angle
- 回転角度totalAngle
- 累計回転角度pickResult
- 選択結果。nullに設定でき、その場合は、シーン座標に基づいて、追加の値のない2D選択結果が構築されます。public double getAngle()
rotate
プロパティの値(時計回りの回転の場合は正の値)に加算することで機能します。public double getTotalAngle()
rotate
プロパティの値(時計回りの回転の場合は正の値)に加算することで機能します。public String toString()
RotateEvent
オブジェクトの文字列表現を返します。toString
、クラス: GestureEvent
RotateEvent
オブジェクトの文字列表現public RotateEvent copyFor(Object newSource, EventTarget newTarget)
Event
null
に設定されている場合は、NULL_SOURCE_TARGET
値によって置換されます。copyFor
、クラス: GestureEvent
newSource
- コピーされたイベントの新しいソースnewTarget
- コピーされたイベントの新しいターゲットpublic RotateEvent copyFor(Object newSource, EventTarget newTarget, EventType<RotateEvent> type)
source
- コピーされたイベントの新しいソースtarget
- コピーされたイベントの新しいターゲットeventType
- 新しいイベント・タイプpublic EventType<RotateEvent> getEventType()
Event
Event
クラスの複数のオブジェクトは、異なるイベント・タイプを持つことができます。これらのイベント・タイプでは、発生するイベントの種類をさらに指定します。getEventType
、クラス: GestureEvent
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.