Java プラットフォーム 1.2

java.awt.dnd
クラス DragGestureRecognizer

java.lang.Object
  |
  +--java.awt.dnd.DragGestureRecognizer
直接の既知のサブクラス:
MouseDragGestureRecognizer

public abstract class DragGestureRecognizer
extends Object

DragGestureRecognizer は、プラットフォーム依存のドラッグ&ドロップアクション開始ジェスチャーを識別するために、特定の Component に関連付けることができる、プラットフォーム依存のリスナーを指定するための抽象基底クラスです。

適切な DragGestureRecognizer のサブクラスは、特定の Component に関連付けられている DragSource、または createDragGestureRecognizer() メソッドを介して Toolkit オブジェクトから取得されます。

特定の Component に関連付けられると、DragGestureRecognizer は Component に送られる入力イベントを追跡するためにその Component で適切な Listener インタフェースを登録します。

Component でイベントのシーケンスをドラッグ&ドロップアクション開始ジェスチャーとして識別すると、DragGestureRecognizer は gestureRecognized() メソッドを呼び出してそのユニキャスト DragGestureListener に通知します。

関連項目:
DragGestureListener, DragGestureEvent, DragSource

フィールドの概要
protected  Component component
           
protected  DragGestureListener dragGestureListener
           
protected  DragSource dragSource
           
protected  ArrayList events
           
protected  int sourceActions
           
 
コンストラクタの概要
protected DragGestureRecognizer(DragSource ds)
          新しい DragGestureRecognizer を構築します。
protected DragGestureRecognizer(DragSource ds, Component c)
          新しい DragGestureRecognizer を構築します。
protected DragGestureRecognizer(DragSource ds, Component c, int sa)
          新しい DragGestureRecognizer を構築します。
protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)
          新しい DragGestureRecognizer を構築します。
 
メソッドの概要
 void addDragGestureListener(DragGestureListener dgl)
          新しい DragGestureListener を登録します。
protected  void appendEvent(InputEvent awtie)
          このレコグナイザによって Component で登録されたリスナーは、この API を介して、ドラッグ&ドロップ開始ジェスチャーを構成する一連のイベントの一部として認識されるすべてのイベントを記録します。
protected  void fireDragGestureRecognized(int dragAction, Point p)
          ドラッグ&ドロップ開始ジェスチャーが発生したことを DragGestureListener に通知します。
 Component getComponent()
           
 DragSource getDragSource()
           
 int getSourceActions()
           
 InputEvent getTriggerEvent()
           
protected abstract  void registerListeners()
          Component にこの DragGestureRecognizer の Listener を登録します。
 void removeDragGestureListener(DragGestureListener dgl)
          現在の DragGestureListener の登録を解除します。
 void resetRecognizer()
          Recognizer を取り消します。
 void setComponent(Component c)
          DragGestureRecognizer に関連付けられる Component を設定します。
 void setSourceActions(int actions)
          許可されるソースドラッグアクションを設定します。
protected abstract  void unregisterListeners()
          Component でこの DragGestureRecognizer の Listener の登録を解除します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

dragSource

protected DragSource dragSource

component

protected Component component

dragGestureListener

protected DragGestureListener dragGestureListener

sourceActions

protected int sourceActions

events

protected ArrayList events
コンストラクタの詳細

DragGestureRecognizer

protected DragGestureRecognizer(DragSource ds,
                                Component c,
                                int sa,
                                DragGestureListener dgl)
新しい DragGestureRecognizer を構築します。
パラメータ:
ds - Component c の DragSource
c - 監視される Component
sa - ソースドラッグアクション
dgl - ジェスチャーが検出されたときに通知する DragGestureRecognizer

DragGestureRecognizer

protected DragGestureRecognizer(DragSource ds,
                                Component c,
                                int sa)
新しい DragGestureRecognizer を構築します。
パラメータ:
ds - Component c の DragSource
sa - ソースドラッグアクション
c - 監視される Component

DragGestureRecognizer

protected DragGestureRecognizer(DragSource ds,
                                Component c)
新しい DragGestureRecognizer を構築します。
パラメータ:
ds - Component c の DragSource
c - 監視される Component

DragGestureRecognizer

protected DragGestureRecognizer(DragSource ds)
新しい DragGestureRecognizer を構築します。
パラメータ:
ds - Component c の DragSource
メソッドの詳細

registerListeners

protected abstract void registerListeners()
Component にこの DragGestureRecognizer の Listener を登録します。 サブクラスはこのメソッドをオーバーライドする必要があります。

unregisterListeners

protected abstract void unregisterListeners()
Component でこの DragGestureRecognizer の Listener の登録を解除します。 サブクラスはこのメソッドをオーバーライドする必要があります。

getDragSource

public DragSource getDragSource()
戻り値:
DragSource

getComponent

public Component getComponent()
戻り値:
この DragGestureRecognizer が関連付けられている Component

setComponent

public void setComponent(Component c)
DragGestureRecognizer に関連付けられる Component を設定します。 registerListeners() および unregisterListeners() は、必要に応じて副作用として呼び出されます。
パラメータ:
c - Component または null

getSourceActions

public int getSourceActions()
戻り値:
現在許可されているソースアクション

setSourceActions

public void setSourceActions(int actions)
許可されるソースドラッグアクションを設定します。

getTriggerEvent

public InputEvent getTriggerEvent()
戻り値:
ジェスチャーをトリガーした初期イベント

resetRecognizer

public void resetRecognizer()
Recognizer を取り消します。現在ジェスチャーを認識している場合は無視されます。

addDragGestureListener

public void addDragGestureListener(DragGestureListener dgl)
                            throws TooManyListenersException
新しい DragGestureListener を登録します。

removeDragGestureListener

public void removeDragGestureListener(DragGestureListener dgl)
現在の DragGestureListener の登録を解除します。

fireDragGestureRecognized

protected void fireDragGestureRecognized(int dragAction,
                                         Point p)
ドラッグ&ドロップ開始ジェスチャーが発生したことを DragGestureListener に通知します。次に、Recognizer の状態を取り消します。
パラメータ:
dragAction - ユーザジェスチャーが最初に選択したアクション
p - ジェスチャーが発生したポイント (Component の座標)

appendEvent

protected void appendEvent(InputEvent awtie)
このレコグナイザによって Component で登録されたリスナーは、この API を介して、ドラッグ&ドロップ開始ジェスチャーを構成する一連のイベントの一部として認識されるすべてのイベントを記録します。 この状態は、DragGestureListener が通知されたあと、ジェスチャーが完了したときにクリアされます。

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.