public final class MouseDragEvent extends MouseEvent
MouseEvent
を参照してください。
完全な押下、ドラッグ、解放ジェスチャを開始するには、DRAG_DETECTEDイベント・ハンドラ内で(ノードまたはシーンに対して)startFullDrag()
を呼び出します。この呼出しにより、ドラッグ・ジェスチャ中の、カーソルの下にあるノードに対するMouseDragEvent
の配信がアクティブ化されます。
ノードのドラッグ時にはまだカーソルの下にノードがあるため、そのノードはジェスチャ全体の中でジェスチャ・ターゲット候補とみなされます。ノードを別のノードにドラッグし、ドラッグ先ノードでそのことが認識されるようにする必要がある場合は、ドラッグ対象のノードの下にあるノードが、ジェスチャ・ターゲット候補として選択されるようにする必要があります。このことは、MOUSE_PRESSED
ハンドラでドラッグ対象ノードに対してsetMouseTransparent(true)
を呼び出し、それをMOUSE_RELEASED
ハンドラでfalseに戻すことによって実現できます。これにより、ドラッグ対象ノードの下にあるノードがMouseDragEvent
を受け取るようになると同時に、すべてのMouseEvent
が、(現在マウスが透過している)ジェスチャ・ソースに引き続き配信されます。
入出イベントの動作はマウス入出イベントに似ています。MouseEvent
の概要を参照してください。
修飾子と型 | フィールドと説明 |
---|---|
static EventType<MouseDragEvent> |
ANY
すべてのマウス・イベント・タイプに共通のスーパータイプ。
|
static EventType<MouseDragEvent> |
MOUSE_DRAG_ENTERED
このイベントは、ジェスチャがノードに入ったときに発生します。
|
static EventType<MouseDragEvent> |
MOUSE_DRAG_ENTERED_TARGET
このイベントは、ジェスチャがノードに入ったときに発生します。
|
static EventType<MouseDragEvent> |
MOUSE_DRAG_EXITED
このイベントは、ジェスチャがノードを出たときに発生します。
|
static EventType<MouseDragEvent> |
MOUSE_DRAG_EXITED_TARGET
このイベントは、ジェスチャがノードを出たときに発生します。
|
static EventType<MouseDragEvent> |
MOUSE_DRAG_OVER
このイベントは、ジェスチャが該当ノード内で進行中のときに発生します。
|
static EventType<MouseDragEvent> |
MOUSE_DRAG_RELEASED
このイベントは、(マウス・ボタンを放すことによって)ジェスチャが該当ノードで終了したときに発生します。
|
DRAG_DETECTED、MOUSE_CLICKED、MOUSE_DRAGGED、MOUSE_ENTERED、MOUSE_ENTERED_TARGET、MOUSE_EXITED、MOUSE_EXITED_TARGET、MOUSE_MOVED、MOUSE_PRESSED、MOUSE_RELEASED
consumed、eventType、NULL_SOURCE_TARGET、target
source
コンストラクタと説明 |
---|
MouseDragEvent(EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource)
nullのソースとターゲットを使用した新しいMouseDragEventイベントを構築します。
|
MouseDragEvent(Object source, EventTarget target, EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource)
新しいMouseDragEventイベントを構築します。
|
修飾子と型 | メソッドと説明 |
---|---|
MouseDragEvent |
copyFor(Object newSource, EventTarget newTarget)
該当するイベントを別のソースおよびターゲット用にコピーします。
|
MouseDragEvent |
copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> type)
指定のフィールドが置換された特定のイベントのコピーを作成します。
|
EventType<MouseDragEvent> |
getEventType()
このイベントのイベント・タイプを取得します。
|
Object |
getGestureSource()
継続中のジェスチャのソース・オブジェクトを返します。
|
String |
toString()
この
MouseDragEvent オブジェクトの文字列表現を返します。 |
copyForMouseDragEvent、getButton、getClickCount、getPickResult、getSceneX、getSceneY、getScreenX、getScreenY、getX、getY、getZ、isAltDown、isControlDown、isDragDetect、isMetaDown、isMiddleButtonDown、isPopupTrigger、isPrimaryButtonDown、isSecondaryButtonDown、isShiftDown、isShortcutDown、isStillSincePress、isSynthesized、setDragDetect
getSource
public static final EventType<MouseDragEvent> ANY
public static final EventType<MouseDragEvent> MOUSE_DRAG_OVER
public static final EventType<MouseDragEvent> MOUSE_DRAG_RELEASED
public static final EventType<MouseDragEvent> MOUSE_DRAG_ENTERED_TARGET
MOUSE_DRAG_ENTERED
イベント・ハンドラを使用する必要があります。public static final EventType<MouseDragEvent> MOUSE_DRAG_ENTERED
MOUSE_DRAG_ENTERED_TARGET
を使用する必要があります。public static final EventType<MouseDragEvent> MOUSE_DRAG_EXITED_TARGET
MOUSE_DRAG_EXITED
イベント・ハンドラを使用する必要があります。public static final EventType<MouseDragEvent> MOUSE_DRAG_EXITED
MOUSE_DRAG_EXITED_TARGET
を使用する必要があります。public MouseDragEvent(Object source, EventTarget target, EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource)
source
- イベントのソース。nullに設定できます。target
- イベントのターゲット。nullに設定できます。eventType
- イベントのタイプ。x
- シーンに関連するx。y
- シーンに関連するy。screenX
- 画面に対して相対的なx座標。screenY
- 画面に対して相対的なy座標。button
- 使用されたマウス・ボタンclickCount
- クリック・カウント数shiftDown
- Shift修飾子が押された場合はtrueです。controlDown
- Ctrl修飾子が押された場合はtrueです。altDown
- Alt修飾子が押された場合はtrueです。metaDown
- Meta修飾子が押された場合はtrueです。primaryButtonDown
- プライマリ・ボタンが押下された場合はtrue。middleButtonDown
- 中央ボタンが押下された場合はtrue。secondaryButtonDown
- セカンダリ・ボタンが押下された場合はtrue。synthesized
- このイベントが合成された場合popupTrigger
- このイベントが現在のプラットフォームのポップアップ・トリガーを示すかどうかpickResult
- 選択結果。nullにでき、この場合は、追加の値がない2Dの選択結果が、シーン座標とターゲットに基づいて作成されます。gestureSource
- 継続中のジェスチャのソース・オブジェクト。public MouseDragEvent(EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource)
eventType
- イベントのタイプ。x
- シーンに関連するx。y
- シーンに関連するy。screenX
- 画面に対して相対的なx座標。screenY
- 画面に対して相対的なy座標。button
- 使用されたマウス・ボタンclickCount
- クリック・カウント数shiftDown
- Shift修飾子が押された場合はtrueです。controlDown
- Ctrl修飾子が押された場合はtrueです。altDown
- Alt修飾子が押された場合はtrueです。metaDown
- Meta修飾子が押された場合はtrueです。primaryButtonDown
- プライマリ・ボタンが押下された場合はtrue。middleButtonDown
- 中央ボタンが押下された場合はtrue。secondaryButtonDown
- セカンダリ・ボタンが押下された場合はtrue。synthesized
- このイベントが合成された場合popupTrigger
- このイベントが現在のプラットフォームのポップアップ・トリガーを示すかどうかpickResult
- 選択結果。nullに設定でき、その場合は、シーン座標に基づいて、追加の値のない2D選択結果が構築されます。gestureSource
- 継続中のジェスチャのソース・オブジェクト。public Object getGestureSource()
startFullDrag
メソッドを呼び出すことによって)完全な押下、ドラッグ、解放ジェスチャが開始されたオブジェクトです。public String toString()
MouseDragEvent
オブジェクトの文字列表現を返します。toString
、クラス: MouseEvent
MouseDragEvent
オブジェクトの文字列表現public MouseDragEvent copyFor(Object newSource, EventTarget newTarget)
MouseEvent
copyFor
、クラス: MouseEvent
newSource
- 新しいイベント・ソースnewTarget
- 新しいイベント・ターゲットpublic MouseDragEvent copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> type)
MouseEvent
copyFor
、クラス: MouseEvent
type
- 新しいeventTypepublic EventType<MouseDragEvent> getEventType()
Event
Event
クラスの複数のオブジェクトは、異なるイベント・タイプを持つことができます。これらのイベント・タイプでは、発生するイベントの種類をさらに指定します。getEventType
、クラス: MouseEvent
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.