|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.awt.dnd.DragGestureRecognizer
DragGestureRecognizer
は、プラットフォーム依存のドラッグ開始ジェスチャーを識別するために、特定の Component
に関連付けることができる、プラットフォーム依存のリスナーを指定するための抽象基底クラスです。
適切な DragGestureRecognizer
のサブクラスは、特定の Component
に関連付けられている DragSource
、または createDragGestureRecognizer() メソッドを介して Toolkit
オブジェクトから取得されます。
特定の Component
に関連付けられると、DragGestureRecognizer
は Component
に送られる入力イベントを追跡するために、その Component
に適切なリスナーインタフェースを登録します。
Component
でイベントのシーケンスをドラッグ開始ジェスチャーとして識別すると、DragGestureRecognizer
は gestureRecognized() メソッドを呼び出してそのユニキャスト DragGestureListener
に通知します。
具象 DragGestureRecognizer
インスタンスが、関連付けられている Component
でドラッグ開始ジェスチャーを検出すると、DragGestureListener
イベントのユニキャストイベントソースに登録されている DragGestureListener
へ DragGestureEvent
をトリガします。この DragGestureListener
は、関連付けられた DragSource
に必要に応じてドラッグ&ドロップ操作の開始を促します。
DragGestureListener
,
DragGestureEvent
,
DragSource
,
直列化された形式フィールドの概要 | |
protected Component |
component
DragGestureRecognizer に関連した Component です。 |
protected DragGestureListener |
dragGestureListener
DragGestureRecognizer に関連した DragGestureListener です。 |
protected DragSource |
dragSource
DragGestureRecognizer に関連した DragSource です。 |
protected ArrayList |
events
ドラッグをトリガする「ジェスチャー」として DragGestureRecognizer が「認識される」ようにするイベントのリストです。 |
protected int |
sourceActions
ドラッグ&ドロップ操作で使用するアクションの形式を表す int です。 |
コンストラクタの概要 | |
protected |
DragGestureRecognizer(DragSource ds)
このドラッグ&ドロップ操作に使用する DragSource を指定して新しい DragGestureRecognizer を構築します。
|
protected |
DragGestureRecognizer(DragSource ds,
Component c)
このドラッグ&ドロップ操作に使用する DragSource 、この DragGestureRecognizer がドラッグ開始ジェスチャーを「監視」できる Component を指定して新しい DragGestureRecognizer を構築します。
|
protected |
DragGestureRecognizer(DragSource ds,
Component c,
int sa)
このドラッグ&ドロップ操作に使用する DragSource 、この DragGestureRecognizer がドラッグ開始ジェスチャーを「監視」できる Component 、このドラッグ&ドロップ操作をサポートするアクションを指定して新しい DragGestureRecognizer を構築します。
|
protected |
DragGestureRecognizer(DragSource ds,
Component c,
int sa,
DragGestureListener dgl)
このドラッグ&ドロップ操作に使用する DragSource 、この DragGestureRecognizer がドラッグ開始ジェスチャーを「監視」できる Component 、このドラッグ&ドロップ操作をサポートするアクション、および DragGestureListener を指定して新しい DragGestureRecognizer を構築して、ドラッグ開始ジェスチャーを検出したことを一度通知します。
|
メソッドの概要 | |
void |
addDragGestureListener(DragGestureListener dgl)
新しい DragGestureListener を登録します。
|
protected void |
appendEvent(InputEvent awtie)
この Recognizer によって Component で登録されたリスナーは、この API を介して、ドラッグ&ドロップ開始ジェスチャーを構成する一連のイベントの一部として認識されるすべてのイベントを記録します。 |
protected void |
fireDragGestureRecognized(int dragAction,
Point p)
ドラッグ&ドロップ開始ジェスチャーが発生したことを DragGestureListener に通知します。 |
Component |
getComponent()
このメソッドは、ドラッグ開始ジェスチャーを DragGestureRecognizer に「監視」される Component を返します。
|
DragSource |
getDragSource()
このメソッドは、この DragGestureRecognizer が、ドラッグ&ドロップ操作を処理するために使用する DragSource を返します。
|
int |
getSourceActions()
このメソッドは、このドラッグ&ドロップ操作がサポートするアクションの形式を表す int を返します。 |
InputEvent |
getTriggerEvent()
このメソッドは、ドラッグ&ドロップ操作を開始した一連のイベントの最初のイベントを返します。 |
protected abstract void |
registerListeners()
この DragGestureRecognizer のリスナーを Component に登録します。 |
void |
removeDragGestureListener(DragGestureListener dgl)
現在の DragGestureListener の登録を解除します。 |
void |
resetRecognizer()
Recognizer を取り消します。 |
void |
setComponent(Component c)
DragGestureRecognizer が関連付けられている Component を設定します。 |
void |
setSourceActions(int actions)
このメソッドはドラッグ&ドロップ操作に許可されているソースドラッグアクションを設定します。 |
protected abstract void |
unregisterListeners()
この DragGestureRecognizer のリスナーを Component から登録解除します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
protected DragSource dragSource
DragGestureRecognizer
に関連した DragSource
です。
protected Component component
DragGestureRecognizer
に関連した Component
です。
protected transient DragGestureListener dragGestureListener
DragGestureRecognizer
に関連した DragGestureListener
です。
protected int sourceActions
int
です。
protected ArrayList events
DragGestureRecognizer
が「認識される」ようにするイベントのリストです。
コンストラクタの詳細 |
protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)
DragSource
、この DragGestureRecognizer
がドラッグ開始ジェスチャーを「監視」できる Component
、このドラッグ&ドロップ操作をサポートするアクション、および DragGestureListener
を指定して新しい DragGestureRecognizer
を構築して、ドラッグ開始ジェスチャーを検出したことを一度通知します。
ds
- この DragGestureRecognizer
が、ドラッグ&ドロップ操作を処理するために使用する DragSource
c
- この DragGestureRecognizer
がドラッグ開始ジェスチャーを検出するためにイベントストリームを「監視」する Component
。この値が null
の場合、DragGestureRecognizer
はどの Component
にも関連付けられていません。sa
- このドラッグ&ドロップ操作がサポートする DnDConstants
のセット (論理和)dgl
- ドラッグジェスチャーが検出されたときに通知する DragGestureRecognizer
IllegalArgumentException
- ds が null
の場合protected DragGestureRecognizer(DragSource ds, Component c, int sa)
DragSource
、この DragGestureRecognizer
がドラッグ開始ジェスチャーを「監視」できる Component
、このドラッグ&ドロップ操作をサポートするアクションを指定して新しい DragGestureRecognizer
を構築します。
ds
- この DragGestureRecognizer
が、ドラッグ&ドロップ操作を処理するために使用する DragSource
c
- この DragGestureRecognizer
がドラッグ開始ジェスチャーを検出するためにイベントストリームを「監視」する Component
。この値が null
の場合、DragGestureRecognizer
はどの Component
にも関連付けられていません。sa
- このドラッグ&ドロップ操作がサポートする DnDConstants
のセット (論理和)
IllegalArgumentException
- ds が null
の場合protected DragGestureRecognizer(DragSource ds, Component c)
DragSource
、この DragGestureRecognizer
がドラッグ開始ジェスチャーを「監視」できる Component
を指定して新しい DragGestureRecognizer
を構築します。
ds
- この DragGestureRecognizer
が、ドラッグ&ドロップ操作を処理するために使用する DragSource
c
- この DragGestureRecognizer
がドラッグ開始ジェスチャーを検出するためにイベントストリームを「監視」する Component
。この値が null
の場合、DragGestureRecognizer
はどの Component
にも関連付けられていません。
IllegalArgumentException
- ds が null
の場合protected DragGestureRecognizer(DragSource ds)
DragSource
を指定して新しい DragGestureRecognizer
を構築します。
ds
- この DragGestureRecognizer
が、ドラッグ&ドロップ操作を処理するために使用する DragSource
IllegalArgumentException
- ds が null
の場合メソッドの詳細 |
protected abstract void registerListeners()
protected abstract void unregisterListeners()
public DragSource getDragSource()
DragGestureRecognizer
が、ドラッグ&ドロップ操作を処理するために使用する DragSource
を返します。
public Component getComponent()
DragGestureRecognizer
に「監視」される Component
を返します。
public void setComponent(Component c)
c
- Component
または null
public int getSourceActions()
public void setSourceActions(int actions)
actions
- 許可されているソースドラッグアクションpublic InputEvent getTriggerEvent()
public void resetRecognizer()
public void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException
DragGestureListener
を登録します。
dgl
- この DragGestureRecognizer
に同時に登録する DragGestureListener
TooManyListenersException
- DragGestureListener
がすでに追加されている場合public void removeDragGestureListener(DragGestureListener dgl)
dgl
- この DragGestureRecognizer
から登録を解除する DragGestureListener
IllegalArgumentException
dgl
- が現在登録されている DragGestureListener
ではない場合 (異なる場合)protected void fireDragGestureRecognized(int dragAction, Point p)
dragAction
- ユーザジェスチャーが最初に選択したアクションp
- ジェスチャーが発生したポイント (Component の座標)protected void appendEvent(InputEvent awtie)
このメソッドは DragGestureRecognizer
実装が InputEvent
サブクラス (ドラッグ&ドロップ操作を構成する一連のイベントの一つ) を、この DragGestureRecognizer
が内部的に維持しているイベント配列に追加するときに使用します。
awtie
- この DragGestureRecognizer
の内部イベント配列に追加する InputEvent
。null
は有効値ではなく無視される
|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Java、Java 2D、および JDBC は米国ならびにその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.