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)で作成されたドラッグ・ジェスチャ・レコグナイザは、この規則に従います。
component, dragGestureListener, dragSource, events, sourceActions| 修飾子 | コンストラクタ | 説明 |
|---|---|---|
protected |
MouseDragGestureRecognizer(DragSource ds) |
ComponentのDragSourceを使用して、新しいMouseDragGestureRecognizerを構築します。 |
protected |
MouseDragGestureRecognizer(DragSource ds, Component c) |
Component cのDragSource、および監視するComponentを使用して、新しいMouseDragGestureRecognizerを構築します。 |
protected |
MouseDragGestureRecognizer(DragSource ds, Component c, int act) |
Component cのDragSource、監視するComponent、およびこのドラッグ操作で許可されるアクションを使用して、新しいMouseDragGestureRecognizerを構築します。 |
protected |
MouseDragGestureRecognizer(DragSource ds, Component c, int act, DragGestureListener dgl) |
Component cのDragSource、監視するComponent、このドラッグ操作で許可されるアクション、およびドラッグ・ジェスチャが検出されたときに通知するDragGestureListenerを使用して、新しいMouseDragGestureRecognizerを構築します。 |
| 修飾子と型 | メソッド | 説明 |
|---|---|---|
void |
mouseClicked(MouseEvent e) |
コンポーネント上でマウスがクリックされると呼び出されます。
|
void |
mouseDragged(MouseEvent e) |
マウス・ボタンがコンポーネント上で押されたときに呼び出されます。
|
void |
mouseEntered(MouseEvent e) |
コンポーネントにマウスが入ると呼び出されます。
|
void |
mouseExited(MouseEvent e) |
コンポーネントからマウスが出ると呼び出されます。
|
void |
mouseMoved(MouseEvent e) |
コンポーネント上でマウスが移動される(ボタンは押されない)と呼び出されます。
|
void |
mousePressed(MouseEvent e) |
Component上でマウス・ボタンが押されたときに呼び出されます。 |
void |
mouseReleased(MouseEvent e) |
コンポーネント上でマウス・ボタンが離されると呼び出されます。
|
protected void |
registerListeners() |
このDragGestureRecognizerのリスナーをComponentに登録します。
|
protected void |
unregisterListeners() |
このDragGestureRecognizerのリスナーをComponentから登録解除します。サブクラスはこのメソッドをオーバーライドする必要があります。
|
protected MouseDragGestureRecognizer(DragSource ds, Component c, int act, DragGestureListener dgl)
Component cのDragSource、監視するComponent、このドラッグ操作で許可されるアクション、およびドラッグ・ジェスチャが検出されたときに通知するDragGestureListenerを使用して、新しいMouseDragGestureRecognizerを構築します。
ds - Component cのDragSourcec - 監視するComponentact - このドラッグで許可されるアクションdgl - ジェスチャが検出されたときに通知するDragGestureListenerprotected MouseDragGestureRecognizer(DragSource ds, Component c, int act)
Component cのDragSource、監視するComponent、およびこのドラッグ操作で許可されるアクションを使用して、新しいMouseDragGestureRecognizerを構築します。
ds - Component cのDragSourcec - 監視するComponentact - このドラッグで許可されるアクションprotected MouseDragGestureRecognizer(DragSource ds, Component c)
Component cのDragSource、および監視するComponentを使用して、新しいMouseDragGestureRecognizerを構築します。
ds - Component cのDragSourcec - 監視するComponentprotected MouseDragGestureRecognizer(DragSource ds)
ComponentのDragSourceを使用して、新しいMouseDragGestureRecognizerを構築します。
ds - ComponentのDragSourceprotected void registerListeners()
protected void unregisterListeners()
public void mouseClicked(MouseEvent e)
mouseClicked、インタフェースMouseListenere - MouseEventpublic void mousePressed(MouseEvent e)
Component上でマウス・ボタンが押されたときに呼び出されます。
mousePressed、インタフェースMouseListenere - MouseEventpublic void mouseReleased(MouseEvent e)
mouseReleased、インタフェースMouseListenere - MouseEventpublic void mouseEntered(MouseEvent e)
mouseEntered、インタフェースMouseListenere - MouseEventpublic void mouseExited(MouseEvent e)
mouseExited、インタフェースMouseListenere - MouseEventpublic void mouseDragged(MouseEvent e)
mouseDragged、インタフェースMouseMotionListenere - MouseEventpublic void mouseMoved(MouseEvent e)
mouseMoved、インタフェースMouseMotionListenere - MouseEvent バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。