Class UIFloat

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IUIPanelAnimation, IComponent, IClassReferenceOwner, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IReferrerParticipant, ISelectorOwner, IUIClassReferenceOwner, IUIComp, IUIContainer, IUIContextMenuOwner, IUIFocusComp, IUIGroupSeparator, IUIPanelOwner, IVSAccessor, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSGenericComponentListener, IVSParticipant, Cloneable
Direct Known Subclasses:
EUIFloat

public class UIFloat extends UIPanelBase
Float: a panel type that floats above every panel and dialog.

A Float is a panel, authored in its own .iiziPanel file with the root tag UIFloat. It is never shown by VirtualSpace focus alone: it is owned by one or more top-level panels or dialogs, each holding a FloatReference to it, and it is opened through IUIFloatOpener.

The rules this class states, and the guards that hold them:

  • A Float is owned by a top-level panel or dialog, never by another Float and never by a panel part: getOwnerError(UIPanelBase) is the runtime guard, verify(PropVerification) the Designer one.
  • Only one Float is open at a time in a client session. The rule is owned by IUIFloatOpener, not by this class.
  • A closed Float is disposed of, as any panel is.

A Float is a pop-up panel (isPopupPanel()) that is added to the panels already shown (UIPanelBase.PP_ADD_PANEL): opening one never replaces its owner.

Author:
Christopher Mindus
  • Field Details

    • PN_SIZE_MODE

      public static final String PN_SIZE_MODE
      Property name: size mode IntProp, SIZE_AUTO or SIZE_FIXED.
      See Also:
    • PN_MODALITY

      public static final String PN_MODALITY
      Property name: modality IntProp, MODELESS, LIGHT or MODAL.
      See Also:
    • PN_ANIMATION

      public static final String PN_ANIMATION
      Property name: animation type IntProp, one of the ANIM_* values.
      See Also:
    • PN_SPEED

      public static final String PN_SPEED
      Property name: animation speed IntProp, one of the SPEED_* values.
      See Also:
    • PN_EASING

      public static final String PN_EASING
      Property name: easing IntProp, one of the EASING_* values.
      See Also:
    • PN_CLOSE_OTHERS_ANIMATED

      public static final String PN_CLOSE_OTHERS_ANIMATED
      Property name: BoolProp for the graceful close of the Float that is open when another one is opened. Default false: the open Float is closed without animation, in the same frame, because the user has already left it.
      See Also:
    • PN_BACKDROP

      public static final String PN_BACKDROP
      Property name: backdrop IntProp, what the scrim beneath a light or a modal Float shows of the page: BACKDROP_AUTO (default), BACKDROP_NONE, BACKDROP_DIM or BACKDROP_BLUR. A modeless Float has no scrim and so no backdrop. Read by the client (floatlayer.js), which also decides what a Browser that cannot blur shows.
      See Also:
    • PN_SCRIM_COLOR

      public static final String PN_SCRIM_COLOR
      Property name: the scrim colour ColorProp, the colour (with its alpha) the scrim beneath a light or a modal Float is painted with for the dim and the blur backdrop. Undefined (the default) is the theme's scrim colour (ScrimBackground, which follows the light and the dark scheme); defined, the colour is painted as given, a named theme colour following the scheme as every referenced colour does on the client (CC-FIX-FLOAT-COMPLETE-V5-C, FC-D-15).
      See Also:
    • PN_BLUR_RADIUS

      public static final String PN_BLUR_RADIUS
      Property name: the blur radius UnitProp of the blur backdrop. Undefined (the default) is DEFAULT_BLUR_RADIUS_PX pixels; defined, that radius, for the blur backdrop only (CC-FIX-FLOAT-COMPLETE-V5-C, FC-D-15).
      See Also:
    • PN_PHONE_MODE

      public static final String PN_PHONE_MODE
      Property name: phone mode IntProp, how the Float is shown on a phone: PHONE_AUTO (default), PHONE_ANCHORED, PHONE_SHEET or PHONE_FULLSCREEN. "A phone" is a viewport no wider than 600 CSS pixels (floatplace.js SHEET_MAX_WIDTH); on a desktop every value places the Float beside its anchor (CC-FIX-FLOAT-COMPLETE-V5-C, FC-D-14).
      See Also:
    • PN_ANCHOR

      public static final String PN_ANCHOR
      Property name: the anchor StringProp, the path of the component the Float is placed around. It exists on a virtualized Float only: the client session sets it when it opens the Float, it is never authored and never saved.
      See Also:
    • REMOTE_CLOSED_EVENT

      public static final int REMOTE_CLOSED_EVENT
      The remote event the client sends when the Float has been closed for a cause that arose on the client: a press outside a light Float, a dialog opening, another Float taking its place in the Float layer. The client has closed it for the eye only, and the server answers by requesting the removal, as for every panel.

      It is 2 because a panel has 1 taken in both directions: from the client 1 is Back, which a Float being closed is not.

      See Also:
    • PN_CX

      public static final String PN_CX
      Property name: the fixed width GUnit, used when the size mode is SIZE_FIXED.
      See Also:
    • PN_CY

      public static final String PN_CY
      Property name: the fixed height GUnit, used when the size mode is SIZE_FIXED.
      See Also:
    • SIZE_AUTO

      public static final int SIZE_AUTO
      Size mode: the Float is sized to fit its contents (default).
      See Also:
    • SIZE_FIXED

      public static final int SIZE_FIXED
      Size mode: the Float has the fixed size of its cx and cy properties.
      See Also:
    • MODELESS

      public static final int MODELESS
      Modality: nothing is blocked, the panels underneath stay live.
      See Also:
    • LIGHT

      public static final int LIGHT
      Modality: a press outside the Float closes it and is swallowed (default).
      See Also:
    • BACKDROP_AUTO

      public static final int BACKDROP_AUTO
      Backdrop: as the modality has it (default): a modal Float dims the page beneath it, a light Float leaves it as it is.
      See Also:
    • BACKDROP_NONE

      public static final int BACKDROP_NONE
      Backdrop: the page beneath the Float is left as it is, for a modal Float too.
      See Also:
    • BACKDROP_DIM

      public static final int BACKDROP_DIM
      Backdrop: the page beneath the Float is dimmed with the scrim colour of the theme.
      See Also:
    • BACKDROP_BLUR

      public static final int BACKDROP_BLUR
      Backdrop: the page beneath the Float is blurred and dimmed; a Browser that cannot blur what lies beneath an element dims.
      See Also:
    • DEFAULT_BLUR_RADIUS_PX

      public static final int DEFAULT_BLUR_RADIUS_PX
      The blur radius of the blur backdrop in pixels when PN_BLUR_RADIUS is undefined.
      See Also:
    • PHONE_AUTO

      public static final int PHONE_AUTO
      Phone mode: automatic (default): on a phone the Float is a sheet when no side of its anchor holds it whole or its contents exceed the viewport, else it is placed beside its anchor.
      See Also:
    • PHONE_ANCHORED

      public static final int PHONE_ANCHORED
      Phone mode: never a sheet: on a phone the Float is placed beside its anchor and held to the viewport, as on a desktop.
      See Also:
    • PHONE_SHEET

      public static final int PHONE_SHEET
      Phone mode: always a sheet on a phone: at the bottom of the viewport, as wide as it.
      See Also:
    • PHONE_FULLSCREEN

      public static final int PHONE_FULLSCREEN
      Phone mode: the whole viewport on a phone.
      See Also:
    • ANIM_NONE

      public static final int ANIM_NONE
      Animation: none, the Float appears and disappears instantly.
      See Also:
    • ANIM_FADE

      public static final int ANIM_FADE
      Animation: fade.
      See Also:
    • ANIM_GROW

      public static final int ANIM_GROW
      Animation: grow from the anchor point (default).
      See Also:
    • ANIM_UNFOLD

      public static final int ANIM_UNFOLD
      Animation: unfold from the anchored edge.
      See Also:
    • ANIM_SLIDE

      public static final int ANIM_SLIDE
      Animation: slide in on the docked axis.
      See Also:
    • ANIM_RISE

      public static final int ANIM_RISE
      Animation: a small lift.
      See Also:
    • SPEED_FAST

      public static final int SPEED_FAST
      Speed: fast. The speeds are the five of the panel animations, same order.
      See Also:
    • SPEED_NORMAL

      public static final int SPEED_NORMAL
      Speed: normal (default).
      See Also:
    • SPEED_SLOW

      public static final int SPEED_SLOW
      Speed: slow.
      See Also:
    • SPEED_SLOWER

      public static final int SPEED_SLOWER
      Speed: slower.
      See Also:
    • SPEED_SLOWEST

      public static final int SPEED_SLOWEST
      Speed: slowest.
      See Also:
    • EASING_STANDARD

      public static final int EASING_STANDARD
      Easing: decelerate when opening, accelerate when closing (default).
      See Also:
    • EASING_EASE

      public static final int EASING_EASE
      Easing: the CSS keywords ease-out when opening, ease-in when closing.
      See Also:
    • EASING_LINEAR

      public static final int EASING_LINEAR
      Easing: linear.
      See Also:
  • Constructor Details

    • UIFloat

      public UIFloat()
      Creates the container without name with a null value.
    • UIFloat

      public UIFloat(Atom propertyAtom)
      Creates the container with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
  • Method Details

    • clone

      public UIFloat clone()
      Clones the Float.
      Overrides:
      clone in class UIPanelBase
    • getParticipantType

      public String getParticipantType()
      Returns the given type of the referrer participant.
      Specified by:
      getParticipantType in interface IReferrerParticipant
      Overrides:
      getParticipantType in class UIPanelBase
    • isPopupPanel

      public boolean isPopupPanel()
      Returns if this is a pop-up panel placed on top of main panels.
      Overrides:
      isPopupPanel in class UIPanelBase
      Returns:
      true, always: a Float never is a main panel.
    • getOnCreateExistingPanelProcessing

      public final int getOnCreateExistingPanelProcessing()
      Returns how to process the panels shown when this panel is virtualized.
      Overrides:
      getOnCreateExistingPanelProcessing in class UIPanelBase
      Returns:
      UIPanelBase.PP_ADD_PANEL, always: a Float is added above its owner and never replaces a panel. Closing the Float that is already open is the single-Float rule of IUIFloatOpener, not a replace policy.
    • getSizeMode

      public int getSizeMode()
      Gets the size mode.
      Returns:
      SIZE_AUTO (default, also for a value out of range) or SIZE_FIXED.
    • getModality

      public int getModality()
      Gets the modality.
      Returns:
      MODELESS, LIGHT (default, also for a value out of range) or MODAL.
    • getBackdrop

      public int getBackdrop()
      Gets the backdrop: what the scrim beneath a light or a modal Float shows of the page.
      Returns:
      One of the BACKDROP_* values, BACKDROP_AUTO by default and for a value out of range.
    • getScrimColor

      public GColor getScrimColor()
      Gets the scrim colour: what the scrim beneath a light or a modal Float is painted with for the dim and the blur backdrop.
      Returns:
      The colour, with its alpha, or null when undefined: the theme's scrim colour, which follows the light and the dark scheme.
    • getBlurRadius

      public GUnit getBlurRadius()
      Gets the blur radius of the blur backdrop.
      Returns:
      The radius, or null when undefined: DEFAULT_BLUR_RADIUS_PX pixels.
    • getPhoneMode

      public int getPhoneMode()
      Gets the phone mode: how the Float is shown on a phone.
      Returns:
      One of the PHONE_* values, PHONE_AUTO by default and for a value out of range.
    • getFloatAnimation

      public int getFloatAnimation()
      Gets the animation type.
      Returns:
      One of the ANIM_* values, ANIM_GROW by default and for a value out of range.
    • getFloatSpeed

      public int getFloatSpeed()
      Gets the animation speed.
      Returns:
      One of the SPEED_* values, SPEED_NORMAL by default and for a value out of range.
    • getEasing

      public int getEasing()
      Gets the easing.
      Returns:
      One of the EASING_* values, EASING_STANDARD by default and for a value out of range.
    • isCloseOthersAnimated

      public boolean isCloseOthersAnimated()
      Returns if the Float that is open when this one is opened is closed gracefully, i.e. with its animation.
      Returns:
      false by default: the open Float is closed at once, without animation.
    • hasExplicitWidth

      public boolean hasExplicitWidth()
      Verifies if the component has a width.
      Overrides:
      hasExplicitWidth in class UIComp
      Returns:
      true if the size mode is fixed and the width is defined and non-zero, false otherwise: an auto-sized Float takes its width from its contents.
    • hasExplicitHeight

      public boolean hasExplicitHeight()
      Verifies if the component has an implicit height.
      Overrides:
      hasExplicitHeight in class UIComp
      Returns:
      true if the size mode is fixed and the height is defined and non-zero, false otherwise: an auto-sized Float takes its height from its contents.
    • onRemoteEvent

      public void onRemoteEvent(RemoteEvent event)
      Called when the property receives a remote event from its corresponding remote counterpart.
      Specified by:
      onRemoteEvent in interface IGProp<GProp<?>[]>
      Overrides:
      onRemoteEvent in class UIPanelBase
      Parameters:
      event - The remote event.
    • onBackWithoutHandler

      protected boolean onBackWithoutHandler(IClientSessionGyro clientGyro)
      Back on a Float that has no handler of its own closes the Float instead of running a history backward operation (ruling FL-5 of 2026-09-27): the client sends Back to the topmost panel, which is the open Float, and the Float is what leaves first, as a dialog does. A Float whose class has an @OnUIBack method or that has a vsBack action keeps Back for that handler, as every panel does; the owner's handler is not consulted, because the owner is not the panel Back was sent to. The focus then returns to the field that opened the Float, else to the owner panel (ruling FL-6), which the host does when it closes the Float.
      Overrides:
      onBackWithoutHandler in class UIPanelBase
      Parameters:
      clientGyro - The client session that sent the Back event.
      Returns:
      true when the client session hosts Floats: the Float is closed, or already was. false when it does not, which is logged: the history backward operation then runs as before.
    • getOwnerError

      public String getOwnerError(UIPanelBase owner)
      The runtime guard of the ownership rule: checks that a panel is a legal owner of this Float.

      A legal owner is a top-level panel or dialog, never a Float and never a panel part, that holds a FloatReference resolving to this Float. The owner may be virtualized or not, and so may this Float: both are compared by their non-virtualized instances.

      Parameters:
      owner - The panel to check, the top-level panel of the component that opens the Float.
      Returns:
      null if the panel is a legal owner, otherwise the reason it is refused, in English, for the log.
    • verify

      public boolean verify(PropVerification verification)
      Verifies this property container: the Designer guard of the ownership rule. A Float that holds a reference to a Float would own it, which is refused.
      Specified by:
      verify in interface IGProp<GProp<?>[]>
      Overrides:
      verify in class UIPanelBase
      Parameters:
      verification - The property verification class.
      Returns:
      true if verification should proceed, false if disposed of and verification should not take place.