java.lang.Object
java.awt.dnd.DragGestureRecognizer
java.awt.dnd.MouseDragGestureRecognizer
- すべての実装されたインタフェース:
MouseListener,MouseMotionListener,Serializable,EventListener
public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer implements MouseListener, MouseMotionListener
DragGestureRecognizerのこの抽象サブクラスは、マウス・ベースのジェスチャのDragGestureRecognizerを定義します。 各プラットフォームは、Toolkit.createDragGestureRecognizer()メソッドを介して利用可能なこのクラスの具象サブクラスを独自に実装し、ドラッグ&ドロップ操作を開始するプラットフォーム依存のマウス・ジェスチャの認識をカプセル化します。
マウス・ドラッグ・ジェスチャ・レコグナイザは、DragSource.getDragThreshold()から取得できるドラッグ・ジェスチャ・モーションのしきい値を受け取るべきです。 ドラッグ・ジェスチャは、最後のマウス・ドラッグ・イベントの場所と対応するマウス・ボタン押下イベントの場所の水平または垂直方向の距離がドラッグ・ジェスチャ・モーションのしきい値より大きい場合にのみ認識される必要があります。
DragSource.createDefaultDragGestureRecognizer(java.awt.Component, int, java.awt.dnd.DragGestureListener)で作成されたドラッグ・ジェスチャ・レコグナイザは、この規則に従います。
- 関連項目:
-
フィールドのサマリー
クラス java.awt.dnd.DragGestureRecognizerで宣言されたフィールド
component, dragGestureListener, dragSource, events, sourceActions -
コンストラクタのサマリー
コンストラクタ修飾子コンストラクタ説明protectedComponentのDragSourceを使用して、新しいMouseDragGestureRecognizerを構築します。protectedComponentcのDragSource、および監視するComponentを使用して、新しいMouseDragGestureRecognizerを構築します。protectedMouseDragGestureRecognizer(DragSource ds, Component c, int act) ComponentcのDragSource、監視するComponent、およびこのドラッグ操作で許可されるアクションを使用して、新しいMouseDragGestureRecognizerを構築します。protectedMouseDragGestureRecognizer(DragSource ds, Component c, int act, DragGestureListener dgl) ComponentcのDragSource、監視するComponent、このドラッグ操作で許可されるアクション、およびドラッグ・ジェスチャが検出されたときに通知するDragGestureListenerを使用して、新しいMouseDragGestureRecognizerを構築します。 -
メソッドのサマリー
修飾子と型メソッド説明voidコンポーネント上でマウスがクリックされると呼び出されます。voidマウス・ボタンがコンポーネント上で押されたときに呼び出されます。voidコンポーネントにマウスが入ると呼び出されます。voidコンポーネントからマウスが出ると呼び出されます。voidコンポーネント上でマウス・ボタンが移動される(ボタンは押されない)と呼び出されます。voidComponent上でマウス・ボタンが押されたときに呼び出されます。voidコンポーネント上でマウス・ボタンが離されると呼び出されます。protected voidこのDragGestureRecognizerのリスナーをComponentに登録します。protected voidこのDragGestureRecognizerのリスナーをComponentから登録解除します。サブクラスはこのメソッドをオーバーライドする必要があります。
-
コンストラクタの詳細
-
MouseDragGestureRecognizer
protected MouseDragGestureRecognizer(DragSource ds, Component c, int act, DragGestureListener dgl) ComponentcのDragSource、監視するComponent、このドラッグ操作で許可されるアクション、およびドラッグ・ジェスチャが検出されたときに通知するDragGestureListenerを使用して、新しいMouseDragGestureRecognizerを構築します。- パラメータ:
ds- Component cのDragSourcec- 監視するComponentact- このドラッグで許可されるアクションdgl- ジェスチャが検出されたときに通知するDragGestureListener
-
MouseDragGestureRecognizer
protected MouseDragGestureRecognizer(DragSource ds, Component c, int act) ComponentcのDragSource、監視するComponent、およびこのドラッグ操作で許可されるアクションを使用して、新しいMouseDragGestureRecognizerを構築します。- パラメータ:
ds- Component cのDragSourcec- 監視するComponentact- このドラッグで許可されるアクション
-
MouseDragGestureRecognizer
protected MouseDragGestureRecognizer(DragSource ds, Component c) ComponentcのDragSource、および監視するComponentを使用して、新しいMouseDragGestureRecognizerを構築します。- パラメータ:
ds- Component cのDragSourcec- 監視するComponent
-
MouseDragGestureRecognizer
protected MouseDragGestureRecognizer(DragSource ds) ComponentのDragSourceを使用して、新しいMouseDragGestureRecognizerを構築します。- パラメータ:
ds- ComponentのDragSource
-
-
メソッドの詳細
-
registerListeners
protected void registerListeners()このDragGestureRecognizerのリスナーをComponentに登録します。 -
unregisterListeners
protected void unregisterListeners()このDragGestureRecognizerのリスナーをComponentから登録解除します。サブクラスはこのメソッドをオーバーライドする必要があります。 -
mouseClicked
public void mouseClicked(MouseEvent e) コンポーネント上でマウスがクリックされると呼び出されます。- 定義:
mouseClicked、インタフェースMouseListener- パラメータ:
e-MouseEvent
-
mousePressed
public void mousePressed(MouseEvent e) Component上でマウス・ボタンが押されたときに呼び出されます。- 定義:
mousePressed、インタフェースMouseListener- パラメータ:
e-MouseEvent
-
mouseReleased
public void mouseReleased(MouseEvent e) コンポーネント上でマウス・ボタンが離されると呼び出されます。- 定義:
mouseReleased、インタフェースMouseListener- パラメータ:
e-MouseEvent
-
mouseEntered
public void mouseEntered(MouseEvent e) コンポーネントにマウスが入ると呼び出されます。- 定義:
mouseEntered、インタフェースMouseListener- パラメータ:
e-MouseEvent
-
mouseExited
public void mouseExited(MouseEvent e) コンポーネントからマウスが出ると呼び出されます。- 定義:
mouseExited、インタフェースMouseListener- パラメータ:
e-MouseEvent
-
mouseDragged
public void mouseDragged(MouseEvent e) マウス・ボタンがコンポーネント上で押されたときに呼び出されます。- 定義:
mouseDragged、インタフェースMouseMotionListener- パラメータ:
e-MouseEvent
-
mouseMoved
public void mouseMoved(MouseEvent e) コンポーネント上でマウス・ボタンが移動される(ボタンは押されない)と呼び出されます。- 定義:
mouseMoved、インタフェースMouseMotionListener- パラメータ:
e-MouseEvent
-