インターフェース MouseHandler
- 関数インターフェース:
- これは関数インターフェースであるため、ラムダ式またはメソッド参照の割り当てターゲットとして使用できます。
マウスイベントを
MouseHandler.MouseHandlerArgs の形式で処理し、MouseHandler.MouseHandlerResult を返します。通常は View で使用されます。MouseHandler 自体には、使用方法に関する制限は定義されていません。- 作成者:
- Janne Valkealahti, Piotr Olaszewski
ネストされたクラスの概要
ネストされたクラス方法の概要
修飾子と型メソッド説明argsOf(MouseEvent event) MouseEventからMouseHandler.MouseHandlerArgsを構築します。MouseHandler.MouseHandlerArgsでラップされたマウスイベントを処理します。static MouseHandler常に非消費の結果を返すハンドラーを返します。resultOf(MouseEvent event, boolean consumed, @Nullable View focus, @Nullable View capture) default MouseHandlerthenConditionally(MouseHandler other, PredicateSE<MouseHandler.MouseHandlerResult> predicate) 最初にthisハンドラーを処理し、その後predicateとthisの結果が一致する場合にotherハンドラーを処理する、合成されたハンドラーを返します。default MouseHandlerthenIfConsumed(MouseHandler other) thisがイベントを消費した場合は、最初にthisハンドラーを処理し、次にotherを処理する、合成されたハンドラーを返します。default MouseHandlerthenIfNotConsumed(MouseHandler other) thisがイベントを消費しなかった場合は、最初にthisハンドラーを処理し、次にotherを処理する合成ハンドラーを返します。
メソッドの詳細
handle
MouseHandler.MouseHandlerArgsでラップされたマウスイベントを処理します。- パラメーター:
args- マウスハンドラー引数- 戻り値:
- ハンドラーの結果
thenConditionally
default MouseHandler thenConditionally(MouseHandler other, PredicateSE<MouseHandler.MouseHandlerResult> predicate) 最初にthisハンドラーを処理し、その後predicateとthisの結果が一致する場合にotherハンドラーを処理する、合成されたハンドラーを返します。- パラメーター:
other- このハンドラーの後に処理するハンドラーpredicate- この結果に対する述語テスト- 戻り値:
- 構成されたハンドラー
thenIfConsumed
thisがイベントを消費した場合は、最初にthisハンドラーを処理し、次にotherを処理する、合成されたハンドラーを返します。- パラメーター:
other- このハンドラーの後に処理するハンドラー- 戻り値:
- 構成されたハンドラー
thenIfNotConsumed
thisがイベントを消費しなかった場合は、最初にthisハンドラーを処理し、次にotherを処理する合成ハンドラーを返します。- パラメーター:
other- このハンドラーの後に処理するハンドラー- 戻り値:
- 構成されたハンドラー
neverConsume
常に非消費の結果を返すハンドラーを返します。- 戻り値:
- 常に非消費の結果を返すハンドラー
argsOf
MouseEventからMouseHandler.MouseHandlerArgsを構築します。- パラメーター:
event- マウスイベント- 戻り値:
- マウスハンドラーの引数
resultOf
static MouseHandler.MouseHandlerResult resultOf(MouseEvent event, boolean consumed, @Nullable View focus, @Nullable View capture) - パラメーター:
event- マウスイベントconsumed- イベントが消費されたかどうかを示すフラグfocus- フォーカスをリクエストしているビューcapture- イベントを捉えたビュー- 戻り値:
- マウスハンドラーの結果