インターフェース MouseHandler

関数インターフェース:
これは関数インターフェースであるため、ラムダ式またはメソッド参照の割り当てターゲットとして使用できます。

@FunctionalInterfaceSE public interface MouseHandler
マウスイベントを MouseHandler.MouseHandlerArgs の形式で処理し、MouseHandler.MouseHandlerResult を返します。通常は View で使用されます。MouseHandler 自体には、使用方法に関する制限は定義されていません。
作成者:
Janne Valkealahti, Piotr Olaszewski
  • メソッドの詳細

    • handle

      MouseHandler.MouseHandlerArgs でラップされたマウスイベントを処理します。
      パラメーター:
      args - マウスハンドラー引数
      戻り値:
      ハンドラーの結果
    • thenConditionally

      default MouseHandler thenConditionally(MouseHandler other, PredicateSE<MouseHandler.MouseHandlerResult> predicate)
      最初に this ハンドラーを処理し、その後 predicate と this の結果が一致する場合に other ハンドラーを処理する、合成されたハンドラーを返します。
      パラメーター:
      other - このハンドラーの後に処理するハンドラー
      predicate - この結果に対する述語テスト
      戻り値:
      構成されたハンドラー
    • thenIfConsumed

      default MouseHandler thenIfConsumed(MouseHandler other)
      this がイベントを消費した場合は、最初に this ハンドラーを処理し、次に other を処理する、合成されたハンドラーを返します。
      パラメーター:
      other - このハンドラーの後に処理するハンドラー
      戻り値:
      構成されたハンドラー
    • thenIfNotConsumed

      default MouseHandler thenIfNotConsumed(MouseHandler other)
      this がイベントを消費しなかった場合は、最初に this ハンドラーを処理し、次に other を処理する合成ハンドラーを返します。
      パラメーター:
      other - このハンドラーの後に処理するハンドラー
      戻り値:
      構成されたハンドラー
    • neverConsume

      static MouseHandler neverConsume()
      常に非消費の結果を返すハンドラーを返します。
      戻り値:
      常に非消費の結果を返すハンドラー
    • argsOf

      MouseEvent から MouseHandler.MouseHandlerArgs を構築します。
      パラメーター:
      event - マウスイベント
      戻り値:
      マウスハンドラーの引数
    • resultOf

      static MouseHandler.MouseHandlerResult resultOf(MouseEvent event, boolean consumed, @Nullable View focus, @Nullable View capture)
      MouseEventView から MouseHandler.MouseHandlerResult を構築します。
      パラメーター:
      event - マウスイベント
      consumed - イベントが消費されたかどうかを示すフラグ
      focus - フォーカスをリクエストしているビュー
      capture - イベントを捉えたビュー
      戻り値:
      マウスハンドラーの結果