Package tripleplay.ui

Class MenuHost.Pop

java.lang.Object
tripleplay.ui.MenuHost.Pop
Enclosing class:
MenuHost

public static class MenuHost.Pop extends Object
An event type for triggering a menu popup.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    pythagoras.f.IRectangle
    The bounds to confine the menu, in screen coordinates; usually the whole screen.
    final Menu
    The menu to show.
    final pythagoras.f.IPoint
    The position of the pointer, if given during construction, otherwise null.
    final Element<?>
    The element that triggered the popup.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pop(Element<?> trigger, Menu menu)
    Creates a new event and initializes trigger and menu.
    Pop(Element<?> trigger, Menu menu, Event.XY pointer)
    Creates a new event and initializes trigger and menu.
  • Method Summary

    Modifier and Type
    Method
    Description
    inElement(Element<?> elem)
    Optionally confines the menu area to the given element.
    inScreenArea(pythagoras.f.IRectangle area)
    Optionally confines the menu area to the given screen area.
    Pops up this instance on the trigger's root's menu host.
    Causes the menu to handle further events on the given layer.
    Flags this Pop event so that the menu will not be destroyed automatically when it is deactivated.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • trigger

      public final Element<?> trigger
      The element that triggered the popup.
    • pointer

      public final pythagoras.f.IPoint pointer
      The position of the pointer, if given during construction, otherwise null.
    • bounds

      public pythagoras.f.IRectangle bounds
      The bounds to confine the menu, in screen coordinates; usually the whole screen.
  • Constructor Details

  • Method Details

    • relayEvents

      public MenuHost.Pop relayEvents(Layer layer)
      Causes the menu to handle further events on the given layer. This is usually the layer handling a pointer start that caused the popup. A listener will be added to the layer and the menu notified of pointer drag and end events.
    • retainMenu

      public MenuHost.Pop retainMenu()
      Flags this Pop event so that the menu will not be destroyed automatically when it is deactivated. Returns this instance for chaining.
    • inScreenArea

      public MenuHost.Pop inScreenArea(pythagoras.f.IRectangle area)
      Optionally confines the menu area to the given screen area. By default the menu is confined by the host's screen area (see MenuHost.getScreenArea()).
    • inElement

      public MenuHost.Pop inElement(Element<?> elem)
      Optionally confines the menu area to the given element. By default the menu is confined by the host's screen area (see MenuHost.getScreenArea()).
    • popup

      public MenuHost popup()
      Pops up this instance on the trigger's root's menu host. See MenuHost.popup(Pop). For convenience, returns the host that was used to perform the popup.