Interface IUIFloatHost

All Known Implementing Classes:
ClientSessionGyro

public interface IUIFloatHost
What a client session does with a Float: the three operations that need the panels of the client session, and nothing else.

This is the seam between the rules of a Float and the client session. The rules - who may own a Float, that only one is open, how the open one is closed - are in IUIFloatOpener and are complete without this interface. What is here is only what cannot be done from outside the client session: a virtualized panel reaches a client through the container of virtualized panels, under the lock of the client session, and the client session caches the panels it shows. An implementation that adds or removes a Float without resetting that cache leaves IClientSessionGyro.getVirtualizedPanels() and getTopmostPanel() stale, which is why the implementation belongs inside the client session and is not a helper beside it.

The anchor and the owner are passed as they are known to the caller, virtualized in any client session or not at all. The host maps them to its own client session, because it is the host that knows what it has virtualized.

Author:
Christopher Mindus
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    closeFloat(UIFloat virtualFloat)
    Closes a Float that is open in this client session: requests its removal, as the client session does for every panel.
    Gets the Float that is open in this client session.
    openFloat(UIFloat floatPanel, UIPanelBase owner, UIComp anchor)
    Opens a Float in this client session: virtualizes it and adds it to the panels shown.
  • Method Details

    • getOpenFloat

      UIFloat getOpenFloat()
      Gets the Float that is open in this client session.
      Returns:
      The virtualized Float, or null if none is open. A Float whose removal has been requested is not open.
    • openFloat

      UIFloat openFloat(UIFloat floatPanel, UIPanelBase owner, UIComp anchor) throws PropException
      Opens a Float in this client session: virtualizes it and adds it to the panels shown. The host neither checks the owner nor closes the Float that is open - both are done before this call, by IUIFloatOpener.
      Parameters:
      floatPanel - The Float to open, non-virtualized.
      owner - The owner panel the Float is opened for, virtualized or not. It is here for the focus engine, which decides what is presented beneath a Float; opening does not depend on it.
      anchor - The component the Float is anchored to, virtualized or not, null to centre the Float.
      Returns:
      The virtualized Float that was added, never null.
      Throws:
      PropException - If the Float cannot be virtualized or added.
    • closeFloat

      boolean closeFloat(UIFloat virtualFloat)
      Closes a Float that is open in this client session: requests its removal, as the client session does for every panel. The client closes it, with or without its animation, and disposes of it.
      Parameters:
      virtualFloat - The virtualized Float, as returned by getOpenFloat().
      Returns:
      true if the removal was requested, false if it already had been.