Interface IUIFloatOpener
The component supplies only what this code cannot know: which Float, getFloat(), and what it is anchored to, getFloatAnchor(). Everything else is here, once, as default methods, so that no component and no application repeats it and none can get it wrong:
- the owner guard - a Float is opened only for a panel that owns it, never for a Float or a panel part (
UIFloat.getOwnerError(UIPanelBase)); - the single-Float rule - the Float that is open in the client session is closed first, whatever opened it;
- the fast close - that Float is closed at once, without its animation, unless the Float being opened asks for the graceful close (
UIFloat.isCloseOthersAnimated()). The client decides how it looks; both changes leave in the same transaction, which is what makes "at once" the same frame; - the open and close calls, for this client session and for every client session of the application session. The second is what a programmer iterating the client sessions writes by hand today. There is no opening a Float in an application that uses no VirtualSpace: a Float always has one, its own or its owner's, because no panel is virtualized without one, and an open Float is an attached panel of it (
IUIFloatHost.openFloat(UIFloat, UIPanelBase, UIComp)).
A UIComp that implements this interface has getUIPanel() already.
What the client session must provide is IUIFloatHost. A client session that is not a host refuses, loudly: the call logs SEVERE and returns false, and nothing is opened. That is deliberate. Opening a Float beside the client session, from a helper, cannot take its lock and cannot reset its cache of the panels shown, and a Float that half-opens is worse than one that does not.
Not here, on purpose: where focus goes when a Float opens or closes, and what is presented beneath it. Both are the focus engine's.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptiondefault booleanCloses the Float in the client session of this component, if it is the one open.default booleancloseFloat(IClientSessionGyro clientGyro) Closes the Float in a client session, if it is the one open.default intCloses the Float in every client session of the application session of this component where it is the one open.getFloat()Gets the Float this component opens.Gets the component the Float is anchored to.default IClientSessionGyro[]Gets the client sessions of the application session of this component.Gets the panel of this component: the panel that must own the Float.default booleanOpens the Float in the client session of this component.default booleanopenFloat(IClientSessionGyro clientGyro) Opens the Float in a client session.default intOpens the Float in every client session of the application session of this component.
Method Details
getFloat
UIFloat getFloat()Gets the Float this component opens.- Returns:
- The Float, virtualized or not, null if the component has none: nothing is opened then.
getFloatAnchor
UIComp getFloatAnchor()Gets the component the Float is anchored to.- Returns:
- The anchor, typically this component itself, null to centre the Float.
getUIPanel
UIPanelBase getUIPanel()Gets the panel of this component: the panel that must own the Float.UICompimplements this.- Returns:
- The panel, null if the component is in none.
openFloat
default boolean openFloat()Opens the Float in the client session of this component.- Returns:
- true if the Float is open when the call returns, false if it was refused; the reason is logged.
openFloat
Opens the Float in a client session.Opening the Float that is already open is a success and changes nothing.
- Parameters:
clientGyro- The client session.- Returns:
- true if the Float is open when the call returns, false if it was refused; the reason is logged.
closeFloat
default boolean closeFloat()Closes the Float in the client session of this component, if it is the one open.- Returns:
- true if the Float was open and its removal requested, false otherwise.
closeFloat
Closes the Float in a client session, if it is the one open. The ordinary close keeps its animation. A Float other than this component's is left alone.- Parameters:
clientGyro- The client session.- Returns:
- true if the Float was open and its removal requested, false otherwise.
openFloatInAllClientSessions
default int openFloatInAllClientSessions()Opens the Float in every client session of the application session of this component.The owner guard is checked once, against the panel of this component: it is a property of the panel and the Float, not of a client session.
- Returns:
- The number of client sessions the Float is open in when the call returns, zero if the component is in no application session.
closeFloatInAllClientSessions
default int closeFloatInAllClientSessions()Closes the Float in every client session of the application session of this component where it is the one open.- Returns:
- The number of client sessions the removal was requested in.
getFloatClientSessions
Gets the client sessions of the application session of this component.- Returns:
- The client sessions, empty if the component is in no application session.